GCM stuck on register at 2.3.3 Rectangular device

For some reason, use "GCMRegistrar.register (this, SENDER_ID)"; works with 4.0+ devices. However, he was stuck in the next message, not receiving any more GCM notifications from Google.

" Registration of the application (my package) senders (my api #) "

1) the manifest and receiver must be correct, since it works with 4.2.1.

2) I have a Google game and is connected to a google account on device 2.3.3.

I searched for several days and did not find the answer. Does anyone know what is wrong or have the same problem?

thanks

+2
android google-cloud-messaging android-2.3-gingerbread
source share
1 answer

I only found out about this because I did not set the receiver category correctly.

Since I put all the source code in the library project and referenced it with each individual application, I need to rename 3 different places in the manifest.

one)

<permission android:name="digital.dispatch.mobilebooker.base.permission.C2D_MESSAGE" android:protectionLevel="signature" /> 

to

  <permission android:name="digital.dispatch.mobilebooker.(my app name).permission.C2D_MESSAGE" android:protectionLevel="signature" /> 

2)

 <uses-permission android:name="digital.dispatch.mobilebooker.base.permission.C2D_MESSAGE" /> 

to

3)

 <category android:name="digital.dispatch.mobilebooker.base" /> 

to

  <category android:name="digital.dispatch.mobilebooker.(my app name)" /> 

The reason it worked on the 4.0+ device is because I made only the first two, but not 3). Since the 4.0+ device does not care about the receiver category, it worked. However, when I test the 2.3.3 device, this category really matters and does not cause any answer.

Hope this helps anyone else facing the same situation.

+10
source share

All Articles