Nest IOS Account Unlink Detection


#1

The IOS SDK doesn’t have a callback/listener method to detect if the user has unlinked the account from the Nest website. The android SDK though had the onAuthRevoked() listener method to detect the above said scenario and we cleared out the saved token when this method was triggered.

Does Nest provides a REST API to check if the user has unlinked the account as I believe the IOS SDK doesn’t provide this out of the box. Please advice.

Note: I also looked into the documentation but wasn’t able to find anything specific calls to check if the authentication is valid or not.


#2

If by “unlink the account from the Nest website” you mean they remove the WWN connection from their account, the access token is immediately revoked. Any subsequent calls to the API should result in an Unauthorized error. If you’re using something like REST Streaming or Multiplex it will send you an auth_revoked event.

The iOS-NestDK sample app doesn’t use REST Streaming or Multiplex so it doesn’t automatically receive a notification that a connection is removed (unlike the Android app, which does use REST Streaming). You’d have to check for deauthorized, or account for Unauthorized errors on your own.

Feel free to submit a pull request if you have code that can improve the way the app handles that.