Page 1 of 1

How can i add user_id to devices collection

Posted: Wed Mar 25, 2015 8:55 pm
by Istvan

Hi.

I would like add user id to devices collection. How can i do this in the app.

When the user login then add your id to device record.

How? I cannot create update service, no selectable devices collection ...

I want send push messages per user later.

Thanks


How can i add user_id to devices collection

Posted: Wed Mar 25, 2015 9:02 pm
by Egor Kotov6832188

Hi,

Unfortunately, you cant add extra column to device collection, but you can make new collection and store user_id there during the device registration


How can i add user_id to devices collection

Posted: Wed Mar 25, 2015 10:19 pm
by Bruce Stuart

and link the two collections together using the value of the _id in the devices collection as a column in the new collection you create. I then do the same thing as you do - in my push notification server process I look up all the devices for a user_id and then send the notification.

The good part about this approach (the one Egor recommends) is that a user can have one or more devices - and if you have a notification for a user - It's good to destine it for all of her-his devices.

best,

Bruce


How can i add user_id to devices collection

Posted: Sun Jun 26, 2016 7:09 pm
by Ruby

If you look at https://devcenter.appery.io/documenta...

you could see the last line of the section "Predefined collections" :

"You can add custom columns to the Devices collection"

Even if this wrong, I think you can add a column to the Users collection, hosting
the deviceID (or the corresponding _id). Each cell may host an array of all deviceID's bellonging to a user.