iphone - iOS Push Notifications Working on iOS 8 But Not on iOS 7 in iOS SDK 8.1 -
iphone - iOS Push Notifications Working on iOS 8 But Not on iOS 7 in iOS SDK 8.1 -
if([application respondstoselector:@selector(registerusernotificationsettings:)]) { [self registerforios8pushsettings]; //for ios8 } else { //ios7 or before [[uiapplication sharedapplication] registerforremotenotificationtypes:(uiremotenotificationtypebadge | uiremotenotificationtypesound | uiremotenotificationtypealert)]; }
unable force notification ios7 device. didregisterforremotenotificatiosnwithdevicetoken
called, in fact message delivered. working fine in ios8.
with ios8 process had change. create app register ios8 , versions create this:
-(void)registerappfornotifications{ if ([[[uidevice currentdevice] systemversion] floatvalue] >= 8.0) { [[uiapplication sharedapplication] registerusernotificationsettings:[uiusernotificationsettings settingsfortypes:(uiusernotificationtypesound | uiusernotificationtypealert | uiusernotificationtypebadge) categories:nil]]; [[uiapplication sharedapplication] registerforremotenotifications]; } else { [[uiapplication sharedapplication] registerforremotenotificationtypes: (uiremotenotificationtypenewsstandcontentavailability| uiremotenotificationtypebadge | uiremotenotificationtypesound | uiremotenotificationtypealert)]; } }
ios iphone ios7 push-notification
Comments
Post a Comment