首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iOS:使用推送机器人推送通知

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

Stack Overflow用户
提问于 2016-09-16 15:26:32
回答 1查看 228关注 0票数 0

我已经创建了推送通知所需的所有证书,并在后端使用了推送机器人。我从推送机器人那里得到了推送通知,但是下面的方法没有被调用。

代码语言:javascript
复制
 - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo

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

EN

回答 1

Stack Overflow用户

发布于 2016-09-16 15:32:45

代码语言:javascript
复制
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];
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/39525955

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档