Page 1 of 1

is there a way to store a localstorage variable in the device data part of a database?

Posted: Wed Feb 26, 2014 8:34 pm
by danpickard

Basically when a user clicks on a radio button, I want the team that they have selected to be stored in an apperyDB that has no 'collection' in it. I've got this value stored in a local storage variable but I'm not sure how to post this data to an appery database once I've created the DB service

or maybe there's a way to clone the devices data table into a collection of my own automatically so when a new device registers with my app the device ID of this new device gets copied into a collection?


is there a way to store a localstorage variable in the device data part of a database?

Posted: Wed Feb 26, 2014 9:13 pm
by Kateryna Grynko

Hi Dan,

You can add a field in Database collection 'Devices'.


is there a way to store a localstorage variable in the device data part of a database?

Posted: Wed Feb 26, 2014 11:25 pm
by danpickard

I've done that and when I go to create a new database service all I get is the 'Files' collection to import.

Unless there's another way to post to a field in the DB?


is there a way to store a localstorage variable in the device data part of a database?

Posted: Thu Feb 27, 2014 5:33 am
by Alena Prykhodko

Hi Dan.

It is not right to store user information in Devices collection as web users don't have a deviceId.

So, you can create new collection. And store data there with some deviceid what you can get from device or generate.

This collection would be custom. Therefore you will be able to access this collection via internal database services.


is there a way to store a localstorage variable in the device data part of a database?

Posted: Thu Feb 27, 2014 10:47 am
by danpickard

ok, on device ready event i've tried using the following code to put the device ID into a label but it returns null. this was tried on an emulator

code var push = localStorage.getItem('pushNotificationDeviceID');
Appery('mobilelabel_2').text(push); /code

any ideas where i'm going wrong?


is there a way to store a localstorage variable in the device data part of a database?

Posted: Thu Feb 27, 2014 1:54 pm
by Maryna Brodina

Hello! Please take a look here https://getsatisfaction.com/apperyio/...