Support Topics Documentation Slack YouTube Blog

Push notifications are being sent twice


(Minitour) #1

In the recent hour (or less) I noticed that something is wrong with the push notification system.
It is now sending the push twice (duplicated). at first I thought this might be because I am using a custom broadcast receiver service, but that wasn’t the case. I then proceeded into debugging my server code, and double check that the send_message method is only being called once. And lastly I set the default Broadcast Receiver and used the console just to confirm this, and it turns out this is a problem on Backendless side.


(Minitour) #2

UPDATE:

Ok apparently the problem was within the Linux version of Android Studio.
I compiled the same project in windows and the issue was gone.


(Miroslav Kuťák) #3

I have the same issue on Swift, iOS, Xcode, Mac OS X


(Mark Piller) #4

I tried reproducing the problem, but I could not. I get only one notification for each API call I made. Please create a demo which would let us reproduce the issue.


(Minitour) #5

It was not something that can be reproduced on our side, I didn’t change anything in the code and all of a sudden the application’s broadcast receiver was being invoked twice.
I know the problem from the server itself because I checked the Message counter and it was adding by 2 every time I sent a push.

To make sure it was indeed a problem on the server I setup the default BackendlessBroadcastReceiver and I sent a message through the console with the headers:

"android-ticker-text":"test","android-content-title":"test","android-content-text":"test"

And I was still getting 2 notifications, and yes the total message counter was increasing by 2 each time.


(Mark Piller) #6

Is there any custom server-side code in the app?


(Vyacheslav Vdovichenko) #7

When you remove an app from your iOS device, you should delete all device registration on Backendless app dashboard (Messaging bookmark)


(Simon Smiley-Andrews) #8

We have been finding this problem has been occurring when updating an app. When the app is deleted and then reinstalled (or updated with a newer version over the top) it seems to re-register the device again meaning that they get double/triple etc the pushes.

I did some testing and it seems that when I delete the app and reinstall it then it adds a new device ID to the list stored for a user. Each time it will add another one on causing a push to be sent for each device ID which are all the same device. I have added an image from the dashboard of this.

Any advice on this would be very welcome.

Simon


(Vyacheslav Vdovichenko) #9

Hi Simon,

When you delete your IOS app which uses Backendless pushes, you need to remove all device registrations in your Backendless app, because after you reinstall your app on the device, the new registration will be created.

Regards,
Slava


(Simon Smiley-Andrews) #10

Hi Vyacheslav,

Is there any way to automatically do this for a user’s account? It is very strange that this code is called every time the app loads up and doesn’t add multiple devices but it does when the app is first installed and re-installed.

If we stored the deviceTokenAsString to the phones keychain could we check if one already existed and then not register subsequent times as a work around for this bug?

Simon


(Sergey Kukurudzyak) #11

Simon, please move your question to thread that you have created, because your question does not relate to this thread.


(Vyacheslav Vdovichenko) #12

We cannot use a token, because it is changed time by time


(Michael Zahir) #13

Can you send me a link to the new thread please? i’m having the same problem and i would like to know further information.


(Simon Smiley-Andrews) #14

Here is a link to the new thread.


(Vyacheslav Vdovichenko) #15

We have fixed this issue, you could update the latest Backendless SDK via pod (3.0.35 release) or from ios-SDK github (ComLibiOS and backendless).

This fix allows to avoid the additional device registrations in the future, but if you already have the double device registrations (with the same Device Token), you need to remove it manually from your app dashboard (“Messaging -> <channel name> -> Devices” bookmark). You could use “Search” field for this. Sorry for the inconvenience.


(Michael Zahir) #16

What about the android SDK? It’s been updated as well?


(Abanoub Wagdy Wahib) #17

Android has this issue and not solved with new release