2016-09-16 32 views
0

我已經爲推送通知創建了所有必需的證書,並使用後端推送機器人。我從推機器人獲取推送通知,但繼 方法未被調用。iOS:用推送機器人推送通知

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

我已經包含了push bot框架並且遵循了所有的程序。我的代碼出了什麼問題,或者後端有什麼問題。我無法找出解決方案。

+0

哪個測試iOS版本? –

+0

最新ios版本9.3 –

+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];