而且用官網(wǎng)的代碼會提示下面的警告信息:
/Users/vittorio/Desktop/log/ios/log/AppDelegate.m:39:55: 'UIRemoteNotificationTypeBadge' is deprecated:
first deprecated in iOS 8.0 - Use UserNotifications Framework's UNAuthorizationOptions for user notifications
and registerForRemoteNotifications for receiving remote notifications instead.
需要把代碼里面的UIRemoteNotificationType改成:UNAuthorizationOption
接口
1.本地推送
- setLocalNotification(
date,時間
textContain, // date內(nèi)容
badge, // int提示角標(biāo)
alertAction, // String
notificationKey, // String
userInfo, // Dictionary
soundName // String
)
//本地推送
var time= (new Date()).valueOf();
JPushModule.setLocalNotification( time+1000,'哈哈',0,'dfsa','dfaas',null,null);
2.設(shè)置角標(biāo)
JPushModule.setBadge(0, (success) => {
console.log(success)
});