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

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -