My app needs to only receive certain notifications based on user-selected subscriptions. Think of a postal service tracking code. While I can filter out things I don't want my user to see based on their subscription choices in .pushReceived events (see code below), that doesn't prevent the alert from showing in the system tray / notification box when the app closed or paused. I want my app to say "this device should only ever get notifications for these user-selected values".

Example that I don't want to do because it's far too limiting and only works when app is in foreground:

// trigger.io usage
forge.internal.addEventListener("pushwoosh.pushReceived",
    function (notification) {
        var noto = JSON.parse( notification );
        if( "12345678" === noto.userdata.mySubValue ){ // assuming data: { mySubValue : "12345678" } in options
            forge.notification.alert( "subscribed update", noto.title );
        }
    }
);
asked 07 Sep '16, 23:03
chornbe's gravatar image

chornbe
111

Resolved.

Tags via /setTags still requires { tags: {xxxx:xxxx} } notation even though the tags : declaration in the body is apparently redundant (given you're calling setTags)

Seems silly to be so verbose, but there you go.

The documentation could be clearer, or more explicit about the need to still send declarations in typed/named api calls.

Note for PushWoosh folks:

/setTags api call should minimize the payload by NOT requiring { tags: } declarations.

For instance, you require:

forge.pushwoosh.setTags( { tags: { "channels" : ["12345678"] } },
  function (status) {
      forge.logging.log('set tags success');
  },
  function(status) {
      forge.logging.log('setTags failed');
  }
);

when

forge.pushwoosh.setTags( { "channels" : ["12345678"] },
  function (status) {
      forge.logging.log('set tags success');
  },
  function(status) {
      forge.logging.log('setTags failed');
  }
);

is far clearer. It's not like you're using /setTags to set other properties, right? Food for thought.

$.02

permanent link
answered 09 Sep '16, 11:05
chornbe's gravatar image

chornbe
111

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:

×444
×22
×5

question asked: 07 Sep '16, 23:03

question was seen: 579 times

last updated: 09 Sep '16, 11:05