GCM not working for Android 4.0.3 but works for 4.1.2
I am sending notifications to Android using Rapns Ruby gem.
Server side:
n = Rapns::Gcm::Notification.new
n.app = Rapns::Gcm::App.find_by_name("myapp")
n.registration_ids = ["some_id"]
n.data = { message: 'test' }
n.save!
Client side:
public void registerInBackground() {
try {
if (gcm == null) {
gcm = GoogleCloudMessaging.getInstance(getBaseContext());
}
gcm.unregister();
regId = gcm.register(SENDER_ID);
storeRegistrationId(regId);
}
It gets delivered on devices with Android version 4.1.2, but doesn't get
delivered on 4.0.3. All devices get registered and give us registration
id.
GCM always responds with delivered status. I've also tried setting
delay_while_idle: false, collapse_key: 'test' in my request. Didn't work
either. What am I doing wrong?
No comments:
Post a Comment