Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Select Push Notification

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)

Carlos Castillo6909856
Posts: 0
Joined: Tue Jun 03, 2014 12:51 pm

Select Push Notification

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

Carlos Castillo6909856
Posts: 0
Joined: Tue Jun 03, 2014 12:51 pm

Select Push Notification

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Select Push Notification

Hello Carlos,

You should replace

prereturn JSON.stringify(checked);/pre

with

prereturn checked;/pre

Carlos Castillo6909856
Posts: 0
Joined: Tue Jun 03, 2014 12:51 pm

Select Push Notification

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

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Select Push Notification

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/...

Carlos Castillo6909856
Posts: 0
Joined: Tue Jun 03, 2014 12:51 pm

Select Push Notification

This is what I do have at the URL

What is wrong?

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Select Push Notification

Hi Carlos,

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

Carlos Castillo6909856
Posts: 0
Joined: Tue Jun 03, 2014 12:51 pm

Select Push Notification

yes is
pushNotificatioDeviceID

and the JS is

return encodeURIComponent(value);

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Select Push Notification

Hi Carlos,

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

Return to “Issues”