0

Cannot receive push.

Preconditions:

1) AndroidManifest properly configured (permissions, user-permissions, service, broadcastreceiver with correct intent-filter)

2) in developer console created credentials for android app and server.

My steps:

1) register device:

if (mGCM == null) {
   mGCM = GoogleCloudMessaging.getInstance(mContext);
}
mRegId = mGCM.register(Constants.SENDER_ID);

2) send mRegId to server

3) server send push to device. Google answer is:

{"multicast_id":7343763038953489252,"success":1,"failure":0,"canonical_ids":0,"results":[{"message_id":"0:1428566852416853%a96fd634f9fd7ecd"}]}

Result: no push in GcmBroadcastReceiver

Alex Klimashevsky
  • 2,457
  • 3
  • 26
  • 58

2 Answers2

0
  1. On which device you are testing ? If it is pre 4.0.4 then you must be logged in with some google account. See for reference : Why google Account login is required for GCM to work for devices below 4.0.4 OS?

  2. Also check if have google play services installed on the device.

  3. Check in android manifest if the app package is same as in broadcast receiver you have registered.

PS: Assuming you have registered broadcast correctly .

Community
  • 1
  • 1
lakshay
  • 1,018
  • 2
  • 18
  • 30
0

I regenerated api key for android. Also merge together keys for debug and releases.

Alex Klimashevsky
  • 2,457
  • 3
  • 26
  • 58