We are confused and we need help about channels for push notifications:
How to create a channel. (Channels are created on the server?)
How to subscribe the device to a channel
How to cancel subscriptions to a channel
Thanks in advance.
We are confused and we need help about channels for push notifications:
How to create a channel. (Channels are created on the server?)
How to subscribe the device to a channel
How to cancel subscriptions to a channel
Thanks in advance.
Hi Rafael,
To create channel you'll need first to subscribe the device to the DB the one that is linked to the Push service.
:: http://docs.appery.io/tutorials/sendi...
After the device is subscribed it will appears in the DB as a row with fields:
in the field channels you can create appropriate one.
To subscribe app instance (device) to some channels, send PUT request to according URL:
precode
curl -X PUT \
-H "Content-Type: application/json" \
-d '{"channels":[<channelId>, ...]}' \
https://api.appery.io/rest/push/reg/channel/<appType>/<projectGUID>/<deviceID>/add
/code
/pre
where:
ul
licode<appType>/code is application platform type (A - Android, I - iOS) (deprecated);/li
licode<projectGUID>/code is project's GUID (databaseId);/li
licode<deviceID>/code is unique device identifier;/li
li"channels" is the list of code<channelId>/code channel identifiers./li
/ul
To unsubscribe app instance (device) from some channels, send PUT request to according URL:
precode
curl -X PUT \
-H "Content-Type: application/json" \
-d '{"channels":[<channelId>, ...]}' \
https://api.appery.io/rest/push/reg/channel/<appType>/<projectGUID>/<deviceID>/sub
/code
/pre
where:
ul
licode<appType>/code is application platform type (A - Android, I - iOS) (deprecated);/li
licode<projectGUID>/code is project's GUID (databaseId);/li
licode<deviceID>/code is unique device identifier used in Push Notification registration;/li
li"channels" is the list of code<channelId>/code channel identifiers./li
/ul
Hi Appery.io support team!
First of all, it's been really exciting to work with Appery.io environment, however I did'nt manage to subscribe to a channel...
I followed the videotutorial; and I managed to test the service succesfully from Test tab app builder tool; but when installing the apk and executing it on the device I get a 400 error.
It is really weird, since I am using the same X-Appery-Ap-Id (actually, it is configured as a default value on Request tab) ...
I enclose some screenshots, just in case you can help me
Thank you in advance!
Carlota F.
I already found the bug!
On Javascript that converts channel format, the videotutorial (https://www.youtube.com/watch?v=aHFVO...) shows this piece of code:
return (parseInt(value));
However, according to the documentation channels shall be sent as an array. This piece of code works:
var array = [];
array.push((parseInt(value)));
return array;
The error received was also confusing, since the documentation states a 400 error means "App ID not specified".
BR
Carlota F.
Hello!
Thank you for this information.
Do you have any problem at the moment?
Arina
Sorry for the delay...
No, I have not currently any problem.
Thankx for providing support to this lovely tool!
Carlota F.