Page 3 of 3

Updating the Device Collection

Posted: Thu Jul 07, 2016 8:02 am
by Andrew Peacock

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


Updating the Device Collection

Posted: Thu Jul 07, 2016 12:46 pm
by Logan Wells

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


Updating the Device Collection

Posted: Thu Jul 07, 2016 2:42 pm
by Logan Wells

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


Updating the Device Collection

Posted: Thu Jul 07, 2016 3:34 pm
by Andrew Peacock

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


Updating the Device Collection

Posted: Thu Jul 07, 2016 3:42 pm
by Logan Wells

Thank you so much, this is very helpful.

Logan