in our cordova app (Andorid and IOS) users login to a webservice. We would like to send pushes to self-defined groups of users.

Our approch is to store devices IDs (received on pushNotification.register) on our server when user logges-in and send push notifications using remote api. We would use "devices" param within send messages to realise groups.

Is this a plausible scenario?
How can we unregister users that have uninstalled the app?

Many thanks in advance

asked 05 Mar '14, 06:43
janosz's gravatar image

janosz
1112

Hello,

Generally, it is possible. You can maintain the list of push tokens on your server and send a targeted message using "devices" section of createMessage request. However, I am not sure there is a way to remove outdated tokens from your userbase automatically, especially since both APNs and GCM tend to change push tokens from time to time.

That is why I strongly recommend to use our Tags feature instead. In my opinion, it is just the thing you are looking for. For instance, you want your users to receive news about their favourite sport. You simply create a list Tag named "Sport" with as many values as you want, for instance, "basketball", "soccer", "football", "tennis", "chess", "draughts", etc.

When a user logs in on a device, he/she chooses their favourite sport, and you set a Tag with this information by calling the setTags method in your app. That's all! Now you know that this user is interested in basketball.

In order to send a notification to all basketball fans, you can use the following:

"conditions":[["Sport","EQ","basketball"]]

All the devices with Tag value "basketball" will receive a notification.

You can also send it to several groups at once:

"conditions":[["Sport","IN",["chess","draughts"]]]

In addition to this, you can create other Tags and let your users subscribe to them.

permanent link
answered 05 Mar '14, 07:58
Dmitry%20%20Dyudeev's gravatar image

Dmitry Dyudeev
3.7k7

Hi Dmirty,

thank you for your response and possible solution. However our customer would prefer to store users push tokens server side and generate groups dynamically. Do you - or someone else here- know if server side storing of push tokens can cause problems in appstore review process?

Best and thanks Janosz

permanent link
answered 06 Mar '14, 09:18
janosz's gravatar image

janosz
1112

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×120
×6

question asked: 05 Mar '14, 06:43

question was seen: 3,525 times

last updated: 06 Mar '14, 09:18