推送通知在iOS 8.3中不起作用 [英] Push Notification not working in ios 8.3
本文介绍了推送通知在iOS 8.3中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的推送通知在ios 8.3中不起作用.我已经在xcode 6.0中构建了支持ios 8.0的项目.是原因吗?
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???
推荐答案
///ios8通知的条件...
// 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)];
}
您将其放在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
???
将其放入并检查.应该可以.
Put this and check. It should work.
这篇关于推送通知在iOS 8.3中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文