Push notification not working appgyver

Application ID

D84F0078-B04A-7CF9-FF06-DD5CC5CAEE00

Hi,

I am using Appgyver to develop my app and have a couple of questions regarding push notifications.

  1. I’ve managed to set up the app in IOS’s testflight but tried to push notification from console but it is not working even though I’ve already registered the device already.

  2. May I know if there are any tools available in Backendless that allows me to test the push notification?

Thank you

HI, @JCS_Consultancy

Please, make sure that the added IOS certificate works correctly. How exactly did you add the device to your application? By using registration API or via the console?
I would suggest you to try also sending messages through API and then check the status of that mail. What message status do you see?

You can use the following documentation to do this:

Push with API - Backendless REST API Documentation

Get Message Status - Backendless REST API Documentation

Regards,
Marina

Hi Marina,

Sorry for the late reply. I’ve followed all the steps in this link the Backendless provide to create/add the certificate into Backendless

https://backendless.com/docs/js/push_push_notification_setup_ios.html

As for the device registration, I am doing it via API and managed to register the device token/id

https://backendless.com/docs/rest/push_device_registration.html

I’ve tried to send a message through the API and checked the status of the message as you’ve suggested. Below are the screenshots


Not exactly sure what the messageId is for the “Get message status” api but I’ve tried with both message:{id} and {id}. The error seems to suggest that the device token is invalid/bad. May I know if this is something that I did wrongly while configuring the push notification in Backendless or the issue lies in Appgyver, when I am getting the device token? The same error messaged pops up at both android and IOS.

Hi @JCS_Consultancy !

It is interesting situation since you should receive message status in any case.

Have you tried once more to send push notification from Console after device registration?
If not, please create push message template and use it to send message to your registered device. Please note, that Backendless can remove invalid devices automatically so check your registered devices after this operation.

Also, could you try to obtain message status directly using Postman or cURL? For that send one more message via your app to obtain fresh message id. Please note that message ID has next pattern “message:{id}”.

Please, write me back about results.

Regards, Andriy

Hi Andriy_Konoz,

Thank you so much for your prompt response.

Yes, I’ve just tried pushing notification from console after registering my device but no notification received. Can I just double check if the settings for the push template is right? Screenshot 2021-10-20 at 3.57.33 PM

I am not very good at coding and does not have the platform to perform API calls using Postman / cURL but I tried using Appgyver test api call and got the following error message when I tried to retrieve message status
Screenshot 2021-10-20 at 3.53.41 PM

I’ve noticed that the error states deviceid = null, may I know if there is a format/structure to follow for deviceid? Currently I am just parsing a randomly generated 4 digit for deviceid when a user register its device.

Thank you.

@JCS_Consultancy ,

Your last message was very useful. “BadDeviceToken” is response from Apple APN service.
There are several reasons why you can receive this error.
One of them is mismatch of device token and environment. In other words, your token can be issued for prod environment while your certificate is for “dev” environment.

I can advice you to check the following link for more info about solutions of this problem ios - What are the possible reasons to get APNs responses BadDeviceToken or Unregistered? - Stack Overflow

Regards, Andriy

@Andriy_Konoz ,

I did consider that possibility before, because currently Appgyver only allows me to build the app using distribution cert which would explain the mismatch of device token that you mentioned about.

However, I tried the same message test with android (live in playstore) + server key from Firebase and it shows the same result. Therefore, I am wondering if there’s anything that I did wrongly.

@JCS_Consultancy

What status did you receive for message for your Android device?

BTW, how you obtained your device ID which you provided during device registration?

Regards, Andriy

@Andriy_Konoz ,

The exact same error I got from my IOS device, the one in the screenshot above.

Currently I am just parsing a random 4 digit number from Appgyver to Backendless.

Currently I am just parsing a random 4 digit number from Appgyver to Backendless

That is the cause of problem.
Each device has its unique identifier. You should provide it as device ID in device registration request.

Regards, Andriy

@Andriy_Konoz,

May I know from where can I retrieve the device id of the device or what format does it comes in so that I can try to look for it?

Currently on Appgyver debugging page I am only able find these system variables which I don think are the device id of the device.


Screenshot 2021-10-20 at 9.01.22 PM
Screenshot 2021-10-20 at 9.01.29 PM

@JCS_Consultancy,

I have consulted with our IOS developer about your case. It seems that I misguided you a little bit and I am sorry for that.

To receive push notifications for IOS device you need to install your app on that device and make registration of device using our SDK. Backendless SDK during device registration will pick existing device ID or create new one basing on your app package name.

The same situation for Android devices - you need to create application and register it to Google C2DM server before sending push notifications from your website.

There are alternatives for push notifications which do not require native apps such as third-party services or browser-specific notifications.

Regards, Andriy

@Andriy_Konoz,

Thank you for checking this with your team.

Can I clarify, what do you mean by “make registration of device using our SDK.”? We are using Appgyver as our front-end, which I believe do not support installation of any libraries / entering any codes.

We’ve also been following the steps taken in the following site for IOS push notification set up, and there’s no mentioned of SDK.
https://backendless.com/docs/rest/push_push_notification_setup_ios.html

We’ve only been using Backendless REST API to register/cancel the device
https://backendless.com/docs/rest/push_device_registration.html

@JCS_Consultancy ,

I mean that to receive push notifications on IOS and Android devices you will need to install native versions of your application on this devices.

You cant have just web application and send push notifications to IOS and Android devices. Apple and Google won’t deliver your push messages (you in this situation already - you receive error messages from APN and Firebase).

Regards, Andriy

@Andriy_Konoz,

I mean that to receive push notifications on IOS and Android devices you will need to install native versions of your application on this devices.

The application is on Testflight on IOS and live in production on Android already. I am running the API when I am using the device, not on Appgyver.

You cant have just web application and send push notifications to IOS and Android devices.

Does this mean I am unable to directly blast a push notification from Backendless? We are only planning to use the push notification feature to make announcements on the application.

@Andriy_Konoz,

We would like to go live by end of next week and the push notification bit is the last feature that we want to implement. Would it be possible to connect through Backendless slack?

Hi @JCS_Consultancy,

Would it be possible to connect through Backendless slack?

It is better to keep our conversation here. Our Slack channel only for simple yes/no questions.

The application is on Testflight on IOS and live in production on Android already. I am running the API when I am using the device, not on Appgyver.

Does this mean I am unable to directly blast a push notification from Backendless?

I thought that you have only we app. Since you also have and native apps you will be able to send push notifications to the devices which have installed your apps.

So we are going back to responses from APNS and Firebase.

However, I tried the same message test with android (live in playstore) + server key from Firebase and it shows the same result. Therefore, I am wondering if there’s anything that I did wrongly.

Could you please provide message status with this error message?

Regards, Andriy

@Andriy_Konoz,

This is the message status from android’s perspective.

@JCS_Consultancy ,

Can I get full value for “message” field?
This value will help me to identify problem.

Regards, Andriy