ios8的推送该怎么写
我想知道ios8 的推送代码有没有三方,有的话请大神给个网址或者能把推送的代码直接在回复中贴出,谢谢啦
如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

评论(2)

我给个第三方的平台给你,里面的推送sdk你可以直接调用的,非常方便
http://www.bmob.cn/spread/redirect/?sid=df391636b0c871545fc0

/** * 注册通知 */ - (void)registerRemoteNotification { #if !TARGET_IPHONE_SIMULATOR UIApplication *application = [UIApplication sharedApplication]; //iOS8 注册APNS if ([application respondsToSelector:@selector(registerForRemoteNotifications)]) { [application registerForRemoteNotifications]; UIUserNotificationType notificationTypes = UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert; UIUserNotificationSettings *settings = [UIUserNotificationSettings settingsForTypes:notificationTypes categories:nil]; [application registerUserNotificationSettings:settings]; }else{ UIRemoteNotificationType notificationTypes = UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert; [[UIApplication sharedApplication] registerForRemoteNotificationTypes:notificationTypes]; } #endif }
发布评论
需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。