ios - registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge|UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound -


[[uiapplication sharedapplication] registerforremotenotificationtypes:uiremotenotificationtypebadge|uiremotenotificationtypealert|uiremotenotificationtypesound]; not supported in ios 8.0 or later. 

don't have method?

from ios 8 onwards, use below.

if ([[[uidevice currentdevice] systemversion] floatvalue] >= 8.0) {     nslog(@"ios8 app");     [[uiapplication sharedapplication] registerusernotificationsettings:[uiusernotificationsettings settingsfortypes:(uiusernotificationtypesound | uiusernotificationtypealert | uiusernotificationtypebadge) categories:nil]];     [[uiapplication sharedapplication] registerforremotenotifications]; } else {     nslog(@"lower ios8 app");     [[uiapplication sharedapplication] registerforremotenotificationtypes:(uiremotenotificationtypealert | uiremotenotificationtypebadge | uiremotenotificationtypesound)]; } 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -