Istvan
Posts: 0
Joined: Mon Oct 13, 2014 1:48 pm

How can i add user_id to devices collection

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

Egor Kotov6832188
Posts: 0
Joined: Wed Nov 19, 2014 5:15 pm

How can i add user_id to devices collection

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

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

How can i add user_id to devices collection

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

Ruby
Posts: 0
Joined: Fri Nov 20, 2015 10:51 am

How can i add user_id to devices collection

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.

Return to “Issues”