How to send pushes with “conditions” to pushwoosh with remote API?

Comments

6 comments

  • Avatar
    Nikolai Polkhovskiy

    Hi!

    A condition is always an array of arrays, therefore try this:

    "conditions":[["Grupper", "EQ", tags]]

    Also, since "Grupper" is a List-type tag, you can only use IN operator with it (see the docs here: http://docs.pushwoosh.com/docs/createmessage#tag-conditions)

  • Avatar
    Claes Gustavsson

    Hi Nikolai and thanks. I tested but it is not working?

    I register from the app/user like this. var tag1="Class 4A" var tag2="Class 4B" pushNotification.setTags({Grupper:[tag1, tag2]}

    And I see at pushwoosh that the tag Grupper gets the values in the round chart, it says: Class 4A Grupper:1 (50%)

    Is this all I have to do to register a user to get pushes send to "Class 4A"? Or do I have to do something else?

    And I have changed to your code "conditions":[["Grupper", "IN", tags]]

    But I guess I still miss something?

  • Avatar
    Claes Gustavsson

    I updated with the full code Im using.

  • Avatar
    Claes Gustavsson

    FINALLY!! It works!! I had to use "conditions":[["Grupper", "IN", [tags]]]

    In the pushwoosh docs, in all examples all over the net all examples has been "conditions":["Grupper", "IN", tags] and if the pushwoosh support don´t know the right way, how should anybody?

    But finally it works, great!! :-)

  • Avatar
    Nikolai Polkhovskiy

    My apologies, I completely forgot that for List tags, you must provide the values in an array.

  • Avatar
    Claes Gustavsson

    Ok :-) Maybe you know this problem!? when I try to register setTags with "tags": {"Grupper": ["value1", "value2"]} it is not registering it?

Please sign in to leave a comment.