Andrew Peacock
Posts: 0
Joined: Thu Jan 09, 2014 10:03 pm

Updating the Device Collection

Hi Logan,
I struggled with this one a bit. Let's see if I can help.

First, you need to capture the deviceID during the initial registration, and store it in a local variable.

Then in the mapping for the update, you need to map the local variable to the deviceID item in the URL of the REST service.

Are you using AngularJS? I'm updating a custom variable (which holds an array of integers) in my app. If the above tip doesn't work, I can share my code.

Hope that helps,
Andy

Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

Updating the Device Collection

It is fixed! I realized I had the x-appery-app-id for the wrong app posted, although changing to {deviceid} also helped.

Thank you so much,

Logan

Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

Updating the Device Collection

Hi Andrew,

Unfortunately, I am using JQuery, although your above tips are very helpful in terms of mapping the local storage variable and capturing the deviceID!

How did you capture the deviceID during initial registration?

Thank you,

Logan

Andrew Peacock
Posts: 0
Joined: Thu Jan 09, 2014 10:03 pm

Updating the Device Collection

Hi Logan,
It's returned in the response to the initial RegPush function. Simply map the response field to the variable so you can later use it in the update device service.

Hope that helps,
Andy

Logan Wells
Posts: 0
Joined: Sat Oct 11, 2014 12:37 am

Updating the Device Collection

Thank you so much, this is very helpful.

Logan

Return to “Issues”