Nest Sample iOS (iOS-NestDK) Application

288 Views Asked by At

I'm stuck and hopefully someone who has gone through this can help me. I've gone through the sample iOS application provided by Nest. I have registered as a developer and have a nest client ID and nest client secret. I have downloaded the sample application and my goal is to use this a reference to build an iOS application that interfaces with multiple connected devices within my home.

I have compiled the application and can run this through xCODE. Using the client ID, and client secret key, I'm also able to go to the Client Authorization screen. I then can login to nest, and get a PIN. This is where I'm stuck, I was expecting that by authorizing the client I would somehow get an access token that I can use during the API calls to provide access. I see the sample code to parse for the access token, but I don't see any code path to get to retrieving and access token.

2

There are 2 best solutions below

0
On

Thank you, I just found the answer I was looking for. I was missing the redirect URI and after setting this up in the application I can now get through. My application is really not posting to a server and therefore assumed I did not need a redirect URI. Apparently this is required by next but there is a workaround for iOS and Osx... Here's the thread.

Non-HTTP[S] OAuth redirect for Nest API

0
On

I was stuck at this too but found the solution in Android-nestdk "The OAUTH REDIRECT_URL is to be set in the client registration page on the nest developer website and NOT ONLY in Constants.m"

I also put https://localhost on both location and it worked immediately like the user said.

https://stackoverflow.com/a/27530025/954074