jpush-RN

作者: 以德扶人 | 来源:发表于2017-05-25 15:40 被阅读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)
});

相关文章

  • jpush-RN

    而且用官网的代码会提示下面的警告信息: 需要把代码里面的UIRemoteNotificationType改成:UN...

网友评论

      本文标题:jpush-RN

      本文链接:https://www.haomeiwen.com/subject/hrlzxxtx.html