Pushnotification - Same device registered multiple times

0 votes

There are some dovices that receive the same Push Notification multiple times,

I see in the AppHq->PushNotification -> Users I search for the specified user and I found multiple device id for the same user.

When I send a notification to user they receive as many mesagges as the number of device registered in the App42 Server.

Why there are multiple Device Id for the same user if the user use only one smarphone ?

Best regards.
asked Jan 22, 2015 in App42 Cloud API-BaaS by odf (37 points)

1 Answer

0 votes

Hello Odf,

It looks like, you are saving multiple device ids with same user name that is why you are getting multiple device ids for the same user and user is getting multiple messages.

To avoid it, You need to register each device Id with Unique user name.

Please check & let us know if it helps.

Himanshu Sharma

answered Jan 23, 2015 by hs00105 (2,005 points)
so can i get all username which is registered on APP42 server so i can check if this username is already registered than registered with other username or can i delete the username if i want to update the same username with different device id.

Please don't need to worry about this because we have maintained this internally at the time of registering the device. How? At the time of registering device for push, we check if the device token is already exist with a different username then server automatically replace the existing username with the latest one. So that you don't have to manage it on client side.

Let me know if it helps.

Himanshu Sharma
yes its good to replace the device token with the latest username but as usual i want to prevent duplication of username with different device token. because one time user register with ios device and one time with android device than both time it has  different device id but same username so i want to delete previous username with devicetoken in list.

Apologies for getting late back to you. In that case, you need to store the device token with user information in Storage service and before registering new device you have to validate the device from Storage service by writing your custom logic. Please have  a look at our custom code(http://api.shephertz.com/tutorial/Server-Side-Custom-Code/?index=customcode-wrd) service where you can write your core (custom) logic on the top of Storage and Push notification service and let me know if you require any help from my side.  I will be happy to help you.

Himanshu Sharma
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com