Hoping to get some guidance. My device is a consumer product that may be given/sold to someone else at some point. I am trying to understand the best approach for a new owner to claim the device with our companion mobile app.
I initially created a product Widget and setup the oauth client so that we can create shadow customers for the product. As of right now our mobile app (Titanium app with our own particle softAP lib for claiming) does the following:
- Gets claim code from our server for the shadow customer
- Prompts user to connect to ssid broadcasting (Photon-xxx etc)
- Sets the claim code on the device
- Scans for networks to display to user
- Configures AP after user has entered username/password for the selected network
- Tells the device to reconnect using the configured AP.
This is all working well but I still have a hangup on how this process works for Products as its my understanding if the device is claimed to a Particle Product it must be unclaimed for someone else to claim it. We can’t really have this as they may just give the product to someone or say sell it used on craigslist etc.
My thoughts:
-
I could just claim every device to our own particle account and on our side keep a reference to which devices our users have. By doing this I wouldn’t need any shadow customers b/c all the devices would technically belong to our account and we would just be shuffling the access on our server side and interacting with the devices using our accounts access token on behalf of that user.
-
Another option is to not have a Product defined in Particle at all. My understanding is that if the device is not tied to a product it can be claimed by a new owner without any explicit unclaiming process.
I am thinking #1 is a better approach b/c it means I don’t have to have shadow customers at all in Particle. Is there another approach?