React native 在android(0.59.8)中未获得推送通知权限警报,但它';他在ios工作

React native 在android(0.59.8)中未获得推送通知权限警报,但它';他在ios工作,react-native,React Native,我正在运行示例应用程序。但在android中没有使用react本机推送通知获取权限警报 我搜索了模块问题,发现了以下链接: 麦可德 组件willmount(){ PushNotification.configure({ //(可选)在生成令牌时调用(iOS和Android) 预期产出: 需要在android中使用获取权限警报 反应本机推送通知 工作环境: 反应本机:0.59.8 反应本机推送通知:3.1.9您可以使用反应本机权限() 并且可以轻松地处理您的权限。您可以使用react-nativ

我正在运行示例应用程序。但在android中没有使用react本机推送通知获取权限警报

我搜索了模块问题,发现了以下链接:

麦可德 组件willmount(){ PushNotification.configure({ //(可选)在生成令牌时调用(iOS和Android)

预期产出:

需要在android中使用获取权限警报 反应本机推送通知

工作环境: 反应本机:0.59.8
反应本机推送通知:3.1.9

您可以使用反应本机权限()


并且可以轻松地处理您的权限。

您可以使用react-native权限()

并轻松处理您的权限

    onRegister(token) {
      alert(`TOKEN@@@@: ${JSON.stringify(token)}`);
      deviceType = token.os;
      deviceToken = token.token;
    },

    // (required) Called when a remote or local notification is opened or received
    onNotification(notification) {
      console.log("NOTIFICATION:", notification);

      // process the notification

      // required on iOS only (see fetchCompletionHandler docs: 
   https://facebook.github.io/react-native/docs/pushnotificationios.html)
      notification.finish(PushNotificationIOS.FetchResult.NoData);
    },

    // ANDROID ONLY: GCM or FCM Sender ID (product_number) (optional - not required for 
    local notifications, but is need to receive remote push notifications)
    senderID: "301058192164",

    // IOS ONLY (optional): default: all - Permissions to register.
    permissions: {
      alert: true,
      badge: true,
      sound: true
    },

    // Should the initial notification be popped automatically
    // default: true
    popInitialNotification: true,

    /**
     * (optional) default: true
     * - Specified if permissions (ios) and token (android and ios) will requested or not,
     * - if not, you must call PushNotificationsHandler.requestPermissions() later
     */
    requestPermissions: true
  });
}