iOS:使用推送机器人推送通知

时间:2016-09-16 07:26:32

标签: ios push-notification pushbots

我已经为推送通知创建了所有必需的证书,并且在后端使用推送机器人。我从推送机器人获得推送通知但是跟随 方法不被调用。

 - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo

我已经包含推送机器人框架并遵循所有程序。我的代码出了什么问题,或者后端有什么问题。我无法找到解决方案。

1 个答案:

答案 0 :(得分:0)

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];
相关问题