8

I´m facing a problem on handling the register-unregister my activities/services or whatever I use from an aerogear installation.

If I register from a service onCreate() and unregister in onDestroy(), when I uninstall the application, the device keeps registered on server side... If I install the application again, it registers the device again and you can repeat this until you get tired. And, of course, sending a push to the alias given by the user, the messages will arrive once per registration.

Also, each time the application registers to aerogear, the deviceToken is different, meaning that it´s got more to do with a generated hash for each installation than for a unique identifier for the pair (app, device).

So, now the question, how to handle the whole cycle? and I mean, the daily run and the issue about if the user decides to uninstall the app, it gets killed and could not unregister and one month later decides he liked it so much that ends up reinstalling the thing again. thx.

update

The problem grows as I go testing my application. If I log with two different users in the same device, then I get both user messages and I've got to twist a little bit more the client implementation.

update with aerogear database data

here´s the installation log for two devices with three reinstalls:


id  alias   deviceToken deviceType  enabled operatingSystem osVersion   platform    variantID
0dd99505-bba9-45e9-bfbf-38621bd41c3d    568b347a5df69915000pig@gmail.com    APA91bG9XSPpwbFenw0UETFLRxr2XoFw-HlH5yZpPgoCIVZLnv0QSqCx5iKqqhJ-tWF5CRISbydv6ItWZKxklD8OPtfxvuq1ekQEI3XkbFajsmGIJ3yjUIC0MGw3v2ITVd6byVtZLsI9uTfiDXyeNrXTxprzVxr9ng  ANDROID 1   android 4.4.4   android 4ae83272-5db7-41f6-879d-c907a39bd3fc
0ee3619f-0eb4-4139-b1fa-fe3403eb380c    1c24c6e05b58738f000edu@gmail.com    APA91bFrNknt7d57dFR5DagE4Nf1bCVyB93Jl1xU5_qELwYn5JmjYUpXrLE10yC6beZdUgae0ZgtKXgLI4LI-E_ROAFEI4xi-ZPhuE8UZB6K05L_mIWSk7kt32D7S9G2clw3WG51zvcQmaeg8xsG_VW-rnwfKZQVcg  ANDROID 1   android 4.4.4   android 4ae83272-5db7-41f6-879d-c907a39bd3fc
107d4dac-fbcf-4f82-9135-702b83d06f7f    568b347a5df69915000pig@gmail.com    APA91bEaN4AMJPZgML931rO4AdrMudfTmGVmYPqqARVLX1RxIfyYB46fGxlSK0w7g3qnU2d_cVOBi907TFIMoxBaOe3bvKI8DqsacrXMmT-DjhFoFRS2z4QCec9u0aRPm-EB9UwhfMrE3RrctdxDdNCQ0douuppYVQ  ANDROID 1   android 4.4.4   android 4ae83272-5db7-41f6-879d-c907a39bd3fc
161474b6-067d-4b54-a750-e21a9896814e    1c24c6e05b58738f000edu@gmail.com    APA91bGFE6cxLcxPDoRmv-HEIpA2jQndccrCryuR3q5BN4PG3EyHxISFoMCIwaPPXX8BIinrJOvNCbwpIrVOKw_mSv5TcLZnSgonR1grpiRkJ0mmwbFCme2CrwoMpkLkVUP7ZjwnYsr0HR3MKzmJLakrnlN-eMKr-g  ANDROID 1   android 4.4.4   android 4ae83272-5db7-41f6-879d-c907a39bd3fc
a5cddabe-1c00-4369-b4cc-f6c5da8f8740    568b347a5df69915000pig@gmail.com    APA91bGmFT7NCpfb1q4WHFK2wmQCQdMtW9ulQLiZYwrt9oyU4mqv9gCBN959pCw_wKy2zHw-JBU0p5SCzdpKN5l8i7uqPWk24ORHKE1Vf6rRUINkIRJheKVT6V6Wk38WQ7Rw1AgrqYXZN7WUImVSgd5cqq_p8lLISg  ANDROID 1   android 4.4.4   android 4ae83272-5db7-41f6-879d-c907a39bd3fc
f7514716-68d9-4d00-837a-f1f9da503151    1c24c6e05b58738f000edu@gmail.com    APA91bHTFJE7-nz_KB4aa2RUcEnFTVB0IzQZ-ZffPTujLWgi60xTMUeAet6YoUZJnXKnhBOSdAPgoaLDW18PWnwKXtc2MXxKjMYQQENNDdOxKQIV4fnMrAFWfwD_VT6x5XOJUWdQovGUwXiMX9SshCDvZJ4QnM1x_w  ANDROID 1   android 4.4.4   android 4ae83272-5db7-41f6-879d-c907a39bd3fc
eduyayo
  • 2,020
  • 2
  • 15
  • 35

1 Answers1

0

I think the first problem was a UnifiedPush server bug, but it's already fixed.

About your update when you register a device on UPS the UPS don't know about your users, so you will need to send some information with your message and control it on your client.

Daniel Passos
  • 1,307
  • 1
  • 9
  • 8
  • I just installed Aerogear unified push server 1.0.3 within Openshift and it is not fixed. After I uninstall and install the application, the installer is registered twice. – eduyayo May 04 '15 at 13:29
  • @eduyayo Could you sent it to our [mailing list](http://aerogear-dev.1069024.n5.nabble.com/) or open a [jira](https://issues.jboss.org/browse/AGPUSH) with more detail to we investigate? – Daniel Passos May 05 '15 at 13:43
  • 1
    In my case, if user fails to unregister while logging out and he logs in again, he receives notification for twice as he has been registered for twice. Is there any way to unregister previous registration while re-registering with the same device? – Bharat Dodeja May 06 '15 at 09:27
  • @Bharat Dodeja I think we´ve run into the same trouble. Looks like there´s no condition to check if the same device has already been registered. – eduyayo May 06 '15 at 11:13
  • @Passos I´ve added a dump of the installation table in my aerogear database. See that after three reinstalls I´ve got three entries for each client. Same user alias is using the same device, haven´t tested twisting things that way... – eduyayo May 06 '15 at 11:15
  • @Passos We are also using aero gear for iOS app and it is handling re-registration by itself. But it is not handing re-registration for Android app! – Bharat Dodeja May 07 '15 at 06:23
  • One devices that are receiving duplicate messages can you confirm that Google is sending a "NotRegistered" error code to UPS? – Summers Pittman May 12 '15 at 14:04