我已经创建了推送通知所需的所有证书,并在后端使用了推送机器人。我从推送机器人那里得到了推送通知,但是下面的方法没有被调用。
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo我已经包括推送机器人框架,并遵循所有程序。我的代码有什么问题,或者后端有什么问题。我找不到解决办法。
发布于 2016-09-16 15:32:45
There may be many reason not one. I will let you know the Steps. Make sure it is done.
1)Have you enabled push notification in Capabilities.if not please enable it.
2)Check your App identifier whether your bundleId matches and you enabled a push notification for that bundle ID.
3)The Sample code for iOS8 or above
UIUserNotificationType allNotificationTypes =
(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge);
UIUserNotificationSettings *settings =
[UIUserNotificationSettings settingsForTypes:allNotificationTypes categories:nil];
[[UIApplication sharedApplication] registerUserNotificationSettings:settings];
[[UIApplication sharedApplication] registerForRemoteNotifications];https://stackoverflow.com/questions/39525955
复制相似问题