How do I get multiple users connect to one device? (with iOS mobile app)

I just want to describe what I’m currently doing in case anyone else is facing a similar situation.

So first I claim the device using normal methods (Particle app / through USB and particle CLI). This works for my use case because the customers shouldn’t have to worry about claiming a Photon, they just need to all connect to the same one. Eventually, I will have more than one Photon, and different groups of customers will need connection to different Photons (one customer will have at most one Photon connection). Each Photon will be given a random device ID.

The users would have to type that device ID to the app depending on which Photon they will connect to. This ID maps to a specific Photon device’s access token. Behind the scenes, the app would query a database using that ID to get the appropriate access token to be able to connect to the Photon. This way, users don’t have to worry about signing in with a Particle account or claiming the device.

I used the injectSessionAccessToken as detailed here. I got the access token through the Particle console (under Settings). I’m not sure if this is the best way to get the access token though.

3 Likes