jpush-RN

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

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容