BAHYouTubeOAuth 0.1.1

BAHYouTubeOAuth 0.1.1

测试已测试
语言语言 Objective CObjective C
许可证 MIT
发布时间上次发布2015年4月

Brad Hughes 维护。




  • BHughes3388

预览

用法

要运行示例项目,首先将仓库进行克隆,然后从 Example 目录中运行 pod install

安装

设置

导入

#import "BAHYouTubeOAuth.h"

无论用户登录何处YouTube并检索令牌

BAHYouTubeOAuth *youTubeOAuth = [[BAHYouTubeOAuth alloc]init];

[youTubeOAuth authenticateWithYouTubeUsingYouTubeClientID:youTubeClientID
                                      youTubeClientSecret:youTubeClientSecret
                                            responseType:response_type
                                                   scope:scope
                                                   state:state
                                          appURLCallBack:redirectURI
                                              accessType:access_type
                                          viewController:self
                                                        :^(BOOL success, NSString *youTubeToken, NSString *youTubeRefreshToken) {

                                                            if (success) {
                                                                //the token you will use to request right now
                                                                [[NSUserDefaults standardUserDefaults] setObject:youTubeToken forKey:@"youtube_token"];
                                                                //token you can use to request a new token on your behalf for requestion later
                                                                //this only shows when you ask for "offline access"
                                                                [[NSUserDefaults standardUserDefaults] setObject:youTubeRefreshToken forKey:@"youtube_refresh"];

                                                                [[NSUserDefaults standardUserDefaults] synchronize];

                                                                //Do whatever you need with the token

                                                                }


                                                            }];

作者

BHughes3388, [email protected]

许可证

BAHYouTubeOAuth 可在 MIT 许可证下使用。有关更多信息,请参阅 LICENSE 文件。