嗨,我面临一个奇怪的问题关于未出现弹出/警报告诉我接受推送通知的推送通知对于某些设备不显示,而某些设备工作正常。我不明白我的代码哪里出错了。在为证书启用推送通知后,我还尝试重新生成我的配置文件。谁能指导我如何解决这个问题。
这是我的推送通知代码:-
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
NSLog(@"My token is: %@", deviceToken);
}
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
{
NSLog(@"Failed to get token, error: %@", error);
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
// Let the device know we want to receive push notifications
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:
(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
return YES;
}
我正在为某些设备使用上面的代码,一切正常。但有些没有保留列表注册弹出/警报。这类问题的概率是多少?请帮我。