我正在尝试为对讲机推送通知注册应用程序。他们在这里有说明:https ://docs.intercom.io/Install-on-your-mobile-product/enabling-push-notifications-with-intercom-for-ios
他们在 obj c 中给出了这段代码,但我的应用程序很快,这对我来说就像胡言乱语:
- (void)applicationDidBecomeActive:(UIApplication *)application {
if ([application respondsToSelector:@selector(registerUserNotificationSettings:)]){ // iOS 8 (User notifications)
[application registerUserNotificationSettings:
[UIUserNotificationSettings settingsForTypes:
(UIUserNotificationTypeBadge |
UIUserNotificationTypeSound |
UIUserNotificationTypeAlert)
categories:nil]];
[application registerForRemoteNotifications];
} else { // iOS 7 (Remote notifications)
[application registerForRemoteNotificationTypes:
(UIRemoteNotificationType)
(UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeSound |
UIRemoteNotificationTypeAlert)];
}
}
有人可以解释如何快速完成这个过程吗?