Push Notification not working in ios 8.3

时间秒杀一切 提交于 2019-12-11 10:40:48

问题


My Push Notification is not working in ios 8.3. I had build the project in xcode 6.0 which support upto ios 8.0. is it the Reason???


回答1:


// This conditions for ios8 notifications...

if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerUserNotificationSettings:)])
{
    [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]];
    [[UIApplication sharedApplication] registerForRemoteNotifications];
}
else
{
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:
     (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)];
}

Did you put this in - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions ???

Put this and check. It should work.




回答2:


I had found the answer for the Issue...My guess was right that I had build the project in xcode 6.0 which support upto ios 8.0. so Push Notification is not working on the higher version of ios.Now I had upgraded my xcode upto 6.3 and it support upto latest ios ie 8.3. and My Push is also working fine.thanks for your support guys.



来源:https://stackoverflow.com/questions/29763060/push-notification-not-working-in-ios-8-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!