jpush-RN
2017-05-25 本文已影响55人
以德扶人
而且用官网的代码会提示下面的警告信息:
/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内容
badge, // int提示角标
alertAction, // String
notificationKey, // String
userInfo, // Dictionary
soundName // String
)
//本地推送
var time= (new Date()).valueOf();
JPushModule.setLocalNotification( time+1000,'哈哈',0,'dfsa','dfaas',null,null);
2.设置角标
JPushModule.setBadge(0, (success) => {
console.log(success)
});