react-native-gcm-android icon indicating copy to clipboard operation
react-native-gcm-android copied to clipboard

MISSING_INSTANCEID_SERVICE

Open cpsiaki opened this issue 10 years ago • 6 comments

This is the adb logcat i get when I reach the spot in code where I call GcmAndroid.addEventListener('register'....

01-06 09:00:03.885  5066  5172 D GcmRegistrationService: Failed to complete token refresh
01-06 09:00:03.885  5066  5172 D GcmRegistrationService: java.io.IOException: MISSING_INSTANCEID_SERVICE
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at com.google.android.gms.iid.zzc.zza(Unknown Source)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at com.google.android.gms.iid.zzc.zzb(Unknown Source)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at com.google.android.gms.iid.zzc.zza(Unknown Source)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at com.google.android.gms.iid.InstanceID.zzc(Unknown Source)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at com.google.android.gms.iid.InstanceID.getToken(Unknown Source)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at com.oney.gcm.GcmRegistrationService.onHandleIntent(GcmRegistrationService.java:38)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at android.os.Handler.dispatchMessage(Handler.java:102)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at android.os.Looper.loop(Looper.java:148)
01-06 09:00:03.885  5066  5172 D GcmRegistrationService:    at android.os.HandlerThread.run(HandlerThread.java:61)

what am I missing?

I have the google-services.json in my android/app/ directory I edited all the appropriate files as listed in the readme

I am using Parse as my backend. But I don't think this should have anything to do with it as I haven't yet sent the token up to parse because I can't get it.

cpsiaki avatar Jan 06 '16 19:01 cpsiaki

What device do you test?

oney avatar Jan 07 '16 11:01 oney

I'm actually testing on a genymotion sim. I was told it would work by I can't remember who. That could be the problem. Not sure why I didn't consider that. I'll go buy a droid tablet this weekend.

cpsiaki avatar Jan 07 '16 16:01 cpsiaki

I guess the issue is related to Genymotion simulator. You can try installing Google Play service to Genymotion by follwinng the link

oney avatar Jan 07 '16 17:01 oney

So the emulator, regardless of whether react-native-gcm-android is making the right calls, can't talk to GCM without a special plugin?

I did install the correct packages from the android system on my mac. (by typing 'android' on my mac terminal)

what sort of environment do you test with? Do you use a device?

cpsiaki avatar Jan 07 '16 17:01 cpsiaki

I think so. GCM is a service from Google Play, so we have to make sure the device/emulator has Google Play service before using it. I have tried testing on Genymotion emulator without installing Google Play service before, and get the same error. Basically, I develop the app on a device.

oney avatar Jan 07 '16 17:01 oney

@cpsiaki you can try using the google apis intel emulator (x86) using the android avd . it was working great with GCM.

jawadrehman avatar Jan 08 '16 00:01 jawadrehman