Page 1 of 1

Use different channels for Push Notification

Posted: Tue Jul 08, 2014 12:42 am
by Carlos Castillo6909856

HI

After several trials I ́m a little stuck with the final setup

Im trying to build an App that the end user is capable of choosing from a menu several channels for him to receive so I'm sending you what I have done so far ...

The JS:
return [parseInt('{"$and":[{{' + (Appery("OpBIIA").val()) + '},{{' + (Appery("OpBIIB").val()) + '},{{' + (Appery("OpBIIC").val()) + '}]}')];

On the Device DB I do receive on channels ["null"]

Image Image Image Image

Thank you very much for the help

Best


Use different channels for Push Notification

Posted: Tue Jul 08, 2014 3:38 am
by Illya Stepanov

Hi Carlos,

Could you please describe with steps the workflow you are trying to implement, as its now not very clear.

You are testing this on a device? As device ID could be obtained only on the device and updated also.
:: http://devcenter.appery.io/documentat...


Use different channels for Push Notification

Posted: Tue Jul 08, 2014 4:15 am
by Carlos Castillo6909856

What we are trying to achieve is provide an App where the end user can choose from different channels in order to receive push notifications from the service provider and not all, since there are going to be like 40 different channels sending push notifications every now and then.

as an example for just tree channels:

So what I decided to use are check boxes from the UI

collapsable block group name=mobilecollapsibleset_70
collapsable block = mobilecollapsblock_71
(the user will see on the dashboard this 3 checkboxes, and will have the option to choose all of them, one, two or none)

checkbox item = OpBIIA value 111....channel 1
checkbox item = OpBIIA value 112....channel 2
checkbox item = OpBIIA value 113....channel 3

So I did build this mapping where I do call the service Canal which is a PUT service

Settings
URL https://api.appery.io/rest/push/reg/{...

Request
Default Name
X-Appery-App-Id xxxxx-92e7-c60cbb114320 as a header
Channel blanc
deviceid blanc

Rest as Default

On the Request mapping I enable the local storage
pushNotifiactionDeviceID to the deviceid from the service with the JS:
return encodeURIComponent (value);

and the channel with the JS (no mapping)
return [parseInt('{"$and":[{{' + (Appery("OpBIIA").value) + '},{{' + (Appery("OpBIIB").value) + '},{{' + (Appery("OpBIIC").value) + '}]}')];]

This last JS is the one I think I'm missing something because the channel gets ["null"]

The idea is to have a channel column from Device ID DB kind of this string
[111,112,]

That would mean that I the user only desires to receive info from channel one and two from this short example.

Did my self clear?

Best and thank you for your time and knowledge

CC


Use different channels for Push Notification

Posted: Wed Jul 09, 2014 7:25 am
by Kateryna Grynko

Hi Carlos,

You would need to update data in Devices collection as follows:
http://devcenter.appery.io/documentat...