Backendless Support
 
Solved

Push notification not working

I tried to send a push notification, but none of them is received. None of the registered device can get notification.

APPLICATION_ID 161CA8CE-7AC3-2596-FF77-73632D3ED600

API_KEY 7ABCB71F-AE97-0E17-FFD6-5943634E8F00

I even tried to send from the console, nothing happen.

Tried channels

userwCF3H4FNrmWQ5IshvmyAGUToDhf2

userSLC99TT5ekhCQZSUrQT6fIioBZh2

userbooUWZwoxNZUuLQuNctPJvu0uMZ2

userlGL4ahlFlxTlEhBuBzeoyHDdS5b2

It was working before lunch, and I come back from lunch, it's not working.

Nothing has changed on my end.

Leave a Comment

Comments (44)

photo
1

Hi Allen,

Does the problem still persist? Could you please share your client-side code?

photo
1

No, the problem still persit. The log is saying message published, but no device actually getting notification. The code are in screenshots.

Android response:

01-23 08:17:31.046 5872-5872/E/error: Message published to channel: userSLC99TT5ekhCQZSUrQT6fIioBZh2, response MessageStatus{messageId='message:68CA8F12-CE9D-4C48-FF3C-3AE93304C100', status=SCHEDULED}

01-23 08:17:31.046 5872-5872/E/error: Message published to channel: userlGL4ahlFlxTlEhBuBzeoyHDdS5b2, response MessageStatus{messageId='message:B7731CC1-D1BE-9A3F-FF49-193D144D1D00', status=SCHEDULED}

01-23 08:17:31.176 5872-5872/E/error: Message published to channel: userwCF3H4FNrmWQ5IshvmyAGUToDhf2, response MessageStatus{messageId='message:305E799E-2B45-9B46-FF3A-13FE3BAE8E00', status=SCHEDULED}

iOS response

2018-01-23 08:13:10.251622-0600 [1533:18348] try push to channcel userbooUWZwoxNZUuLQuNctPJvu0uMZ2

2018-01-23 08:13:10.253711-0600[1533:18348] try push to channcel userlGL4ahlFlxTlEhBuBzeoyHDdS5b2

photo
1

There's another question, my table "DeviceRegistion" should have a column channelName, but I can't see it from the console, but when I tried to create one, it said channelName already exist.

photo
1

> There's another question, my table "DeviceRegistion" should have a column channelName, but I can't see it from the console

It is really strange.

Could you clarify:

1) It is new app ?

2) did you make export/import/migration in this app?

photo
1

No, it's old app, created in Oct 2017, I believed, the channelName used to be there, push notification all working.

I haven't do any export/import/migration

I only do stuff from mobile side so far.

photo
photo
1

I have the similar problem. I cannot receive notification in my application. It is a working application but as seen in the screenshot, push notification feature suddenly stopped. I got every response after I scheduled or sent the notification but I cannot receive any notifications at all

photo
1

Hi Mehmet

What's your AppId?

photo
1

Hi Vladimir. My App ID is : 706226DA-3A4D-829E-FF92-9733231F4600

Besides, I was using a custom Push Service class. Today, I deleted everything from my app and started the whole implementation process from the beginning as mentioned in the tutorials. I can register the device, get device ID and token and see them in Backendless console. But when I try to send notification from the console! (Not using the API), I cannot receive the message at all. I debug it from my app but it does not step into onMessage() callback.

Thank you for your support by the way. I'll be waiting your response.

photo
photo
1

Hi. We've made some changes. Please, try once again with your app.

photo
1

The issue still persist. Already tried to send from android, ios and the console, but no push notification recieved. The column "ChannelName" is still not visible.

photo
1

I tried sending notification using Backendless console and it worked! I do not have much time right now but I quickly tried to use REST API to send delayed push notification and it did not work. But I will test again for the RESt API tomorrow as soon as possible and write here the results.

photo
1

