fullstackreact / react-native-firestack

A firestack v3 react-native implementation
MIT License
715 stars 132 forks source link

IOS - FirestackReceiveNotification is not a supported event type #44

Open blumanski opened 8 years ago

blumanski commented 8 years ago

On IOS I get the following error using cloud messages. The build is fine and the app is running, just the red screen comes up. Running on emulator or device.

FirestackReceiveNotification is not a supported event type for FirestackCloudMessaging.
Supported events are: messaging_event, messaging_error, messaging_token_refresh, ……

Code I use

FirebaseStack.cloudMessaging.listenForReceiveNotification((msg) =>{
        console.log(msg.data);
        console.log(msg.notification);
    });

FirebaseStack.cloudMessaging.subscribeToTopic("film").then(function (topic) {
        console.log('Subscribed:'+topic);
    }).catch(function(err){
        console.error(err);
    });
auser commented 8 years ago

I'll look into this

jeromegrosse commented 8 years ago

I have exactly the same error.

rishabhsaxena commented 8 years ago

@auser hey, any progress on this?

blumanski commented 8 years ago

@auser Those work fine

FirebaseStack.cloudMessaging.subscribeToTopic("film").then(function (topic) {
        // whatever
    }).catch(function(err){
        console.error(err);
    });

FirebaseStack.cloudMessaging.getToken()
        .then(function(cloudTokenData) {........

Those below one doesn't

FirebaseStack.cloudMessaging.listenForReceiveNotification((msg) =>{
    console.log(msg.data);
    console.log(msg.notification);
});

FirebaseStack.cloudMessaging.listenForTokenRefresh(function (token) {
        _this.updateDeviceToken(token)

        .then(function(response) {
            resolve(response)
        })
        .catch(function(fire){
            reject(fire)
        })

    });

In case that helps :-)

ajonno commented 8 years ago

i am seeing the same error. for me the crash occurs on iOS, for this method/callback: firestack.cloudMessaging.listenForReceiveNotification((msg) => ....

on Droid is ok

has there been any progress in resolving ?

blumanski commented 8 years ago

@ajonno I use for now https://github.com/evollu/react-native-fcm/issues/177 (only for the cloudMessages) and hope that they may merge, but it doesn't look like it so far, I guess.

Anyway, just in case you need a solution right now.

Otherwise waiting until this is implemented.