jpush-RN

以德扶人IP属地: 福建
0.586字数 93阅读 767

而且用官网的代码会提示下面的警告信息:

/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)
});

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
50人点赞
更多精彩内容,就在简书APP
"为各位客官早点下班做点微小的帮助"
还没有人赞赏,支持一下
以德扶人iOS / ReactNative / Android / React / NodeJs / ...
总资产3共写了9.7W字获得13,553个赞共292个粉丝

全部评论0只看作者
按时间倒序
按时间正序

推荐阅读更多精彩内容