user2672886
user2672886

Reputation: 127

Linking user Id and installation Id in Parse iOS

In the Data Browser pane of my Parse dashboard, I see Installation and User classes. However, for a specific user on a specific device, the objectIds don't match. Now, the channels a user has subscribed to is only visible in the installation class. Is there any way of linking the user id (from user class) to the installation id so that it is possible to know which channels a user has subscribed to? Any link to a tutorial or a solution would be appreciated.

Upvotes: 4

Views: 3495

Answers (2)

wm.p1us
wm.p1us

Reputation: 2059

Swift 2.1 Variant

let installation: PFInstallation = PFInstallation.currentInstallation()
installation["user"] = PFUser.currentUser()
installation.saveInBackground()   

Upvotes: 2

Jacob
Jacob

Reputation: 2338

// Associate the device with a user
PFInstallation *installation = [PFInstallation currentInstallation];
installation[@"user"] = [PFUser currentUser];
[installation saveInBackground];

This will put the user in a column "user" in the Installation table, the column would be a pointer to the _User table.

Upvotes: 12

Related Questions