Page 3 of 6

Select Push Notification

Posted: Fri Jul 11, 2014 7:32 pm
by Evgene Karachevtsev

Carlos,

Could you create an entry in Devices of database collection with any deviceID (for example 123;456)
This deviceID write in local storage variable (you may do this manually in the console developer or you may use appropriate action on the load of start screen, just please don't forget to delete this code later)


Select Push Notification

Posted: Fri Jul 11, 2014 10:35 pm
by Carlos Castillo6909856

Image

Remote Address:54.221.205.233:443
Request URL:https://api.appery.io/rest/push/reg/n...
Request Method:PUT
Status Code:400 Bad Request
Request Headersview source
Accept:application/json, text/javascript, /; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:es-ES,es;q=0.8,en;q=0.6
Connection:keep-alive
Content-Length:24
Content-Type:application/json
Host:api.appery.io
Origin:http://appery.io
Referer:http://appery.io/app/view/13a50817-47...
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36
X-Appery-App-Id:13a50817-4736-4bbb-92e7-c60cbb114320
Request Payloadview source
{channels:[121,122]}
channels: "[121,122]"
Response Headersview source
Access-Control-Allow-Origin:http://appery.io
Connection:keep-alive
Content-Type:application/json
Date:Fri, 11 Jul 2014 21:39:24 GMT
Server:nginx
Transfer-Encoding:chunked


Select Push Notification

Posted: Fri Jul 11, 2014 11:07 pm
by Carlos Castillo6909856

Back to basics

I did a rollback and did the select as in the tutorial and works perfect

I do add the images

The problem is not the device ID is how we grab the info and construct the channel data

I need to built [121,122,132,143...] from different checkboxes

your code
var checked = [];
Appery("mobilecheckboxgroupName").find("input:checked").each(function(){
checked.push(parseInt($(this).val()));
});
return JSON.stringify(checked);

Does the work [121,122,123] but is not capable to insert it on the variable that goes in to the channel DB

Please help, Max on the tutorial states that is doable to have several channels setup, can you ask him how its supposed to be done,

Best

Have a nice weekend!

Image Image Image


Select Push Notification

Posted: Mon Jul 14, 2014 12:42 pm
by Evgene Karachevtsev

Hello Carlos,

You should replace

prereturn JSON.stringify(checked);/pre

with

prereturn checked;/pre


Select Push Notification

Posted: Mon Jul 14, 2014 4:02 pm
by Carlos Castillo6909856

We did have Status Code:400 Bad Request error now is

Status Code:405 Method Not Allowed

Remote Address:54.221.205.233:443
Request URL:https://api.appery.io/rest/push/reg/
Request Method:PUT

Status Code:405 Method Not Allowed

Request Headersview source
Accept:application/json, text/javascript, /; q=0.01
Accept-Encoding:gzip,deflate,sdch
Accept-Language:es-ES,es;q=0.8,en;q=0.6
Connection:keep-alive
Content-Length:22
Content-Type:application/json
Host:api.appery.io
Origin:http://appery.io
Referer:http://appery.io/app/view/13a50817-47...
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36
X-Appery-App-Id:13a50817-4736-4bbb-92e7-c60cbb114320
Request Payloadview source
{channels:[121, 122]}
channels: [121, 122]
Response Headersview source
Access-Control-Allow-Origin:http://appery.io
Connection:keep-alive
Content-Type:application/json
Date:Mon, 14 Jul 2014 15:54:12 GMT
Server:nginx
Transfer-Encoding:chunked


Select Push Notification

Posted: Tue Jul 15, 2014 8:07 am
by Evgene Karachevtsev

Hello Carlos,

You have 405 Method Not Allowed again because device ID is not specified in the url
preRequest URL:https://api.appery.io/rest/push/reg//pre
Please see the discussion above https://getsatisfaction.com/apperyio/...


Select Push Notification

Posted: Tue Jul 15, 2014 1:13 pm
by Carlos Castillo6909856

This is what I do have at the URL

What is wrong?

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


Select Push Notification

Posted: Tue Jul 15, 2014 3:12 pm
by Kateryna Grynko

Hi Carlos,

Please make sure you've created a localStorage variable that you map to deviceid.


Select Push Notification

Posted: Tue Jul 15, 2014 3:28 pm
by Carlos Castillo6909856

yes is
pushNotificatioDeviceID

and the JS is

return encodeURIComponent(value);


Select Push Notification

Posted: Tue Jul 15, 2014 6:05 pm
by Kateryna Grynko

Hi Carlos,

Let's output and check this value using codealert()/code