GET_ACCOUNTS permission while using GCM - Why is this needed?

前端 未结 6 1905
小鲜肉
小鲜肉 2020-12-07 20:50

I have an app, with Push notifications implemented.

I want to understand the reason why we need \"GET_ACCOUNTS\"(android.permission.GET_ACCOUNTS), while implementing

6条回答
  •  抹茶落季
    2020-12-07 20:57

    The GET_ACCOUNTS permission is no longer needed for GCM to work. It used to be required for registration to GCM, but a recent Play Services update stopped using the Google account even on Froyo and Gingerbread. If you are registering to GCM with Play Services (i.e. With GoogleCloudMessaging.register), you no longer need this permission on any Android version. If you are using the deprecated library (GCMRegistrar.register), you still need a Google Account on pre 4.0.4 version, which requires that permission.

    Source (posted on android-gcm Google Group by a Google developer) :

    Some background:

    Froyo and Gingerbread registration is implemented in GoogleServicesFramework, using the Google account for registration. This has resulted in a lot of auth errors for people where the account was not in a good state.

    Starting with ICS, GCM doesn't depend or uses the Google account - you can use it before you add an account or without any accounts.

    The "Play Services" update is implementing the new scheme on all devices - but it seems a small number of devices have problems with this, we're investigating - but the numbers are far lower than those with the old scheme.

提交回复
热议问题