Hi Oleg, I just tested again to send scheduled notification using Java API but no luck :( It is not working. But it is working when I do not schedule the notification.

Is Summary:

I can send notification instantly, using Backendless Console

I can send notification instantly, using Java API

I cannot!!! send notification scheduled to a certain time and date!!!, using Java API

I will really appreciate if you can solve the scheduling problem. Thanks.

photo
1

Hi Allan,

It seems to be that your issues are related to the broken schema of your DeviceRegistration table. We're looking into it and will get back to you with results ASAP.

Mehmet Aktas, I've just checked delayed publishing via Android SDK and it's working on my side. Some additional information required to reproduce the problem.

1) Has it been working before or you've just started integrating push notifications to your project?

2) Could you please provide the code of how are you scheduling delayed pushes?

Best regards

photo
1

Thanks to look into the issue. I really appreciate it

photo
photo
1

Hi Anton,

It is an active application that is on the market for a while. So I did not integrate push notification recently. I am setting delayed pushes as shown below:

  1. DeliveryOptions deliveryOptions = new DeliveryOptions();
  2. deliveryOptions.setPublishAt(checkDate /* valid java.util.Date object*/ );
  3. List<String> deviceId = new ArrayList<>();
  4. deviceId.add(myDeviceID);
  5. deliveryOptions.setPushSinglecast(deviceId);
  6. PublishOptions publishOptions = new PublishOptions();
  7. HashMap<String, String> headers = new HashMap<>();
  8. headers.put(PublishOptions.ANDROID_TICKER_TEXT_TAG, ticker);
  9. headers.put(PublishOptions.ANDROID_CONTENT_TITLE_TAG, title);

  10. headers.put(PublishOptions.ANDROID_CONTENT_TEXT_TAG, text);
  11. publishOptions.setHeaders(headers);

  12. /*Below code is in AsyncTask*/
  13. MessageStatus publishResponse = Backendless.Messaging.publish( myPushMessage, publishOptions, deliveryOptions );

photo
1

Can you confirm, that date you are passing in delivery options is a valid timestamp pointing to the date + time in future?

photo
1

Yes I am sure time is valid and + time in the future. I attached a screenshot which I took at 2018-01-25 at 16.21.41

photo
photo
1

Hi Allan,

Could you please check your DeviceRegistration table again? ChannelName should already be there. If not - clear cache and reload the page.

When done - please check messaging functionality for your application again. If the problems will still persist let us know in this topic

Best regards

photo
1

Hi Anton,

Thanks, I already check all functionality, it's working now.

photo
1

Hi Anton, issue is stated as solved but what about delayed publishing problem of mine? Is there any update on that?

photo
1

Hi Anton,

By the way, I tried to implement all functionalities from the beginning. I can send notifications without setting "publishAt" property but when I set it, I cannot get any notifications. I've attached all of my configurations. I really need your help on this.

photo
1

Hi Mehmet,

Still can't reproduce the problem.. Could you please check status of the message you publish with a publishAt parameter?

photo
1

Hi Anton,

The ENUM of status is Scheduled when I use publishAt parameter. Is it possible to check through database or somewhere if I give you the message ID after I publish the notification?

photo
1

That's not necessary. Try the followings:

1. Publish a message with publishAt parameter to schedule a push notification at current time + 30 seconds

  1. DeliveryOptions deliveryOptions = new DeliveryOptions();
  2. Date publishDate = new Date( System.currentTimeMillis() + 30000 ); // add 30 seconds
  3. deliveryOptions.setPublishAt( publishDate );

2. Check the message for errors right after publishing, you can do it in Postman, all the necessary collections are already there https://prnt.sc/i5ubs4 (screenshot attached)

3. Run getMessageStatus API again in 30 seconds after publishing

4. Share your results here

photo
1

Hi Anton,

I needed to go abroad for a meeting but I saw your reply. I'll send the requested info as soon as possible and let you know. Thx.

photo
1

Hi again Anton,

I just did what you requested and attached the screenshots. It says "Could not find status...".

Will be waiting for further instructions,

Best

Mehmet

photo
1

The ID should be "message:<number_id>", not just "<number_id>". You can see an example on the screenshot Anton attached above.

photo
1

Hi Sergey, I just tried with the message id similar to Anton's in the screenshot. But the result is same.

