Noob here. I’m trying to connect to my Photon using the provided iOS SDK example file.
1. Login to cloud works fine, console returns:
2015-11-24 20:37:05.401 Spark-SDK[59478:1709413] Logged in to cloud
Access Token: XXXXXXXXXXXXXXXXXXX
Works, great.
2. Next I’m trying to connect to my device using the Test Sequence-button:
2015-11-24 20:37:11.809 Spark-SDK[59478:1709413] MyDevice first Variable is called (null) and is from type (null)
2015-11-24 20:37:11.810 Spark-SDK[59478:1709413] MyDevice first Function is called (null)
2015-11-24 20:37:12.350 Spark-SDK[59478:1709413] Logged in to cloud
2015-11-24 20:37:12.678 Spark-SDK[59478:1709413] (
"<SparkDevice XXXXXXXXXX, type: Photon, id: XXXXXXXXXX, name: XXXXXXXX, connected: true, variables: {\n}, functions: (\n), version: (null), requires update: false, last app: (null), last heard: 2015-11-24 19:37:09 +0000>"
)
I guess that’s fine as well, but…
3. When clicking on it again - or restarting the app for that matter -, the console will return the following, every time:
2015-11-24 20:37:15.227 Spark-SDK[59478:1709413] MyDevice first Variable is called (null) and is from type (null)
2015-11-24 20:37:15.227 Spark-SDK[59478:1709413] MyDevice first Function is called (null)
2015-11-24 20:37:15.611 Spark-SDK[59478:1709413] Logged in to cloud
2015-11-24 20:37:15.648 Spark-SDK[59478:1709413] ! getDevice https://api.particle.io/v1/devices/28001e000e47343432313031 Failed (status code 401): {
error = "invalid_token";
"error_description" = "The access token provided is invalid.";
}
4. Only way to resolve this problem is to manually reset the Access Token via the web IDE.
Now I’m wondering: Do Access Tokens expire after a single use? Can’t be, right? So, is there something off with my setup? oO
Thanks.