Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FCM invalid event #201

Closed
CristinaNicolae opened this issue Nov 25, 2016 · 14 comments
Closed

FCM invalid event #201

CristinaNicolae opened this issue Nov 25, 2016 · 14 comments

Comments

@CristinaNicolae
Copy link

I just updated everything to the last versions and after I do the ios bundle and try to run the app I get this message:
imag2523

If I dismiss it the app runs as expected.

My dependecies:
"react": "^15.4.1",
"react-native": "^0.38",
"react-native-fcm": "2.3.2"

I am testing on a iPhone 5 with iOS 10.0.2

@ouya99
Copy link

ouya99 commented Nov 26, 2016

if nothing else helps try with react: 15.3.1 and react-native 0.36. I have not been able to run my app with the latest react(native) versions, because of other errors

@evollu
Copy link
Owner

evollu commented Nov 28, 2016

looks like you are subscribing wrong event
it should be refreshToken or notification

@sibelius
Copy link

@CristinaNicolae this are the valid events: https://github.com/evollu/react-native-fcm/blob/master/index.js#L3

@evollu maybe we should add an invariant to ensure the events are correct, and provide a better error message

expo/ex-navigation@8795fbe#diff-0b652261cfb3f4459e0cb33be663e872R47

@evollu
Copy link
Owner

evollu commented Dec 12, 2016

will update error message

@evollu
Copy link
Owner

evollu commented Dec 20, 2016

fixed

@evollu evollu closed this as completed Dec 20, 2016
@Msspl-PrashenjeetRoy
Copy link

"react": "15.4.2",
"react-native": "0.40.0",
"react-native-fcm": "^6.0.2",

I am getting Invalid FCM event subcription, use import {FCMEvent} from 'react-native-fcm' to avoid typo inside red screen.

Device: iphone 7 plus simulator.

Anyone have any suggestion.

@evollu
Copy link
Owner

evollu commented Feb 1, 2017

Check readme, there is a breaking change in v6. Are you using 'notication' for event subscription?

@Msspl-PrashenjeetRoy
Copy link

Msspl-PrashenjeetRoy commented Feb 1, 2017

this.notificationListener = FCM.on('notification', (notif) => {
            // there are two parts of notif. notif.notification contains the notification payload, notif.data contains data payload
            if(notif.local_notification){
              //this is a local notification
            }
            if(notif.opened_from_tray){
              //app is open/resumed because user clicked banner
            }
            console.log(notif)
            // fcm token may not be available on first load, catch it here
        });

I am using this one and when commenting error gone. @evollu

@evollu
Copy link
Owner

evollu commented Feb 1, 2017

Right use FCM.on(FCMEvent.Notification, callback)

@Msspl-PrashenjeetRoy
Copy link

Yes this is now working. Now I am getting in some other issue with xcode I can't run build it showing this above issue:
screen shot 2017-02-02 at 11 11 40 am

But when I do react-native run-ios it's building my app on simulator. Can you suggest reason behind this. I have also facing this problem and getting solution but when installing few plugins it's showing again on new react native package see this issue posted yesterday: facebook/react-native#12042

It's not only issue with specific library it's showing file not found in many library files:
#import <React/RCTEventEmitter.h>
rctbridgemodule etc etc...

It was showing same on yesterday but I solved it with reinstalling everything with react native new package. But again now same issue.

@Msspl-PrashenjeetRoy
Copy link

Msspl-PrashenjeetRoy commented Feb 2, 2017

Now I am not getting error on file not found but only rest this issue...
ld: warning: directory not found for option '-F/Users/appdeveloper/Library/Developer/Xcode/DerivedData/ProjectName-creunpzxffivaagyrmpgpqdcxwik/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac' ld: framework not found GoogleToolboxForMac clang: error: linker command failed with exit code 1 (use -v to see invocation)

ld: warning: directory not found for option '-F/Users/appdeveloper/Library/Developer/Xcode/DerivedData/ProjectName-creunpzxffivaagyrmpgpqdcxwik/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac'

Showing error
framework not found GoogleToolboxForMac

@Msspl-PrashenjeetRoy
Copy link

It just wasted my three working day :( but finally got solution.
I solved this issue with this provided solution:

1- opened workspace file before opening close everything.

2- added pod file in manage scheme suggested by :https://stackoverflow.com/questions/40358719/framework-not-found-googletoolboxformac

3- also i followed this suggestions too: http://stackoverflow.com/questions/9458739/ld-warning-directory-not-found-for-option

4-I also updated pod update.

5- Clean and build it's working now.
Now fcm is also working and not giving any error.
Note: just showing few warnings, I do not know how to solve those.

@GeoInMeluo
Copy link

The second step and the third step can again a little bit in detail ? Now I only know to update pod,but it's field. pod profile use this ?

pod 'React', :path => '../node_modules/react-native', :subspecs => [
'RCTText',
'RCTImage',
'RCTNetwork',
'RCTWebSocket',
]

Hope you answer agin : )

@SnehaGindi
Copy link

Open 'Build Settings', search 'Header Search Path'.

Double click next to 'Header Search Path', where other properties have a 'yes' or 'no'

Now add following to the "Header Search Path" (under Build Settings):

$(SRCROOT)/../node_modules/react-native/React

Make it recursive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants