Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Google Account required for GCM (Google Cloud Messaging)?

I need to write a simple app to get PUSH Notifications.
I used GCM which uses Google Play Services to get information.

My questions is - to access GCM, is Google Account required or not?
Can i use another email account to identify device?
Is there any other way to get push notification for another email account or device?

like image 794
Yuvaraja Avatar asked Mar 24 '14 09:03

Yuvaraja


2 Answers

Quoting from GCM Characteristics

It uses an existing connection for Google services. For pre-3.0 devices, this requires users to set up their Google account on their mobile devices. A Google account is not a requirement on devices running Android 4.0.4 or higher.

If your app is supporting pre-3.0 devices, so yes, Google Account is required and you need to add this permission to your manifest

<uses-permission android:name="android.permission.GET_ACCOUNTS" />
like image 102
Glenn Avatar answered Nov 04 '22 03:11

Glenn


As stated in other answers, the GCM documentation states that a Google Account is required on the device for Android versions older than 4.0.4.

However, in the following post from the android-gcm Google group, a Google developer claims that if you are using the latest version of Google Play Services, you don't need a Google Account on the device even for older devices (Froyo and Gingerbread).

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.

If you want to use the code in GSF, for Froyo and Gingerbread - you need to use the previous library, which sets package name explicitly. The new library in GCM is using the new registration code.

The actual connection to google is following the same path - we're gradually (and slowly) moving devices to the new code in play services.

I haven't tested it, so I can't say if it actually works.

like image 35
Eran Avatar answered Nov 04 '22 03:11

Eran