photo
1

What is your application ID?

photo
1

My App ID is : 706226DA-3A4D-829E-FF92-9733231F4600

photo
1

Can you please try to send again and check merely by visiting the following link (having substituted the IDs):

  1. https://api.backendless.com/<application_id>/<REST_API_key>/messaging/<messageId>

(messageId still in form of "message:<ID>")

This is to make sure we don't miss anything with invalid configuration values in Postman.

photo
1

I tried, but unfortunately the result is same :(

photo
1

Can I test it on your app with some message? Unfortunately I can't reproduce it on my existing app.

photo
1

How are we going to do that? As long as you only send the notification to my device, there is no problem. How to proceed?

photo
1

Sure, I will use the code you provided above, I just need the deviceID for that.

photo
1

OK no problem. My device id is: LGH870DSe6503906

Just please do not send a notification to everyone :)

photo
1

Thanks, I managed to reproduce the problem with not found status. I've created an internal task BKNDLSS-16535 to investigate this further. We shall notify you here as soon as we have any news.

photo
1

Thanks Sergey for all the support. I'll be waiting for your update to go further.

photo
1

Hi Sergey, any update about this?

photo
1

Hi Mehmet,

Thank you for your help, we managed to find a problem with sending delayed push notifications. Apparently your app is migrated from 3.x and there's a bug in such apps preventing some actions from being executed - now we see it also prevents sending delayed messages. We have fixed it manually in your app; the general fix for all applications will be released in the next few days.

Now you should be able to check the message status after it has been sent (e.g. if it's a 30-seconds delayed message, you should be able to check its status after 30 seconds). Please try sending it once more and check if there are any errors.

photo
1

Hi Sergey,

I was away for a week and just managed to check. Firstly, I really thank you for the effective support.

It is working now. When I schedule the notification with 30 seconds, I receive it 30 seconds later. But now there is another problem:

I was getting an error shown in Fabric. Now I got that error all the time I schedule a notification and this leads to a crash! I receive the notification. Click it and open my app. After a few seconds, app crashes. Error log does not contain any class from my app. It is all about backendless. Can you please check if this is related with the fix you have done? Thanks:

java.lang.ExceptionInInitializerError

at com.backendless.HeadersManager.getInstance(HeadersManager.java:38)

at com.backendless.Invoker.invokeSync(Invoker.java:95)

at com.backendless.Invoker$1.run(Invoker.java:71)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)

at java.lang.Thread.run(Thread.java:761)

Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String android.content.SharedPreferences.getString(java.lang.String, java.lang.String)' on a null object reference

at com.backendless.AndroidBackendlessPrefs.restoreAuthKeysFromPreferences(AndroidBackendlessPrefs.java:98)

at com.backendless.AndroidBackendlessPrefs.getAuthKeys(AndroidBackendlessPrefs.java:91)

at com.backendless.AndroidBackendlessPrefs.getApplicationId(AndroidBackendlessPrefs.java:51)

at com.backendless.Backendless.getApplicationId(Backendless.java:220)

at com.backendless.AndroidHeadersManager.<init>(AndroidHeadersManager.java:34)

at com.backendless.AndroidHeadersManager.getInstance(AndroidHeadersManager.java:22)

at com.backendless.HeadersManager.<clinit>(HeadersManager.java:28)

at com.backendless.HeadersManager.getInstance(HeadersManager.java:38)

at com.backendless.Invoker.invokeSync(Invoker.java:95)

at com.backendless.Invoker$1.run(Invoker.java:71)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)

at java.lang.Thread.run(Thread.java:761)

photo
1

Hi Mehmet,

This is a separate issue and should have already been fixed in the latest Android SDK, 4.4.0. Please try to update and verify.

photo
1

Hi Sergey,

You are right, it is gone after updating to 4.4.0.

Again thank you for all the support. It looks like it is fixed. Hope you can release the fix soon and everybody but me who is facing the same issue will take advantage of it.

Best,

Mehmet

photo
1

You're welcome! Glad your app can work properly now.

The fix for other apps has already been deployed as well with Backendless Cloud version 4.4.12.

photo