简体   繁体   English

基于PIN码时,如何在Nest Thermostat中存储授权代码

[英]How to store Authorization Code in Nest Thermostat when PIN-based

I am trying to implement Nest Thermostat in My Application i Can success fully create pin authentication code but 我正在尝试在我的应用程序中实现Nest Thermostat,我能否成功创建引脚验证代码,但是

--->i struck in while storing that pin authentication code because after checking if condition if ([[url host] isEqualToString:[redirectURL host]]) then, --->我在存储该引脚身份验证代码时遇到了麻烦,因为在检查条件是否为[[[url host] isEqualToString:[redirectURL host]])之后,

--->always condition fails if condition success then only i can store it and get access token by using it (as per library) --->如果条件成功,总是条件失败,那么只有我可以存储它并通过使用它来获取访问令牌(根据库)

I did as per Nest Sample code and Library and online solutions no use I am looking for Picking hands 我按照Nest Sample代码和库以及在线解决方案进行操作,没有用,我正在寻找

Plz Ref-fear my code 请担心我的代码

    - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{

        NSURL *url = [request URL];
        NSURL *redirectURL = [[NSURL alloc] initWithString:RedirectURL];

        if ([[url host] isEqualToString:[redirectURL host]])
        {
            NSString *urlResources = [url resourceSpecifier];
            urlResources = [urlResources stringByReplacingOccurrencesOfString:QUESTION_MARK withString:EMPTY_STRING];
            urlResources = [urlResources stringByReplacingOccurrencesOfString:HASHTAG withString:EMPTY_STRING];

            NSArray *urlResourcesArray = [urlResources componentsSeparatedByString:SLASH];

            NSString *urlParamaters = [urlResourcesArray objectAtIndex:([urlResourcesArray count]-1)];

            NSArray *urlParamatersArray = [urlParamaters componentsSeparatedByString:AMPERSAND];
            NSString *keyValue = [urlParamatersArray lastObject];
            NSArray *keyValueArray = [keyValue componentsSeparatedByString:EQUALS];

            if([[keyValueArray objectAtIndex:(0)] isEqualToString:@"code"]) {

                [self.delegate foundAuthorizationCode:[keyValueArray objectAtIndex:1]];

            } else {
                NSLog(@"Error retrieving the authorization code.");
            }
            return NO;
        }
        return YES;
    }

The webview which is showing pin that is only screen i can see. Webview显示的针是我只能看到的屏幕。 after that i struck it .Desperately needed help 在那之后我击中它。急需帮助

使用基于Web的身份验证并在注册客户端时填写重定向URL,此重定向URL在客户端页面上不应为空,然后,一旦将设备登录凭据输入到应用中,它就会自动重定向并提供身份验证令牌,然后将提供带有该身份验证令牌的访问令牌,通过使用该访问令牌,您可以获得设备详细信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法将验证码存储在Nest Thermostat中 - Unable to store authentication code In Nest Thermostat 如何给巢式恒温器加热或冷却 - how to scheadule nest thermostat Heat or Cool Temperature Nest Thermostat离开状态更改回首页 - Nest Thermostat Away Status changes back to home REST请求中未显示Nest-API Thermostat设备 - Nest-API Thermostat device not showing in REST request 如何快速存储放置销目的地坐标 - How to store drop pin destination coordinates swift 如何在MKPinAnnotation中存储与引脚相关的信息 - how to store information related of a pin in MKPinAnnotation 使用 React native 从后台激活应用程序时如何显示 PIN 码屏幕? - How to show PIN code screen when the app is activated from the background with React native? 在将SQL存储添加到NSPersistentStoreCoordinator时,如何调试/处理间歇性的“授权被拒绝”和“磁盘i / o”错误? - How to debug/handle intermittent “authorization denied” and “disk i/o” errors when adding SQL store to an NSPersistentStoreCoordinator? 我将如何使用MapKit使用Zipcode / Postode将销钉放在商店上 - How would I use MapKit to drop pin on a store with Zipcode / Postode 触摸时如何检测另一个MKAnnotaion引脚 - How to detect another MKAnnotaion pin when touch
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM