Looking for best practice for an app to connect to a spark device.
I want to make an app that connects to a spark device as seamless as possible. Basically run the app and set the spark device ID and be able to connect right away. (Wifi setup aside).
Is it a good practice to embed in my app (say for iOS) my username and password in order to login to the Ali and get an access token if the one I have in my device is expired or not available?
Doesn’t seem right to store sensitive information on the device or app… Is there another approach on how to handle this?
I am envision I will have multiple devices for multiple clients (persons with an ios App) and those people basically after doing the wifi config of the spark, want to pair with the spark… To pair it I think it will use the spark device ID and go from there to find and talk to the device. Since your tokens expire, I cannot pre program a token on the iOS app and expect it to work forever. I need means to refresh the access token.
I am also assuming that in the “factory” I will have to do a claim of the device. I don’t want my clients setting up an account with spark for their device to work!
How would one handle this?? Is there a best practice or a feature coming that will allow this?