I have been trying to integrate nest into my iOS application, following all the instructions regarding user authentication and then making calls to the nest API. I used Nest's iOS example app as a reference:
https://github.com/nestlabs/iOS-NestDK
I confirmed that their project is working. Here is some code that comes from their project which I modified to look and see if anything was set for "data".
self.rootFirebase = [[Firebase alloc] initWithUrl:@"https://developer-api.nest.com/"];
[self.rootFirebase authWithCredential:[[NestAuthManager sharedManager] accessToken] withCompletionBlock:^(NSError *error, id data)
{
if (error)
{
NSLog(@"Auth Failed! %@", error);
}
else
{
NSLog(@"Auth succeeded! %@", data);
} withCancelBlock:^(NSError *error) {}];
Using the same exact function authWithCredential in my code with the newest Firebase framework, no errors appear and I get a response with data. However, making calls in my code such as:
Firebase *newFirebase = [self.rootFirebase childByAppendingPath:@"devices"];
[newFirebase observeEventType:FEventTypeChildAdded withBlock:^(FDataSnapshot *snapshot)
{
NSLog(@"Got devices: %@", snapshot.value);
}];
Nothing is returned. I have confirmed that there are a few devices set up, as they are showing up in the app they provided. I have logged in and authorized with the same Nest account on both their app and mine.
I figured they were using an old Firebase framework, so I removed that framework from their project and added in the new one. Same result - Now their project app no longer returns any structures/devices/thermostats. I noticed that authWithCredential is now deprecated...so I attempted to use authWithCustomToken in both their app and in my app to see if it would be any different, but still, nothing is returned when I try to grab information from Nest, even though it seems to be successfully authorizing...
I use my own Firebase for other features in my app which depends on using the newest framework, so I wouldn't want to use an older version.
Has anyone else ran into this issue? Any thoughts/solutions?
Any help would be much appreciated.