Enabling/ Disabling Push for individual user on Phonegap

Comments

3 comments

  • Avatar
    Dmitry Dyudeev

    Unfortunately, we do not offer this functionality out-of-the-box, although there is an easy enough workaround: you can use our Tags feature.

    The process is roughly like this: you create an integer Tag "push_enabled", and when your user disables notifications from your app, you set a Tag value "0" using our setTags method. Later, you can send a message only to the group of your users with pushes enabled by adding the following line to the createMessage request:

    "conditions":[["push_enabled","EQ",1]]
    
  • Avatar
    Gerd Tf

    Thank you Dmitry,

    when I create the push enabled tag I have to set it to 1 myself, that is not the default right?

    And in your code line...

    "conditions":[["push_enabled","EQ",1]]

    What is the "EQ" paramter for?

    Thanks,

    Gerd

  • Avatar
    Dmitry Dyudeev

    You are most welcome!

    You are correct, there isn't any default value of a custom Tag, you would need to specify it.

    As for the "EQ" parameter, it simply means "equals". Please note that there are several parameters which might be used in different use-cases. You may find the list of them in our Remote API guide.

Please sign in to leave a comment.