0

I have created an app that receives my notifications from PushWoosh. I want to create a page where the user can stop/start these notifications. It will be like a settings page.

Can this be done? Can you show me a quick example code?

Thanks

alurosu
  • 66
  • 1
  • 8

1 Answers1

1

Of course it is possible! Moreover, there are different ways to do so.

First of all, please note that there is the unregisterDevice API method, which deletes the push token of a device from Pushwoosh database. You can modify the SDK you are using and check whether your user enabled push notifications from your application, and call unregisterDevice in case he/she didn't.

Second, you can use the Tags feature. By calling setTags method in your application, you can set a Tag value of the device. Later, you can use it for targeting.

For instance, you can send a message only to users who enabled notifications by adding the following line to the createMessage request:

"conditions":[["Enable_pushes","EQ","Yes"]],

Please note that Tags is a Premium-level feature. If you would like to test it, you can get in touch with Pushwoosh support team and get a free trial period.

Dmitry
  • 21
  • 2
  • Can you write a short example for **unregisterDevice**? I tried something but in the pushwoosh cpanel the device is still registered. – alurosu Apr 18 '14 at 09:52