Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firebase 反应本机推送通知不';当应用程序处于后台或关闭时,不显示横幅(屏幕上弹出)_Firebase_React Native_Firebase Cloud Messaging_React Native Push Notification - Fatal编程技术网

Firebase 反应本机推送通知不';当应用程序处于后台或关闭时,不显示横幅(屏幕上弹出)

Firebase 反应本机推送通知不';当应用程序处于后台或关闭时,不显示横幅(屏幕上弹出),firebase,react-native,firebase-cloud-messaging,react-native-push-notification,Firebase,React Native,Firebase Cloud Messaging,React Native Push Notification,我正在使用和跟踪它的文档。当应用程序位于前台时,它工作正常,但当应用程序位于后台时,我尝试从firebase控制台发送通知,只是在状态栏中显示了应用程序的一个小图标,但没有显示横幅 我试图添加一个新频道,但仍然不起作用 componentDidMount() { NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange); PushNotifi

我正在使用和跟踪它的文档。当应用程序位于前台时,它工作正常,但当应用程序位于后台时,我尝试从firebase控制台发送通知,只是在状态栏中显示了应用程序的一个小图标,但没有显示横幅

我试图添加一个新频道,但仍然不起作用

componentDidMount() {

        NetInfo.isConnected.addEventListener('connectionChange', this.handleConnectivityChange);

        PushNotification.configure({

            // (optional) Called when Token is generated (iOS and Android)
            onRegister: function(token) {
                console.log( 'TOKEN:', token );
            },

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

                Platform.OS === 'ios' ? notification.finish(PushNotificationIOS.FetchResult.NoData) : null;
            },

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

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

            visibility: 'public',

            popInitialNotification: true,

            requestPermissions: true,
        });
    }