How to view Push Notification errors?

Is there some log file or a way to view if there are any errors after sending out a push notification to the Google Play GCM?

Right now you cannot. There will be an incremental improvement where you will be able to see the device IDs for which the delivery has failed. Later on we will be making improvements to the console to display the status of the push notification deliveries. If you have ideas for what would be useful to see, please post them here.

I think what you already have planned will be what I am looking for. Just some way to see what devices failed to deliver to and if so what error message was returned from the GCM API.

Has this been implemented? Currently, I am attempting to send a push to my iOS device from the Backendless site, and it is not being received. Android pushes work just fine. The iOS push works just fine when I push from a test app (called APNS tool) using my cert and device token. It does not work from your site even though the same cert and device token is loaded, and I cannot see why it fails.

Hi Austin,

No, it has not been implemented. Does your app call device registration API? Can you see your device in the “Devices” tab on the Messaging screen in Backendless console?

Regards,
Mark

Mark,

Yes, registration occurs as expected. I can see the device in the list of devices on Backendless, and in fact, I can copy the device token shown on the registered device and paste it into a third party app that tests push through Apple. Everything works fine when I do that, and I am using the same cert I uploaded to Backendless.

I have written a test even handler that sends a push to all iOS and Android devices as described in the documentation. All Android devices receive the push. The iOS device does not.

The test code is as follows:

DeliveryOptions deliveryOptions = new DeliveryOptions();
deliveryOptions.setPushPolicy( PushPolicyEnum.ONLY );
deliveryOptions.setPushBroadcast( PushBroadcastMask.ALL );
PublishOptions publishOptions = new PublishOptions();
publishOptions.putHeader(PublishOptions.ANDROID_CONTENT_TEXT_TAG, "This is a test");
publishOptions.putHeader(PublishOptions.ANDROID_CONTENT_TITLE_TAG, "This is a test");
publishOptions.putHeader(PublishOptions.ANDROID_TICKER_TEXT_TAG, "This is a test");
publishOptions.putHeader(PublishOptions.IOS_ALERT_TAG, "This is a test");
publishOptions.putHeader(PublishOptions.IOS_BADGE_TAG, "1");
publishOptions.putHeader(PublishOptions.IOS_SOUND_TAG, "default");
Backendless.Messaging.publish("This is a test", publishOptions, deliveryOptions);

Do you have any logs on your end you can look at?

Regards,
Austin

Austin,

Could you please try the following:
When you call “publish”, you get back MessageStatus object. The object will have messageId. Try calling Backendless.Messaging.getMessageStatus( messageId ) to get the updated status which may contain error message:

If there is an error from the APNS server, it should be returned in there.

Regards,
Mark

Thanks! That was helpful. The error message was as follows:

Invalid token length. Should be 64 bytes. Current length: 71.

It looks like the token has 7 spaces in it that need to be stripped out. I will implement this in code and try again.

Austin

I made the correction. The push is still not going through. I re-registered the device with no spaces in the device token and deleted the old device. Now no errors are reported in the MessageStatus object, but I still do not receive the push.

I cleared out all my certs and restarted. I finally got it working but only with a Prod cert. Works fine now though. Thanks.

I am going through the same steps now as I am preparing for the webinar tomorrow. Will let you know if I get it working with my dev cert.

Hi, is that webinar ready and available? i’m having a problem with the publish method as well im getting a BackendlessException{ code: ‘Internal client exception’, message: ‘null’ } when i exceute
DeliveryOptions deliveryOptions = new DeliveryOptions();
deliveryOptions.setPushPolicy(PushPolicyEnum.ALSO );
deliveryOptions.addPushSinglecast( “LGH440nce43a48f” );
deliveryOptions.setPushBroadcast( PushBroadcastMask.ANDROID );

PublishOptions publishOptions = new PublishOptions();
publishOptions.setPublisherId(“michael”);
publishOptions.setSubtopic(“Zahiiiir”);
publishOptions.putHeader( “android-ticker-text”, “You just got a private push notification!” );
publishOptions.putHeader( “android-content-title”, “This is a notification title” );
publishOptions.putHeader( “android-content-text”, “Push Notifications are cool” );
MessageStatus status =Backendless.Messaging.publish( “default”,“this is a private message!”, publishOptions, deliveryOptions) ;

the problem is that the app crashes when i try to execute publish so i can’t even check that status.
Any ideas?

i shall add that i was able to send the push notification from the console

Michael, use async version of publish method when working from device. Sync calls are restricted.

ok, i was able to solve the problem with the same calling like in the screenshot http://support.backendless.com/attachments/1608