Unable to get token on API level 17

后端 未结 2 391
别跟我提以往
别跟我提以往 2021-01-15 00:58

I am running these commands in order to get a token:

  InstanceID instanceID = InstanceID.getInstance(getApplicationContext());
  String token = instanceID.g         


        
相关标签:
2条回答
  • 2021-01-15 01:43

    According to official docs:

    https://developers.google.com/android/reference/com/google/android/gms/iid/InstanceID#ERROR_MISSING_INSTANCEID_SERVICE

    you get this error because

    Tokens can't be generated. Only devices with Google Play are supported.

    Testing on emulator without Google Play Services enabled/installed?

    0 讨论(0)
  • 2021-01-15 01:56

    You need to install the gapps of the version of android in your emulator, if use the genymotion you need to install before the gapps di Genymotion-ARM-Translation_v1.1 after that, probably will work

    0 讨论(0)
提交回复
热议问题