推送通知在ios 8.3中不起作用

时间:2015-04-21 04:40:35

标签: ios iphone xcode push-notification ios8.2

我的推送通知在ios 8.3中不起作用。我在xcode 6.0中构建了这个项目,它支持ios 8.0。是原因???

2 个答案:

答案 0 :(得分:3)

//这是ios8通知的条件......

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)];
}

你把它放在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions ???

放入并检查。它应该工作。

答案 1 :(得分:1)

我找到了问题的答案......我的猜测是正确的,我在xcode 6.0中构建了支持ios 8.0的项目。所以推送通知不适用于更高版本的ios.Now我已经将我的xcode升级到6.3并且它支持最新的ios即8.3。而且我的推送也很好。谢谢你的支持人员。