admin
2025-02-20 478a350ad95f7a639ed78d3ca515e7f1ed107bfb
广告修改
32个文件已添加
38个文件已修改
4134 ■■■■■ 已修改文件
BuWanVideo2.0/AdConstant.h 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/AppDelegate.h 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/AppDelegate.m 236 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_login_qq.imageset/.3-sunloginclient972D645E-1978-46D9-9FE5-F626A987D484 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_login_qq.imageset/.4-sunloginclient0E9E223D-9261-488B-9FA1-26EF291120CD 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_login_qq.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_login_qq.imageset/qq@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_login_qq.imageset/qq@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_login_wx.imageset/.3-sunloginclient972D645E-1978-46D9-9FE5-F626A987D484 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_login_wx.imageset/Contents.json 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_login_wx.imageset/微信@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_login_wx.imageset/微信@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_password_hidden.imageset/.8-sunloginclient5AE882B3-52AE-472D-9FF4-DE4D4C5E0206 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_password_hidden.imageset/Contents.json 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_password_hidden.imageset/icon_password_hidden.png 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_password_hidden.imageset/icon_password_hidden@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_password_hidden.imageset/icon_password_hidden@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_password_show.imageset/.10-sunloginclient0E4352D0-4D15-4DD5-9D6B-B0257FAB4826 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_password_show.imageset/.8-sunloginclient5AE882B3-52AE-472D-9FF4-DE4D4C5E0206 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_password_show.imageset/Contents.json 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_password_show.imageset/形状 1.png 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_password_show.imageset/形状 1@2x.png 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Assets.xcassets/icon_password_show.imageset/形状 1@3x.png 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/BuWanVideo2.0.entitlements 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/CSJExpressAdManager.h 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/CSJExpressAdManager.m 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Common.h 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/DYDramaVideoController.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/DYDramaVideoController.m 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Info.plist 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/LGLAlertView/LGLAlertView.m 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/LeftViewController.m 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/LoggingViewController.h 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/LoggingViewController.m 408 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/LookNoteController.m 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/MyRegardController.m 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/PPTVController.m 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Personal_informationViewController.m 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/PrivacyInfo.xcprivacy 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Recommend/Recommend/Cell/RecpmmendTitleView.m 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Recommend/Recommend/RecommendController.m 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Recommend/RecommendMainController.m 65 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/RegisteViewController.m 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/SDK_Setting_5096047.json 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/SearchController.m 129 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/SettingWebView.m 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Share.h 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/Share.m 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/WEBViewController.m 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/XYRDetailViewController.m 145 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/XYRDetailViewController.xib 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/YTHNetInterface.h 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/YTHNetInterface.m 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/YTHNetdata.h 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/YTHNetdata.m 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/allCommentsViewController.m 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/attentionView.m 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/discoverGoodsDetailViewController.m 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/forgetPasswordViewController.m 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/searchDetailViewController.m 104 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/subregionView.m 117 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Podfile 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
PrivacyInfo.xcprivacy 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/TencentOpenAPI.framework/Headers/QQApiInterface.h 232 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/TencentOpenAPI.framework/Headers/QQApiInterfaceObject.h 754 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/TencentOpenAPI.framework/Headers/TencentOAuth.h 516 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/TencentOpenAPI.framework/Headers/TencentOpenApiUmbrellaHeader.h 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/TencentOpenAPI.framework/Headers/module.modulemap 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/TencentOpenAPI.framework/Headers/sdkdef.h 420 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lib/TencentOpenAPI.framework/TencentOpenAPI 补丁 | 查看 | 原始文档 | blame | 历史
BuWanVideo2.0/AdConstant.h
New file
@@ -0,0 +1,30 @@
//
//  AdConstant.h
//  BuWanVideo2.0
//
//  Created by developer on 2024/9/13.
//  Copyright Â© 2024 com.yeshi.buwansheque.ios. All rights reserved.
//
#import <UIKit/UIKit.h>
#ifndef AdConstant_h
#define AdConstant_h
#endif /* AdConstant_h */
#define CSJ_AD_PID_SPLASH @"103139011"
#define CSJ_AD_PID_HOME_INTERSTITIAL @"103137392"
#define CSJ_AD_PID_HOME_DRAW @"103138446"
#define CSJ_AD_PID_SEARCH @"103139105"
#define CSJ_AD_PID_SEARCH_RESULT @"103137496"
#define CSJ_AD_PID_VIDEO_DETAIL @"103138060"
#define CSJ_AD_PID_CLASS_BANNER @"103138646"
#define CSJ_AD_PID_VIDEO_DETAIL_DRAW @"103144328"
BuWanVideo2.0/AppDelegate.h
@@ -7,6 +7,9 @@
//
#import <UIKit/UIKit.h>
#import "LoggingViewController.h"
#include "CSJExpressAdManager.h"
@protocol YTHNetDelegateRecommend <NSObject>
@@ -40,6 +43,10 @@
@property (nonatomic , weak) id<YTHBacktoApplicationsDelegate> YBackAppDelegate;
@property (nonatomic, strong) LoggingViewController *loggingViewController;
@property (nonatomic, strong)  CSJExpressAdManager *searchAdManager;
-(void)initData;
@end
BuWanVideo2.0/AppDelegate.m
@@ -23,7 +23,6 @@
#import "RecommendMainController.h"
#import "RecommendController.h"
#import "recommendViewController.h"
#import "subregionViewController.h"
#import "MineViewController.h"
#import "discoverViewController.h"
@@ -49,13 +48,23 @@
//内容联盟
#import <LCDSDK/LCDSDK.h>
#import <WXApi.h>
#import <TencentOAuth.h>
#import <PangrowthDJX/DJXSDK.h>
#define LECUsedBundleID   @"com.yeshi.buwanshequ.ios"
#define TICK   NSDate *startTime = [NSDate date]
#define TOCK   NSLog(@"Time: %f", -[startTime timeIntervalSinceNow])
@interface AppDelegate ()<GDTSplashAdDelegate, BUSplashAdDelegate, UINavigationControllerDelegate>
NSNotificationName _Nonnull const kLCSDJXSDKSetConfigNotification = @"kLCSDJXSDKSetConfigNotification";
@interface AppDelegate ()<GDTSplashAdDelegate, BUSplashAdDelegate, UINavigationControllerDelegate, WXApiDelegate, DJXAuthorityConfigDelegate>
@property (strong,nonatomic) GDTSplashAd *gdtSplash;
@@ -91,6 +100,17 @@
- (void) initSDK:(BUCompletionHandler)completionHandler{
    [self requestIDFA];
    // åˆå§‹åŒ–微信
    //在register之前打开log, åŽç»­å¯ä»¥æ ¹æ®log排查问题
    [WXApi startLogByLevel:WXLogLevelDetail logBlock:^(NSString *log) {
        NSLog(@"WeChatSDK: %@", log);
    }];
    [WXApi registerApp:@"wx428de66710fac55b" universalLink:@"https://universallinks.ios.yeshitv.com/wx/"];
    _loggingViewController = [[LoggingViewController alloc] init];
    //集成友盟
    [self setUmeng];
    //[MobClick setLogEnabled:YES];
@@ -128,6 +148,11 @@
        return;
    }
    _inited=true;
    if(_searchAdManager==nil){
        _searchAdManager = [[CSJExpressAdManager alloc] init];
    }
        
   // [self requestIDFA];
    //添加网络监测
@@ -286,7 +311,7 @@
        UINavigationController *ndrawVC = [[UINavigationController alloc]initWithRootViewController:drawVC];
        ndrawVC.navigationBar.hidden = YES;
        
        //短剧
        //短剧 TODO
        DYDramaVideoController *dramaVC = [[DYDramaVideoController alloc]init];
        dramaVC.tabBarItem.image = [[UIImage imageNamed:@"nav_draw_video"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        dramaVC.tabBarItem.selectedImage = [[UIImage imageNamed:@"nav_draw_video_highlight"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
@@ -295,7 +320,10 @@
        
        
        self.tabBarController = [[SJTabbarViewController alloc]init];
        self.tabBarController.viewControllers = @[nrecommendVC,ndrawVC,ndramaVC,nmineVC];//nnovelVC
        self.tabBarController.viewControllers = @[nrecommendVC,ndrawVC,ndramaVC,nmineVC];
//        self.tabBarController.viewControllers = @[nrecommendVC,ndrawVC,nmineVC];
        self.tabBarController.tabBar.tintColor = YTHColor(0, 82, 246);
        self.tabBarController.tabBar.unselectedItemTintColor=YTHColor(153, 153, 153);
        [self.tabBarController.tabBar setClipsToBounds:YES];
@@ -352,6 +380,7 @@
            [YTHsharedManger startManger].ad = result[@"Data"][@"adNew"];
            [[NSUserDefaults standardUserDefaults] setObject:result[@"Data"][@"vipLink"]?:@"" forKey:VIPLINK];
            [[NSUserDefaults standardUserDefaults] setObject:result[@"Data"][@"unRegisterLink"]?:@"" forKey:UNREGISTER_LINK];
            [[NSUserDefaults standardUserDefaults] setObject:result[@"Data"][@"onLining"] forKey:ONLINING];
            [[NSUserDefaults standardUserDefaults] synchronize];
        }else{
            
@@ -427,20 +456,50 @@
//        BOOL result = [[UMSocialManager defaultManager] handleOpenURL:url];
//        return result;
//    }
    NSLog(@"测试: openURL sourceApplication %@",url);
    
    return YES;
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
    NSLog(@"测试: openURL handleOpenURL %@",url);
    return YES;
}
//IOS9.0 ç³»ç»Ÿæ–°çš„处理openURL çš„API
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<NSString *,id> *)options {
    // æ–°æŽ¥å£å†™æ³•
//    if (![[UMSocialManager defaultManager] handleOpenURL:url]) {
//        BOOL result = [[UMSocialManager defaultManager] handleOpenURL:url];
//        return result;
//    }
    switch(_loggingViewController.loginType ){
        case  LOGIN_TYPE_QQ:
            return [TencentOAuth HandleOpenURL:url];
            break;
        case  LOGIN_TYPE_WX:
            return  [WXApi handleOpenURL:url delegate:self];
            break;
    }
    return YES;
}
- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler{
    switch(_loggingViewController.loginType ){
        case  LOGIN_TYPE_QQ:
            if ([userActivity.activityType isEqualToString:NSUserActivityTypeBrowsingWeb]) {
                   NSURL *url = userActivity.webpageURL;
                   if(url && [TencentOAuth CanHandleUniversalLink:url]) {
                       return [TencentOAuth HandleUniversalLink:url];
                   }
               }
            break;
        case  LOGIN_TYPE_WX:
            return [WXApi handleOpenUniversalLink:userActivity delegate:self];
            break;
    }
    return YES;
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
    
@@ -496,11 +555,26 @@
}
//穿山甲广告
- (void)loadAd {
    id splash=[YTHsharedManger startManger].ad[@"splash"];
    if(splash==nil|| splash==[NSNull null] ||splash[@"type"]==nil){
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            [self hiddenSplash];
            [self splashDisappear];
        });
        return;
    }
    if([[YTHsharedManger startManger].ad[@"splash"][@"type"] isEqualToString:@"csj"]){
        [self loadCSJSplashAD];
    }else{
        [self loadGDTAd];
    }
//    [BUAdSDKManager set :NO];
    // splash AD demo
    [self loadCSJSplashAD];
//    [self loadGDTAd];
//
}
- (void) initCSJAd:(BUCompletionHandler)completionHandler{
@@ -510,29 +584,74 @@
    configuration.secretKey=@"buwan_ios!@";
    configuration.useMediation = YES;
    [BUAdSDKManager startWithAsyncCompletionHandler:^(BOOL success, NSError *error) {
        if(success){
            NSLog(@"广告-穿山甲初始化成功");
        }else{
            NSLog(@"广告-穿山甲初始化失败:%@",error);
        }
        dispatch_async(dispatch_get_main_queue(),^{
            [self initBUContent];
            completionHandler(success,error);
        });
    }];
}
static NSString * JSONConfigPath(void) {
    return [[NSBundle mainBundle] pathForResource:@"SDK_Setting_5096047" ofType:@"json"];
}
//初始化内容联盟
- (void)initBUContent{
    // åˆå§‹åŒ–LCDSDK
       LCDConfig *config = [LCDConfig new];
   #if DEBUG
       config.logLevel = LCDSDKLogLevelDebug;
   #endif
       // è¯·ä½¿ç”¨æ‚¨çš„配置文件(例如SDK_Setting_5151488.json)初始化SDK,并确保配置文件已经作为Copy Bundle Resource引入工程
       NSString *configPath = [[NSBundle mainBundle] pathForResource:@"SDK_Setting_5096047" ofType:@"json"];
// TODO ï»¿æµ‹è¯•
- (void)setUpDJXSDK:(DJXStartCompletionBlock)block {
    
    [LCDManager startWithConfigPath:configPath config:config completion:^(LCDINITStatus initStatus, NSDictionary * _Nonnull userInfo) {
    DJXConfig *config = [DJXConfig new];
    config.authorityDelegate = self;
#if DEBUG
    config.logLevel = DJXSDKLogLevelDebug;
#endif
    [NSNotificationCenter.defaultCenter postNotification:[NSNotification notificationWithName:kLCSDJXSDKSetConfigNotification object:nil userInfo:@{@"config": config}]];
    [DJXManager initializeWithConfigPath:JSONConfigPath() config:config];
    [DJXManager startWithCompleteHandler:^(BOOL initStatus, NSDictionary *userInfo) {
        if (initStatus) {
            NSLog(@"短剧初始化注册成功!");
        } else {
            NSLog(@"短剧初始化注册失败:%@", userInfo[@"msg"]);
        }
        if (block) {
            block(initStatus, userInfo);
        }
    }];
}
- (void)setUpLCDSDK:(LCDStartCompletionBlock)block {
    LCDConfig *config = [LCDConfig new];
#if DEBUG
    config.logLevel = LCDSDKLogLevelDebug;
#endif
    [LCDManager initializeWithConfigPath:JSONConfigPath() config:config];
    [LCDManager startWithCompleteHandler:^(LCDINITStatus initStatus, NSDictionary *userInfo) {
        if (initStatus == LCDINITStatus_success) {
            NSLog(@"初始化注册成功!");
        } else {
            NSLog(@"初始化注册失败,请重新注册");
            NSLog(@"%@", userInfo[@"msg"]);
        }
        if (block) {
            block(initStatus, userInfo);
        }
    }];
}
//初始化内容联盟
- (void)initBUContent{
    __weak typeof(self) weakSelf = self;
    [self setUpLCDSDK:^(LCDINITStatus initStatus, NSDictionary * _Nonnull userInfo) {
// TODO ï»¿æµ‹è¯•
        [weakSelf setUpDJXSDK:^(BOOL initStatus, NSDictionary * _Nonnull userInfo) {
            NSLog(@"");
        }];
    }];
    
}
@@ -611,7 +730,7 @@
- (void)loadCSJSplashAD {
    NSLog(@"广告-加载穿山甲广告");
   CGRect frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width,  [UIScreen mainScreen].bounds.size.height - 100);
    self.csjSplashAd = [[BUSplashAd alloc] initWithSlotID:@"102509668" adSize:CGSizeMake(frame.size.width, frame.size.height)];
    self.csjSplashAd = [[BUSplashAd alloc] initWithSlotID:CSJ_AD_PID_SPLASH adSize:CGSizeMake(frame.size.width, frame.size.height)];
    //self.splashAd.tolerateTimeout = 10;
    self.csjSplashAd.delegate = self;
    self.csjSplashAd.tolerateTimeout=3.0;
@@ -684,6 +803,51 @@
    
    [_gdtSplash loadAd];
}
- (void)loadCSJGlobalAd {
    NSLog(@"广告-加载穿山甲全球广告");
    //根据iPhone设备不同设置不同的背景图
    float width = [UIScreen mainScreen].bounds.size.width;
    float height = [UIScreen mainScreen].bounds.size.height;
    UIImageView *imageview = [[UIImageView alloc]init];
    CGFloat  viewHeight = 0.0;
    if (width == 320.0f && height<=480.0f) {
        // iphone4 iphone4s ä¸Šçš„default图片
        imageview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"320"]];
        viewHeight = 55;
    }else if (width ==320.0f && height==568.0f) {
        // iphone5 ä¸Šçš„default图片
        imageview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"320"]];
        viewHeight = 55;
    }else if (width ==375.0f) {
        // iphone6 ä¸Šçš„default图片
        imageview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"375"]];
        viewHeight = 63;
    }else{
        // iphone6 plus ä¸Šçš„default图片
        imageview.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"414"]];
        viewHeight = 69;
    }
    UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, KScreenH - viewHeight, KScreenW, viewHeight)];
    imageview.frame = CGRectMake(0, 12, _bottomView.frame.size.width, _bottomView.frame.size.height - 6);
    [bottomView addSubview:imageview];
    bottomView.backgroundColor = [UIColor whiteColor];
    UIView *loadView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, width, viewHeight)];
    loadView.backgroundColor = [UIColor clearColor];
    if(_bottomView!=nil){
        _bottomView.hidden = YES;
        [_bottomView removeFromSuperview];
        _bottomView = nil;
    }
    self.bottomView = bottomView;
//    [self.window addSubview:self.bottomView];
}
#pragma mark ä¿¡é¸½æŽ¨é€
- (void)registerPush{
@@ -877,13 +1041,17 @@
///新版本回调
///
- (void)splashAdLoadFail:(BUSplashAd *)splashAd error:(BUAdError *)error{
   // NSLog(@"广告-加载穿山甲广告失败 %@",error.description);
    NSLog(@"广告-加载穿山甲广告失败 %@",error.description);
    UIView *bottom =[[UIApplication sharedApplication].keyWindow viewWithTag:1111];
    if(bottom){
        [bottom removeFromSuperview];
    }
    [self pbu_logWithSEL:_cmd msg:@""];
    [self loadGDTAd];
    if(error.code == 20001){
        [self loadCSJGlobalAd];
    }else{
        [self loadGDTAd];
    }
}
- (void)splashAdLoadSuccess:(BUSplashAd *)splashAd{
   // NSLog(@"广告-加载穿山甲广告成功");
@@ -908,7 +1076,7 @@
- (void)splashAdDidShow:(nonnull BUSplashAd *)splashAd {
    //NSLog(@"广告-穿山甲广告展示");
    [self pbu_logWithSEL:_cmd msg:@""];
    [self hiddenSplash];
//    [self hiddenSplash];
}
@@ -1010,6 +1178,20 @@
    NSLog(@"%s",__FUNCTION__);
}
// å¾®ä¿¡å›žè°ƒ
- (void)onReq:(BaseReq *)req{
    NSLog(@"测试:onReq");
}
- (void)onResp:(BaseResp *)resp{
    NSLog(@"测试:onResp");
    if(_loggingViewController){
        [_loggingViewController onResp: resp];
    }
}
@end
BuWanVideo2.0/Assets.xcassets/icon_login_qq.imageset/.3-sunloginclient972D645E-1978-46D9-9FE5-F626A987D484
BuWanVideo2.0/Assets.xcassets/icon_login_qq.imageset/.4-sunloginclient0E9E223D-9261-488B-9FA1-26EF291120CD
BuWanVideo2.0/Assets.xcassets/icon_login_qq.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "filename" : "qq@2x.png",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "filename" : "qq@3x.png",
      "scale" : "3x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}
BuWanVideo2.0/Assets.xcassets/icon_login_qq.imageset/qq@2x.png
BuWanVideo2.0/Assets.xcassets/icon_login_qq.imageset/qq@3x.png
BuWanVideo2.0/Assets.xcassets/icon_login_wx.imageset/.3-sunloginclient972D645E-1978-46D9-9FE5-F626A987D484
BuWanVideo2.0/Assets.xcassets/icon_login_wx.imageset/Contents.json
New file
@@ -0,0 +1,22 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "filename" : "微信@2x.png",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "filename" : "微信@3x.png",
      "scale" : "3x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}
BuWanVideo2.0/Assets.xcassets/icon_login_wx.imageset/΢ÐÅ@2x.png
BuWanVideo2.0/Assets.xcassets/icon_login_wx.imageset/΢ÐÅ@3x.png
BuWanVideo2.0/Assets.xcassets/icon_password_hidden.imageset/.8-sunloginclient5AE882B3-52AE-472D-9FF4-DE4D4C5E0206
BuWanVideo2.0/Assets.xcassets/icon_password_hidden.imageset/Contents.json
New file
@@ -0,0 +1,23 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "filename" : "icon_password_hidden.png",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "filename" : "icon_password_hidden@2x.png",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "filename" : "icon_password_hidden@3x.png",
      "scale" : "3x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}
BuWanVideo2.0/Assets.xcassets/icon_password_hidden.imageset/icon_password_hidden.png
BuWanVideo2.0/Assets.xcassets/icon_password_hidden.imageset/icon_password_hidden@2x.png
BuWanVideo2.0/Assets.xcassets/icon_password_hidden.imageset/icon_password_hidden@3x.png
BuWanVideo2.0/Assets.xcassets/icon_password_show.imageset/.10-sunloginclient0E4352D0-4D15-4DD5-9D6B-B0257FAB4826
BuWanVideo2.0/Assets.xcassets/icon_password_show.imageset/.8-sunloginclient5AE882B3-52AE-472D-9FF4-DE4D4C5E0206
BuWanVideo2.0/Assets.xcassets/icon_password_show.imageset/Contents.json
New file
@@ -0,0 +1,23 @@
{
  "images" : [
    {
      "idiom" : "universal",
      "filename" : "形状 1.png",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "filename" : "形状 1@2x.png",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "filename" : "形状 1@3x.png",
      "scale" : "3x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}
BuWanVideo2.0/Assets.xcassets/icon_password_show.imageset/ÐÎ×´ 1.png
BuWanVideo2.0/Assets.xcassets/icon_password_show.imageset/ÐÎ×´ 1@2x.png
BuWanVideo2.0/Assets.xcassets/icon_password_show.imageset/ÐÎ×´ 1@3x.png
BuWanVideo2.0/BuWanVideo2.0.entitlements
@@ -4,6 +4,10 @@
<dict>
    <key>aps-environment</key>
    <string>development</string>
    <key>com.apple.developer.associated-domains</key>
    <array>
        <string>applinks:universallinks.ios.yeshitv.com</string>
    </array>
    <key>com.apple.developer.pass-type-identifiers</key>
    <array>
        <string>$(TeamIdentifierPrefix)*</string>
BuWanVideo2.0/CSJExpressAdManager.h
New file
@@ -0,0 +1,21 @@
//
//  CSJExpressAdManager.h
//  BuWanVideo2.0
//
//  Created by developer on 2024/10/22.
//  Copyright Â© 2024 com.yeshi.buwansheque.ios. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <BUAdSDK/BUAdSDK.h>
NS_ASSUME_NONNULL_BEGIN
@interface CSJExpressAdManager : NSObject
@property(nonatomic, strong) BUNativeAd *buNativeAd;
-(void) preLoadSearchAd;
@end
NS_ASSUME_NONNULL_END
BuWanVideo2.0/CSJExpressAdManager.m
New file
@@ -0,0 +1,46 @@
//
//  CSJExpressAdManager.m
//  BuWanVideo2.0
//
//  Created by developer on 2024/10/22.
//  Copyright Â© 2024 com.yeshi.buwansheque.ios. All rights reserved.
//
#import "CSJExpressAdManager.h"
@interface CSJExpressAdManager ()<BUMNativeAdsManagerDelegate>
@property (strong, nonatomic)  BUNativeAdsManager *adManager;
@end
@implementation CSJExpressAdManager
-(void) preLoadSearchAd{
    if(_buNativeAd==nil){
        [self loadCSJAd];
    }
}
-(void) loadCSJAd{
    // ï»¿åŠ è½½ï»¿å¹¿å‘Š
       BUAdSlot *slot = [[BUAdSlot alloc] init];
       slot.ID = CSJ_AD_PID_SEARCH; // èšåˆç»´åº¦é€šè¿‡å¹¿å‘Šä½ID发起请求,仅接入CSJ广告通过代码位ID发起请求
       slot.adSize = CGSizeMake(KScreenW-9*2, (KScreenW-9*2)*0.6); // æŒ‰ç…§å®žé™…情况设置广告尺寸
       slot.mediation.mutedIfCan = YES; // é™éŸ³ ï¼ˆèšåˆåŠŸèƒ½ï¼‰
       BUNativeAdsManager *adManager = [[BUNativeAdsManager alloc] initWithSlot:slot];
       self.adManager = adManager;
       self.adManager.delegate = self;
       [self.adManager loadAdDataWithCount:1]; // åŠ è½½å¹¿å‘Šæ•°é‡ï¼Œæ”¯æŒ1~3个
}
- (void)nativeAdsManagerSuccessToLoad:(BUNativeAdsManager *)adsManager nativeAds:(NSArray<BUNativeAd *> *)nativeAdDataArray{
    NSLog(@"搜索页广告请求成功:%.0f", [[NSDate date] timeIntervalSince1970] * 1000);
    for (BUNativeAd *model in nativeAdDataArray) {
        self.buNativeAd = model;
        break;
    }
}
@end
BuWanVideo2.0/Common.h
@@ -26,6 +26,7 @@
#import "UIViewController+Tools.h"
#import "BSKImagesPageView.h"
#import "NoNetworkView.h"
#import "AdConstant.h"
//友盟分享
#define YMWXKEY     @"wx428de66710fac55b"
@@ -39,6 +40,8 @@
#define UNREGISTER_LINK  @"unRegisterLink"
#define ONLINING  @"onLining"
//设置里面的web网页链接
#define changjianwenti [NSString stringWithFormat:@"http://video.yeshitv.com:8089/BuWan/api_question_ios.jsp?package=%@",[[NSBundle mainBundle] bundleIdentifier]]//常见问题
#define guanyuwomen [NSString stringWithFormat:@"http://video.yeshitv.com:8089/BuWan/api_about_us_ios.jsp?package=%@",[[NSBundle mainBundle] bundleIdentifier]]//关于我们
BuWanVideo2.0/DYDramaVideoController.h
@@ -10,6 +10,6 @@
#import "MainBaseController.h"
#import <LCDSDK/LCDSDK.h>
@interface DYDramaVideoController :MainBaseController <LCDPlayletInterfaceProtocol,LCDDrawVideoViewControllerDelegate>
@interface DYDramaVideoController :MainBaseController <LCDDrawVideoViewControllerDelegate , LCDAdvertCallBackProtocol>
@end
BuWanVideo2.0/DYDramaVideoController.m
@@ -7,12 +7,12 @@
//
#import "DYDramaVideoController.h"
#import <LCDSDK/LCDSDK.h>
#import <PangrowthDJX/DJXSDK.h>
@interface DYDramaVideoController ()<LCDDrawVideoViewControllerDelegate , LCDAdvertCallBackProtocol>
@property
LCDDrawVideoViewController *vc;
@interface DYDramaVideoController ()<LCDDrawVideoViewControllerDelegate , LCDAdvertCallBackProtocol, DJXDrawVideoViewControllerDelegate>
@property(nonatomic, strong) DJXDrawVideoViewController *vc;
@end
@@ -31,65 +31,52 @@
}
- (void) viewDidLoad{
    [self buildCells];
    //短剧
    [DJXManager startWithCompleteHandler:^(BOOL initStatus, NSDictionary *userInfo) {
        dispatch_async(dispatch_get_main_queue(), ^{
            [self buildCells];
        });
    }];
}
- (void)viewDidAppear:(BOOL)animated{
   // if(self.vc!=nil){
   //    [self.vc drawVideoViewControllerDidAppear];
   // }
    if(self.vc!=nil){
       [self.vc drawVideoViewControllerDidAppear];
    }
}
- (void)viewDidDisappear:(BOOL)animated{
    //if(self.vc!=nil){
    //    [self.vc drawVideoViewControllerDidDisappear];
    //}
    if(self.vc!=nil){
        [self.vc drawVideoViewControllerDidDisappear];
    }
}
- (void)buildCells {
// TODO ï»¿æµ‹è¯•时注释
    UIView *tmpView = [[UIView alloc] initWithFrame:CGRectMake(0, 0,KScreenW,  KScreenH   - ALTabBar_H)];
    tmpView.backgroundColor = UIColor.whiteColor;
    [self.view addSubview:tmpView];
    
    self.vc=[[LCDDrawVideoViewController alloc] initWithConfigBuilder:^(LCDDrawVideoVCConfig * _Nonnull config) {
            LCDPlayletConfig *playletConfig = [LCDPlayletConfig new];
            playletConfig.playletMode = LCDPlayletModeOptions_Package;
            playletConfig.freeEpisodesCount = 10;
    _vc = [[DJXDrawVideoViewController alloc] initWithConfigBuilder:^(DJXDrawVideoVCConfig * _Nonnull config) {
            DJXPlayletConfig *playletConfig = [DJXPlayletConfig new];
            playletConfig.playletUnlockADMode = DJXPlayletUnlockADMode_Common;
            playletConfig.freeEpisodesCount = 5;
            playletConfig.unlockEpisodesCountUsingAD = 5;
            playletConfig.interfaceDelegate = self;
            config.playletConfig = playletConfig;
            config.drawVCTabOptions = LCDDrawVideoVCTabOptions_playlet_feed | LCDDrawVideoVCTabOptions_theater;
            config.viewSize=CGSizeMake(KScreenW, KScreenH   - ALTabBar_H);
            config.showCloseButton = NO;
            //config.hiddenPlayletTitleView=YES;
            config.delegate = self;
            config.playletFreeCount = 10;
            config.drawVCTabOptions = DJXDrawVideoVCTabOptions_playlet_feed | DJXDrawVideoVCTabOptions_theater;
            config.viewSize = CGSizeMake(KScreenW, KScreenH   - ALTabBar_H);
            config.shouldHideTabBarView = YES;
    }];
    self.vc.modalPresentationStyle = UIModalPresentationFullScreen;
    [self addChildViewController:self.vc];
    [tmpView addSubview:self.vc.view];
            config.playletConfig = playletConfig;
            config.delegate = self;
        }];
    _vc.modalPresentationStyle = UIModalPresentationFullScreen;
    [self addChildViewController:_vc];
    [tmpView addSubview:_vc.view];
    tmpView.layer.masksToBounds = YES;
}
- (void)clickEnterView:(LCDPlayletInfoModel *)infoModel {
    if (infoModel) {
        LCDPlayletConfig *config = [LCDPlayletConfig new];
        config.skitId = infoModel.skit_id;
        config.episode = infoModel.current_episode;
        config.playletMode = LCDPlayletModeOptions_Interface;
        LCDDrawVideoViewController *vc = [[LCDPlayletManager shareInstance] playletViewControllerWithParams:config];
        vc.modalPresentationStyle = UIModalPresentationFullScreen;
        [[UIViewController performSelector:@selector(lcd_topViewController)] presentViewController:vc animated:YES completion:nil];
    }
}
- (void) hiddenNavBar{
@@ -100,8 +87,8 @@
//draw流播放器回调
- (void)drawVideoStartPlay:(UIViewController *)viewController event:(LCDEvent *)event {
NSLog(@"[短剧回调]Draw流 %s %@", __func__, event.description);
[self hiddenNavBar];
    NSLog(@"[短剧回调]Draw流 %s %@", __func__, event.description);
    [self hiddenNavBar];
}
- (void)drawVideoOverPlay:(UIViewController *)viewController event:(LCDEvent *)event {
@@ -126,7 +113,17 @@
- (void)pageViewControllerSwitchToIndex:(NSInteger)index {
//NSLog(@"[短剧回调]切换tab回到 %s åˆ‡åˆ°index为%ld", __func__, index);
    // è°ƒç”¨å»¶è¿Ÿæ‰§è¡Œ
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(500 * NSEC_PER_MSEC)), dispatch_get_main_queue(), ^{
        [self hiddenNavBar];
    });
}
- (void)viewDidLayoutSubviews{
    [self hiddenNavBar];
}
@end
BuWanVideo2.0/Info.plist
@@ -41,7 +41,7 @@
            <string>qq</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>QQ41DD148C</string>
                <string>tencent1105007756</string>
            </array>
        </dict>
        <dict>
@@ -89,6 +89,8 @@
    <string>$(CURRENT_PROJECT_VERSION)</string>
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>weixinURLParamsAPI</string>
        <string>weixinULAPI</string>
        <string>tmall</string>
        <string>tbopen</string>
        <string>baidumobads</string>
BuWanVideo2.0/LGLAlertView/LGLAlertView.m
@@ -124,10 +124,22 @@
            [self performSelector:@selector(dismissAlertController:) withObject:actionController afterDelay:LGLAlertShowTime];
        }];;
        [actionController addAction:alertAction];
        if (actionController.popoverPresentationController) {
            // è¿™é‡Œå‡è®¾ä»¥å½“前视图的中心作为弹出框的显示位置
            actionController.popoverPresentationController.sourceView = viewController.view;
            actionController.popoverPresentationController.sourceRect = CGRectMake(viewController.view.bounds.size.width / 2.0, viewController.view.bounds.size.height / 1.0, 1.0, 1.0);
        }
        [viewController presentViewController:actionController animated:YES completion:nil];
    } else {
        if (actionController.popoverPresentationController) {
            // è¿™é‡Œå‡è®¾ä»¥å½“前视图的中心作为弹出框的显示位置
            actionController.popoverPresentationController.sourceView = viewController.view;
            actionController.popoverPresentationController.sourceRect = CGRectMake(viewController.view.bounds.size.width / 2.0, viewController.view.bounds.size.height / 1.0, 1.0, 1.0);
        }
        [viewController presentViewController:actionController animated:YES completion:nil];
    //如果没有按钮,自动延迟消失
        [self performSelector:@selector(dismissAlertController:) withObject:actionController afterDelay:LGLAlertShowTime];
    }
}
@@ -172,6 +184,13 @@
        }
        va_end(args);
    }
    if (actionController.popoverPresentationController) {
        // è¿™é‡Œå‡è®¾ä»¥å½“前视图的中心作为弹出框的显示位置
        actionController.popoverPresentationController.sourceView = viewController.view;
        actionController.popoverPresentationController.sourceRect = CGRectMake(viewController.view.bounds.size.width / 2.0, viewController.view.bounds.size.height / 1.0, 1.0, 1.0);
    }
    [viewController presentViewController:actionController animated:YES completion:nil];
    
    //如果没有按钮,自动延迟消失
BuWanVideo2.0/LeftViewController.m
@@ -22,6 +22,7 @@
#import "LoggingViewController.h"
#import "Personal_informationViewController.h"
#import <SafariServices/SafariServices.h>
#import "AppDelegate.h"
@interface LeftViewController ()<UITableViewDelegate,UITableViewDataSource,HXEasyCustomShareViewDelegate>{
    NSArray *_iconArr;
@@ -168,7 +169,7 @@
        Personal_informationVC.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:Personal_informationVC animated:YES];
    }else{//跳入登录界面
        LoggingViewController *loginVC=[[LoggingViewController alloc] init];
        LoggingViewController *loginVC=((AppDelegate*)[UIApplication sharedApplication].delegate).loggingViewController;
        loginVC.hidesBottomBarWhenPushed = YES;
        [self.navigationController pushViewController:loginVC animated:YES];
    }
@@ -192,7 +193,7 @@
                vc.url =[[NSUserDefaults standardUserDefaults] objectForKey:VIPLINK];
                [self.navigationController pushViewController:vc animated:YES];
            }else{
                LoggingViewController *loginVC=[LoggingViewController new];
                LoggingViewController *loginVC=((AppDelegate*)[UIApplication sharedApplication].delegate).loggingViewController;
                [loginVC setHidesBottomBarWhenPushed:YES];
                [self.navigationController pushViewController:loginVC animated:YES];
            }
@@ -231,7 +232,7 @@
                [nr setHidesBottomBarWhenPushed:YES];
                [self.navigationController pushViewController:nr animated:YES];
            }else{
                LoggingViewController *loginVC=[LoggingViewController new];
                LoggingViewController *loginVC=((AppDelegate*)[UIApplication sharedApplication].delegate).loggingViewController;
                [loginVC setHidesBottomBarWhenPushed:YES];
                [self.navigationController pushViewController:loginVC animated:YES];
            }
@@ -243,7 +244,7 @@
                [message setHidesBottomBarWhenPushed:YES];
                [self.navigationController pushViewController:message animated:YES];
            }else{
                LoggingViewController *loginVC=[LoggingViewController new];
                LoggingViewController *loginVC=((AppDelegate*)[UIApplication sharedApplication].delegate).loggingViewController;
                [loginVC setHidesBottomBarWhenPushed:YES];
                [self.navigationController pushViewController:loginVC animated:YES];
            }
BuWanVideo2.0/LoggingViewController.h
@@ -7,10 +7,19 @@
//
#import <UIKit/UIKit.h>
#import <WXApi.h>
#import "WechatAuthSDK.h"
#define LOGIN_TYPE_QQ 1
#define LOGIN_TYPE_WX 2
@interface LoggingViewController : UIViewController
    
@property (nonatomic) BOOL ispresent;
// æ˜¯å¦éœ€è¦å›žåˆ°è·Ÿç•Œé¢ 
@property (nonatomic, assign) BOOL backNotRoot;
@property (nonatomic, assign) int loginType;
- (void)onResp:(BaseResp *)resp;
@end
BuWanVideo2.0/LoggingViewController.m
@@ -16,17 +16,36 @@
#import "RegisteViewController.h"
#import "forgetPasswordViewController.h"
#import "SettingWebView.h"
#import <TencentOAuth.h>
@interface LoggingViewController (){
@interface LoggingViewController () <TencentSessionDelegate>{
    UITextField *accountNumber;
    UITextField *PasswordNumber;
    UIButton *LoginBtn;
    UIImageView *showPassWordSwitch;
    TencentOAuth *tencentOAuth;
    UIButton *agreeBtn;
}
@end
@implementation LoggingViewController{
@implementation LoggingViewController {
    
}
- (IBAction)changePwdShow: (UITapGestureRecognizer *)gesture{
    if(showPassWordSwitch.tag == 0){
        [showPassWordSwitch setImage:[UIImage imageNamed:@"icon_password_show"]];
        showPassWordSwitch.tag = 1;
        PasswordNumber.secureTextEntry = NO;
    }else{
        [showPassWordSwitch setImage:[UIImage imageNamed:@"icon_password_hidden"]];
        showPassWordSwitch.tag = 0;
        PasswordNumber.secureTextEntry = YES;
    }
}
- (void)viewDidLoad {
@@ -92,10 +111,12 @@
    UILabel *password=[[UILabel alloc] init];
    //密码输入框
    PasswordNumber=[[UITextField alloc] init];
    //密码显示开关
    showPassWordSwitch = [[UIImageView alloc] init];
    //分割线
    UILabel *Dividing_line2=[[UILabel alloc] init];
    //是否同意协议
    UIButton *agreeBtn=[[UIButton alloc] init];
     agreeBtn=[[UIButton alloc] init];
    //协议
    UIButton *agreeItem=[[UIButton alloc] init];
    //忘记密码
@@ -104,69 +125,70 @@
    UIButton *registerBtn=[[UIButton alloc] init];
    //登录
    LoginBtn=[[UIButton alloc] init];
    int START_Y = 0;
    if ([UIScreen mainScreen].bounds.size.height>480.0f) {//iphone4s以上
        //表头图片
        UIImageView *titleImage=[[UIImageView alloc] initWithFrame:CGRectMake(60, 85, KScreenW-120,(KScreenW-120)/394*171)];
        titleImage.image=[UIImage imageNamed:@"登录表头"];
        [self.view addSubview:titleImage];
        //账号
        account.frame=CGRectMake(50, 100+(KScreenW-120)/394*171, 44,30);
        account.frame=CGRectMake(50, START_Y+(KScreenW-120)/394*171, 44,30);
        //账号输入框
        accountNumber.frame=CGRectMake(95, 100+(KScreenW-120)/394*171, KScreenW-145, 30);
        accountNumber.frame=CGRectMake(95, START_Y+(KScreenW-120)/394*171, KScreenW-145, 30);
        //分割线
        Dividing_line.frame=CGRectMake(50, 135+(KScreenW-120)/394*171, KScreenW-110, 0.5);
        Dividing_line.frame=CGRectMake(50, START_Y + 35+(KScreenW-120)/394*171, KScreenW-110, 0.5);
        //密码
        password.frame=CGRectMake(50, 140+(KScreenW-120)/394*171, 44, 30);
        password.frame=CGRectMake(50, START_Y + 40 +(KScreenW-120)/394*171, 44, 30);
        //密码输入框
        PasswordNumber.frame=CGRectMake(95, 140+(KScreenW-120)/394*171, KScreenW-145, 30);
        PasswordNumber.frame=CGRectMake(95, START_Y + 40 +(KScreenW-120)/394*171, KScreenW-185, 30);
        //密码显示按钮
        showPassWordSwitch.frame=CGRectMake(KScreenW-80, START_Y + 40 +(KScreenW-120)/394*171 + 10, 20, 15);
        //分割线
        Dividing_line2.frame=CGRectMake(50, 175+(KScreenW-120)/394*171, KScreenW-110, 0.5);
        Dividing_line2.frame=CGRectMake(50, START_Y + 75 +(KScreenW-120)/394*171, KScreenW-110, 0.5);
        //是否同意协议
        if ([UIScreen mainScreen].bounds.size.width>=375.0) {
            agreeBtn.frame=CGRectMake(60, 195+(KScreenW-120)/394*171, 14, 14);
            agreeBtn.frame=CGRectMake(60, START_Y + 95 +(KScreenW-120)/394*171, 14, 14);
        }else{
            agreeBtn.frame=CGRectMake(KScreenW/2-80-15, 220+(KScreenW-120)/394*171, 14, 14);
            agreeBtn.frame=CGRectMake(KScreenW/2-80-15, START_Y + 120 +(KScreenW-120)/394*171, 14, 14);
        }
        //协议
        if ([UIScreen mainScreen].bounds.size.width>=375.0) {
            agreeItem.frame=CGRectMake(75, 192+(KScreenW-120)/394*171, 160, 20);
            agreeItem.frame=CGRectMake(75, START_Y + 92 +(KScreenW-120)/394*171, 160, 20);
        }else{
            agreeItem.frame=CGRectMake(KScreenW/2-80, 217+(KScreenW-120)/394*171, 160, 20);
            agreeItem.frame=CGRectMake(KScreenW/2-80, START_Y + 117 +(KScreenW-120)/394*171, 160, 20);
        }
        //忘记密码
        if ([UIScreen mainScreen].bounds.size.width>=375.0) {
            forgetedPassword.frame=CGRectMake(240, 192+(KScreenW-120)/394*171, 100, 20);
            forgetedPassword.frame=CGRectMake(240, START_Y + 92 +(KScreenW-120)/394*171, 100, 20);
        }else{
            forgetedPassword.frame=CGRectMake(KScreenW-150, 192+(KScreenW-120)/394*171, 100, 20);
            forgetedPassword.frame=CGRectMake(KScreenW-150, START_Y + 92 +(KScreenW-120)/394*171, 100, 20);
        }
        //注册
        registerBtn.frame=CGRectMake(60, 250+(KScreenW-120)/394*171, (KScreenW-150)/2-20, 35);
        registerBtn.frame=CGRectMake(60, START_Y + 150 +(KScreenW-120)/394*171, (KScreenW-150)/2-20, 35);
        //登录
        LoginBtn.frame=CGRectMake(60+(KScreenW-150)/2, 250+(KScreenW-120)/394*171, (KScreenW-150)/2+40, 35);
        LoginBtn.frame=CGRectMake(60+(KScreenW-150)/2, START_Y + 150 +(KScreenW-120)/394*171, (KScreenW-150)/2+40, 35);
    }else{
        //账号
        account.frame=CGRectMake(50, 100, 44,30);
        account.frame=CGRectMake(50, START_Y, 44,30);
        //账号输入框
        accountNumber.frame=CGRectMake(95, 100, KScreenW-145, 30);
        accountNumber.frame=CGRectMake(95, START_Y, KScreenW-145, 30);
        //分割线
        Dividing_line.frame=CGRectMake(50, 135, KScreenW-110, 0.5);
        Dividing_line.frame=CGRectMake(50, START_Y + 35, KScreenW-110, 0.5);
        //密码
        password.frame=CGRectMake(50, 140, 44, 30);
        //密码输入框
        PasswordNumber.frame=CGRectMake(95, 140, KScreenW-145, 30);
        password.frame=CGRectMake(50, START_Y + 40, 44, 30);
        // å¯†ç è¾“入框
        PasswordNumber.frame=CGRectMake(95, START_Y + 40, KScreenW-145, 30);
        // å¯†ç æ˜¾ç¤ºæŒ‰é’®
        showPassWordSwitch.frame=CGRectMake(KScreenW-165, START_Y + 40, 20, 15);
        //分割线
        Dividing_line2.frame=CGRectMake(50, 175, KScreenW-110, 0.5);
        Dividing_line2.frame=CGRectMake(50, START_Y + 75, KScreenW-110, 0.5);
        //是否同意协议
        agreeBtn.frame=CGRectMake(KScreenW/2-80-15, 220, 14, 14);
        agreeBtn.frame=CGRectMake(KScreenW/2-80-15, START_Y + 120, 14, 14);
        //协议
        agreeItem.frame=CGRectMake(KScreenW/2-80, 217, 160, 20);
        agreeItem.frame=CGRectMake(KScreenW/2-80, START_Y + 117, 160, 20);
        //忘记密码
        forgetedPassword.frame=CGRectMake(KScreenW-150, 192, 100, 20);
        forgetedPassword.frame=CGRectMake(KScreenW-150, START_Y + 92, 100, 20);
        //注册
        registerBtn.frame=CGRectMake(60, 250, (KScreenW-150)/2-20, 35);
        registerBtn.frame=CGRectMake(60, START_Y + 150, (KScreenW-150)/2-20, 35);
        //登录
        LoginBtn.frame=CGRectMake(60+(KScreenW-150)/2, 250, (KScreenW-150)/2+40, 35);
        LoginBtn.frame=CGRectMake(60+(KScreenW-150)/2, START_Y + 150, (KScreenW-150)/2+40, 35);
    }
    
    //账号
@@ -177,6 +199,7 @@
    //账号输入框
    accountNumber.keyboardType=UIKeyboardTypeEmailAddress;
    accountNumber.autocorrectionType=UITextAutocorrectionTypeNo;
    accountNumber.placeholder = @"请输入邮箱";
    [self.view addSubview:accountNumber];
    
    //分割线
@@ -191,6 +214,15 @@
    //密码输入框
    PasswordNumber.secureTextEntry=YES;
    [self.view addSubview:PasswordNumber];
    PasswordNumber.placeholder = @"请输入密码";
    [self.view addSubview:showPassWordSwitch];
    [showPassWordSwitch setImage:[UIImage imageNamed:@"icon_password_hidden"]];
    showPassWordSwitch.userInteractionEnabled = YES;
    showPassWordSwitch.tag = 0;
    UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(changePwdShow:)];
    [showPassWordSwitch addGestureRecognizer:singleTap];
    
    //分割线
    Dividing_line2.backgroundColor=kGlobalLightGreyColor_223;
@@ -245,33 +277,55 @@
    [self.view addSubview:LoginBtn];
    
//    //第三方登录
//    UIView * thirdView=[[UIView alloc] initWithFrame:CGRectMake(0, KScreenH-170, KScreenW, 170)];
//    thirdView.backgroundColor=KGlobalLightGreyColor_255;
//    [self.view addSubview:thirdView];
//
//    //第三方登录的标头
//    UIImageView *thirdtitle=[[UIImageView alloc] initWithFrame:CGRectMake((KScreenW-210)/2, 20, 210, 23)];
//    thirdtitle.image=[UIImage imageNamed:@"三方登录标头"];
//    [thirdView addSubview:thirdtitle];
//
//    //QQ登录
//    UIButton * QQLoginButton=[[UIButton alloc] initWithFrame:CGRectMake(KScreenW/2-30, thirdView.frame.size.height/2-30, 60, 60)];
//    [QQLoginButton setBackgroundImage:[UIImage imageNamed:@"QQLogin"] forState:UIControlStateNormal];
//    [QQLoginButton addTarget:self action:@selector(ClickQQ:) forControlEvents:UIControlEventTouchUpInside];
//    [thirdView addSubview:QQLoginButton];
//
//    UILabel * QQLabel=[[UILabel alloc] initWithFrame:CGRectMake(KScreenW/2-30, thirdView.frame.size.height/2+30, 60, 40)];
//    QQLabel.textAlignment = NSTextAlignmentCenter;
//    QQLabel.text=@"QQ";
//    QQLabel.font=[UIFont systemFontOfSize:17];
//    [thirdView addSubview:QQLabel];
//
//    if (![[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"mqq://"]]) {
//        thirdView.hidden = YES;
//    }else{
//        thirdView.hidden = NO;
//
//    }
    UIView * thirdView=[[UIView alloc] initWithFrame:CGRectMake(0, registerBtn.frame.origin.y + registerBtn.size.height + 20, KScreenW, 170)];
    thirdView.backgroundColor=KGlobalLightGreyColor_255;
    [self.view addSubview:thirdView];
    //第三方登录的标头
    UIImageView *thirdtitle=[[UIImageView alloc] initWithFrame:CGRectMake((KScreenW-210)/2, 20, 210, 23)];
    thirdtitle.image=[UIImage imageNamed:@"三方登录标头"];
    [thirdView addSubview:thirdtitle];
    //QQ登录
    UIButton * QQLoginButton=[[UIButton alloc] initWithFrame:CGRectMake(KScreenW/2-60-30, thirdView.frame.size.height/2-30, 60, 60)];
    [QQLoginButton setBackgroundImage:[UIImage imageNamed:@"icon_login_qq"] forState:UIControlStateNormal];
    [QQLoginButton addTarget:self action:@selector(ClickQQ:) forControlEvents:UIControlEventTouchUpInside];
    [thirdView addSubview:QQLoginButton];
    UILabel * QQLabel=[[UILabel alloc] initWithFrame:CGRectMake(KScreenW/2-60-30, thirdView.frame.size.height/2+30, 60, 40)];
    QQLabel.textAlignment = NSTextAlignmentCenter;
    QQLabel.text=@"QQ";
    QQLabel.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1];
    QQLabel.font=[UIFont systemFontOfSize:17];
    [thirdView addSubview:QQLabel];
    // å¾®ä¿¡ç™»å½•
    UIButton * wxLoginButton=[[UIButton alloc] initWithFrame:CGRectMake(KScreenW/2+30, thirdView.frame.size.height/2-30, 60, 60)];
    [wxLoginButton setBackgroundImage:[UIImage imageNamed:@"icon_login_wx"] forState:UIControlStateNormal];
    [wxLoginButton addTarget:self action:@selector(ClickWX:) forControlEvents:UIControlEventTouchUpInside];
    [thirdView addSubview:wxLoginButton];
    UILabel * wxLabel=[[UILabel alloc] initWithFrame:CGRectMake(KScreenW/2+30, thirdView.frame.size.height/2+30, 60, 40)];
    wxLabel.textAlignment = NSTextAlignmentCenter;
    wxLabel.text=@"微信";
    wxLabel.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1];
    wxLabel.font=[UIFont systemFontOfSize:17];
    [thirdView addSubview:wxLabel];
   if( [[NSUserDefaults standardUserDefaults] boolForKey:ONLINING])
   {
       thirdView.hidden = YES;
   }else{
       thirdView.hidden = NO;
   }
    if (![[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"mqq://"]]) {
        //thirdView.hidden = YES;
    }else{
       // thirdView.hidden = NO;
    }
    [self .view addSubview:thirdView];
    
}
@@ -353,20 +407,23 @@
        [Share ShakeView:accountNumber WithInfomation:@"请输入正确的邮箱地址!"];
        return;
    }
    if (![Share isEmailAddress:accountNumber.text]) {
        //账号格式不正确
        [Share ShakeView:accountNumber WithInfomation:@"请输入正确的邮箱地址!"];
    }else if(PasswordNumber.text.length == 0){
        [SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"账号或密码错误"]];
    if(PasswordNumber.text.length == 0){
        [SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"请输入密码"]];
        return;
    }else{
    }
    if( ![agreeBtn isSelected]){
        [SVProgressHUD showInfoWithStatus:@"请先同意“用户使用协议&隐私条款”"];
        return;
    }
    if ([Share isEmailAddress:accountNumber.text]){
        [SVProgressHUD showWithStatus:@"登陆中"];
        [[YTHNetInterface startInterface] getloginWithUid:[YTHsharedManger startManger].Uid WithSystem:@"1" WithEmail:accountNumber.text WithPwd:PasswordNumber.text withBlock:^(BOOL isSuccessful, id result, NSString *error) {
        [[YTHNetInterface startInterface] loginWithEmail:[YTHsharedManger startManger].Uid WithSystem:@"1" WithEmail:accountNumber.text WithPwd:PasswordNumber.text withBlock:^(BOOL isSuccessful, id result, NSString *error) {
            if (isSuccessful) {
                NSString *err=[NSString stringWithFormat:@"%@",[result objectForKey:@"Error"]];
                if (err.length==0) {
                if ([[NSString stringWithFormat:@"%@",[result objectForKey:@"IsPost"]] isEqualToString:@"true"]) {
                    [SVProgressHUD dismiss];
                    //LoginUid
                    [[NSUserDefaults standardUserDefaults] setObject:[[result objectForKey:@"Data"] objectForKey:@"Id"] forKey:@"LoginUid"];
@@ -379,7 +436,7 @@
                    
                }else{
                    //登录失败
                    [SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"账号或密码错误"]];
                    [SVProgressHUD showErrorWithStatus:err];
                    PasswordNumber.text=@"";
                }
                
@@ -390,6 +447,41 @@
                
            }
        }];
    }
//    else if([Share isPhone:accountNumber.text])
//    {
//        [SVProgressHUD showWithStatus:@"登陆中"];
//        [[YTHNetInterface startInterface] loginWithPhone:[YTHsharedManger startManger].Uid WithSystem:@"1" WithPhone:accountNumber.text WithPwd:PasswordNumber.text withBlock:^(BOOL isSuccessful, id result, NSString *error) {
//            if (isSuccessful) {
//                NSString *err=[NSString stringWithFormat:@"%@",[result objectForKey:@"Error"]];
//                if (err.length==0) {
//                    [SVProgressHUD dismiss];
//                    //LoginUid
//                    [[NSUserDefaults standardUserDefaults] setObject:[[result objectForKey:@"Data"] objectForKey:@"Id"] forKey:@"LoginUid"];
//                    [[NSUserDefaults standardUserDefaults] setObject:[[result objectForKey:@"Data"] objectForKey:@"Nickname"] forKey:@"QQUserName"];
//                    [[NSUserDefaults standardUserDefaults] setObject:[[result objectForKey:@"Data"] objectForKey:@"Portrait"] forKey:@"iconURL"];
//                    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"userOnLine"];
//
//                    [self fetchNewInfo];
//
//                }else{
//                    //登录失败
//                    [SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"账号或密码错误"]];
//                    PasswordNumber.text=@"";
//                }
//
//            }else{
//                [SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"账号或密码错误"]];
//                PasswordNumber.text=@"";
//            }
//        }];
//    }
    else{
        [Share ShakeView:accountNumber WithInfomation:@"请输入正确的邮箱地址!"];
        return;
    }
}
@@ -437,42 +529,51 @@
 *
 *  @param sender QQ登录的按钮
 */
//-(void)ClickQQ:(UIButton*)sender{
//
//    if (![[UIApplication sharedApplication] canOpenURL:[NSURL  URLWithString:@"mqq://"]]){
//        [SVProgressHUD showInfoWithStatus:@"您还没有安装QQ哦"];
//
//        return;
//    }
//
//    [[UMSocialManager defaultManager] getUserInfoWithPlatform:UMSocialPlatformType_QQ currentViewController:nil completion:^(id result, NSError *error) {
//        if (error) {
//
//        }else{
//        //提示用户,正在登陆中
//        [SVProgressHUD showWithStatus:@"拼命登陆中..."];
//
//        UMSocialUserInfoResponse *snsAccount = result;
//
//        [[YTHNetInterface startInterface] getThirdPartyWithWithUid:[YTHsharedManger startManger].Uid withOpenId:snsAccount.openid WithName:snsAccount.name WithPortrait:snsAccount.iconurl WithLoginType:@"1" withSystem:@"1" withBlock:^(BOOL isSuccessful, id result, NSString *error) {
//            if (isSuccessful) {
//                [SVProgressHUD dismiss];
//                //LoginUid的设置在YTHNetInterface中,点击上面的的请求函数,就可以看见!
//                [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"userOnLine"];
//                [self getInfoFromInternet];
//                if (_ispresent) {
//                    [self presentBack];
//                }else{
//                    [self back];
//                }
//            }else{
//                //通知用户登录失败
//                [SVProgressHUD showErrorWithStatus:@"登陆失败!"];
//            }
//        }];
//        }
-(void)ClickQQ:(UIButton*)sender{
    if( ![agreeBtn isSelected]){
        [SVProgressHUD showInfoWithStatus:@"请先同意“用户使用协议&隐私条款”"];
        return;
    }
    if (![[UIApplication sharedApplication] canOpenURL:[NSURL  URLWithString:@"mqq://"]]){
        [SVProgressHUD showInfoWithStatus:@"您还没有安装QQ哦"];
        return;
    }
    _loginType = LOGIN_TYPE_QQ;
    if(!tencentOAuth)
    {
        tencentOAuth = [[TencentOAuth alloc] initWithAppId:@"1105007756"  andDelegate:self];
        [TencentOAuth setIsUserAgreedAuthorization:YES];
    }
    NSArray *permissions = [NSArray arrayWithObjects:@"get_user_info",@"get_simple_userinfo", nil];
    [tencentOAuth authorize:permissions];
}
-(void)ClickWX:(UIButton*)sender{
    if( ![agreeBtn isSelected]){
        [SVProgressHUD showInfoWithStatus:@"请先同意“用户使用协议&隐私条款”"];
        return;
    }
    //调用自检函数
//    [WXApi checkUniversalLinkReady:^(WXULCheckStep step, WXCheckULStepResult* result) {
//        NSLog(@"WeChatSDK-check %@, %u, %@, %@", @(step), result.success, result.errorInfo, result.suggestion);
//    }];
//}
    if (![[UIApplication sharedApplication] canOpenURL:[NSURL  URLWithString:@"weixin://"]]){
        [SVProgressHUD showInfoWithStatus:@"您还没有安装微信哦"];
        return;
    }
    _loginType = LOGIN_TYPE_WX;
    //TODO å¾®ä¿¡ç™»å½•
    SendAuthReq* req =[[SendAuthReq alloc] init];
    req.scope = @"snsapi_userinfo"; // åªèƒ½å¡« snsapi_userinfo
    req.state = @"ysdq_ios";
    [WXApi sendReq:req completion:^(BOOL success) {
        NSLog(@"完成");
    }];
}
/**
 ä»Žç½‘络获取数据
@@ -483,7 +584,7 @@
        if (isSuccessful) {
            //首先判断数据是否获成功
            NSString *err=[NSString stringWithFormat:@"%@",[result objectForKey:@"Error"]];
            if (err.length==0) {
            if ([[NSString stringWithFormat:@"%@",[result objectForKey:@"IsPost"]] isEqualToString:@"true"]) {
                //跟新个人信息到全局变量
                if ([[result objectForKey:@"Data"] objectForKey:@"Portrait"]!=nil) {
                    NSString *str=[[result objectForKey:@"Data"] objectForKey:@"Portrait"];
@@ -530,4 +631,95 @@
    }];
}
- (void)onResp:(BaseResp *)resp{
    NSLog(@"onResp");
    if([resp isKindOfClass:[SendAuthResp class]]){
        SendAuthResp *authResp = (SendAuthResp *)resp;
        switch( authResp.errCode){
            case 0:{
                // ï»¿å…è®¸ï»¿æŽˆæƒ
                NSLog(@"微信授权成功:%@",authResp.code);
                [SVProgressHUD showWithStatus:@"登陆中"];
                [[YTHNetInterface startInterface] loginWithWX:[YTHsharedManger startManger].Uid WithSystem:@"1" WithCode:authResp.code withBlock:^(BOOL isSuccessful, id result, NSString *error) {
                    if (isSuccessful) {
                        NSString *err=[NSString stringWithFormat:@"%@",[result objectForKey:@"Error"]];
                        if ([[NSString stringWithFormat:@"%@",[result objectForKey:@"IsPost"]] isEqualToString:@"true"]) {
                            [SVProgressHUD dismiss];
                            //LoginUid
                            [[NSUserDefaults standardUserDefaults] setObject:[[result objectForKey:@"Data"] objectForKey:@"Id"] forKey:@"LoginUid"];
                            [[NSUserDefaults standardUserDefaults] setObject:[[result objectForKey:@"Data"] objectForKey:@"Nickname"] forKey:@"QQUserName"];
                            [[NSUserDefaults standardUserDefaults] setObject:[[result objectForKey:@"Data"] objectForKey:@"Portrait"] forKey:@"iconURL"];
                            [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"userOnLine"];
                            [self fetchNewInfo];
                        }else{
                            //登录失败
                            [SVProgressHUD showErrorWithStatus:err];
//                            PasswordNumber.text=@"";
                        }
                    }else{
                        [SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"网络请求失败,请稍后再试"]];
                    }
                }];
            }
                break;
            case -4:
                //拒绝授权
                break;
            case -2:
                // ï»¿å–消授权
                break;
        }
    }
}
// QQ登录回调
- (void)tencentDidLogin{
    //QQ登录成功
    NSString *acessToken = tencentOAuth.accessToken;
    NSString *openId =  tencentOAuth.openId;
    NSLog(@"登录成功:accessToken - ï»¿%@    ï»¿openId - ï»¿%@",acessToken,openId);
    [SVProgressHUD showWithStatus:@"登陆中"];
    [[YTHNetInterface startInterface] loginWithQQ:[YTHsharedManger startManger].Uid WithSystem:@"1" WithAcessToken:acessToken WithOpenid:openId withBlock:^(BOOL isSuccessful, id result, NSString *error) {
        if (isSuccessful) {
            NSString *err=[NSString stringWithFormat:@"%@",[result objectForKey:@"Error"]];
            if ([[NSString stringWithFormat:@"%@",[result objectForKey:@"IsPost"]] isEqualToString:@"true"]) {
                [SVProgressHUD dismiss];
                //LoginUid
                [[NSUserDefaults standardUserDefaults] setObject:[[result objectForKey:@"Data"] objectForKey:@"Id"] forKey:@"LoginUid"];
                [[NSUserDefaults standardUserDefaults] setObject:[[result objectForKey:@"Data"] objectForKey:@"Nickname"] forKey:@"QQUserName"];
                [[NSUserDefaults standardUserDefaults] setObject:[[result objectForKey:@"Data"] objectForKey:@"Portrait"] forKey:@"iconURL"];
                [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"userOnLine"];
                [self fetchNewInfo];
            }else{
                //登录失败
                [SVProgressHUD showErrorWithStatus:err];
            }
        }else{
            [SVProgressHUD showErrorWithStatus:[NSString stringWithFormat:@"网络请求失败,请稍后再试"]];
        }
    }];
}
- (void)tencentDidNotLogin:(BOOL)cancelled{
    if (cancelled){
         NSLog(@"用户取消登录");
     }
     else{
         NSLog(@"登录失败");
     }
}
-(void)tencentDidNotNetWork
{
   NSLog(@"无网络连接,请设置网络");
}
@end
BuWanVideo2.0/LookNoteController.m
@@ -95,6 +95,8 @@
    //选中状态
    [deleBtn setTitle:@"取消" forState:UIControlStateSelected];
    
    [deleBtn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
    deleBtn.titleLabel.font = [UIFont systemFontOfSize:15];
    deleBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
    [deleBtn addTarget:self action:@selector(deletebutton:) forControlEvents:UIControlEventTouchUpInside];
@@ -121,10 +123,11 @@
 */
-(void)CreateOperatingView{
    CGFloat height = 40;
    if (KIsiPhoneX) {
        height = 60;
    }
    allSelAndDelView = [[UIView alloc]initWithFrame:CGRectMake(0, KScreenH-height, KScreenW, 40)];
//    if (KIsiPhoneX) {
//        height = 60;
//    }
    allSelAndDelView = [[UIView alloc]initWithFrame:CGRectMake(0, KScreenH-height - kNavigationBarH -kStatusBarH, KScreenW, 40)];
    //allSelAndDelView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, 40)];
    allSelAndDelView.hidden = YES;
    allSelAndDelView.backgroundColor = [UIColor whiteColor];
    
@@ -287,7 +290,10 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    NoteCell * cell = [tableView dequeueReusableCellWithIdentifier:@"NoteCell"];
    cell.backgroundColor = kGlobalBackgroundColor;
    UIView *selectedBackgroundView = [[UIView alloc] initWithFrame:cell.bounds];
    selectedBackgroundView.backgroundColor = [UIColor whiteColor];
    cell.selectedBackgroundView = selectedBackgroundView;
    cell.backgroundColor = [UIColor whiteColor];
    NSMutableDictionary * dic = [historyListDataArray objectAtIndex:indexPath.row];
    NSString *str = (NSString*)[dic objectForKey:@"Name"];
    if ( [self autoHeiWithHeight:str WithWidth:cell.name.frame.size.width]){
BuWanVideo2.0/MyRegardController.m
@@ -170,6 +170,8 @@
    }
    cell.Timeupdate.text = time;
    
    cell.backgroundColor = [UIColor whiteColor];
    //图片
    [cell.image setYthImageWithURL:[dic objectForKey:@"Hpicture"] placeholderImage:[UIImage imageNamed:@"默认加载图片"]];
    
BuWanVideo2.0/PPTVController.m
@@ -17,6 +17,7 @@
#import "dsbridge.h"
#import "JSAPI.h"
#import "AppDelegate.h"
#import <BUAdSDK/BUAdSDK.h>
@interface PPTVController () <WKNavigationDelegate, WKUIDelegate, PPTVDelegate, BUNativeExpressFullscreenVideoAdDelegate>
@@ -273,7 +274,7 @@
}
- (void)login {
    LoggingViewController *loginVC=[[LoggingViewController alloc] init];
    LoggingViewController *loginVC = ((AppDelegate*)[UIApplication sharedApplication].delegate).loggingViewController;
    loginVC.backNotRoot = YES;
    [self.navigationController pushViewController:loginVC animated:YES];
}
BuWanVideo2.0/Personal_informationViewController.m
@@ -285,6 +285,15 @@
            [self presentViewController:PickerImage animated:YES completion:nil];
        }]];
        [alert addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
        if (alert.popoverPresentationController) {
            UITableViewCell *cell =   [_tableView cellForRowAtIndexPath:indexPath];
            // è¿™é‡Œå‡è®¾ä»¥å½“前视图的中心作为弹出框的显示位置
            alert.popoverPresentationController.sourceView = cell.contentView;
            alert.popoverPresentationController.sourceRect = CGRectMake(cell.contentView.bounds.size.width / 2.0, cell.contentView.bounds.size.height / 1.0, 1.0, 1.0);
        }
        [self presentViewController:alert animated:YES completion:nil];
        
    }else if (indexPath.section==1){
@@ -386,6 +395,16 @@
            }];
            [modifySexnameAlert addAction:cancel];
            
            if (modifySexnameAlert.popoverPresentationController) {
                // è¿™é‡Œå‡è®¾ä»¥å½“前视图的中心作为弹出框的显示位置
                UITableViewCell *cell =   [_tableView cellForRowAtIndexPath:indexPath];
                // è¿™é‡Œå‡è®¾ä»¥å½“前视图的中心作为弹出框的显示位置
                modifySexnameAlert.popoverPresentationController.sourceView = cell.contentView;
                modifySexnameAlert.popoverPresentationController.sourceRect = CGRectMake(cell.contentView.bounds.size.width / 2.0, 0, 1.0, 1.0);
            }
            [self presentViewController:modifySexnameAlert animated:YES completion:^{
                
            }];
BuWanVideo2.0/PrivacyInfo.xcprivacy
New file
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>NSPrivacyCollectedDataTypes</key>
        <array/>
        <key>NSPrivacyAccessedAPITypes</key>
        <array>
                <dict>
                        <key>NSPrivacyAccessedAPIType</key>
                        <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
                        <key>NSPrivacyAccessedAPITypeReasons</key>
                        <array>
                                <string>C617.1</string>
                 <string>我们需要访问文件时间戳以便管理和同步用户的数据,确保应用功能的准确性和一致性。</string>
                        </array>
                </dict>
                <dict>
                        <key>NSPrivacyAccessedAPIType</key>
                        <string>NSPrivacyAccessedAPICategorySystemBootTime</string>
                        <key>NSPrivacyAccessedAPITypeReasons</key>
                        <array>
                                <string>35F9.1</string>
                 <string>我们需要访问系统启动时间以确保应用在启动时能够执行特定初始化任务,并优化用户体验。</string>
                        </array>
                </dict>
                <dict>
                        <key>NSPrivacyAccessedAPIType</key>
                        <string>NSPrivacyAccessedAPICategoryDiskSpace</string>
                        <key>NSPrivacyAccessedAPITypeReasons</key>
                        <array>
                                <string>7D9E.1</string>
                                <string>E174.1</string>
                <string>我们需要访问磁盘空间以便为用户缓存视频内容,从而提高播放性能和用户体验。</string>
                        </array>
                </dict>
                <dict>
                        <key>NSPrivacyAccessedAPIType</key>
                        <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
                        <key>NSPrivacyAccessedAPITypeReasons</key>
                        <array>
                                <string>CA92.1</string>
                                <string>我们使用 UserDefaults æ¥å­˜å‚¨ç”¨æˆ·çš„偏好设置和应用状态,以便用户下次使用应用时可以快速恢复到之前的状态。</string>
                        </array>
                </dict>
        </array>
</dict>
</plist>
BuWanVideo2.0/Recommend/Recommend/Cell/RecpmmendTitleView.m
@@ -184,6 +184,7 @@
        _labelTitle = [[UILabel alloc] init];
        _labelTitle.font = [UIFont systemFontOfSize:16];
        _labelTitle.textAlignment = NSTextAlignmentLeft;
        _labelTitle.textColor = [UIColor blackColor];
    }
    return _labelTitle;;
}
BuWanVideo2.0/Recommend/Recommend/RecommendController.m
@@ -31,6 +31,7 @@
const int CELL_TYPE_COMMON = 1;
const int CELL_TYPE_VIDEO_CARD = 2;
const int CELL_TYPE_AD = 3;
const float AD_SIZE_RATE = 0.72;
@interface RecommendController () <UICollectionViewDelegate, UICollectionViewDataSource, RecommendDelegate,LCDVideoCardProviderDelegate,BUMNativeAdsManagerDelegate,BUNativeAdDelegate>
@@ -484,6 +485,7 @@
    }else if (cell_type == CELL_TYPE_AD) {
        if (!self.cellRecommendAd) {
            self.cellRecommendAd = [collectionView dequeueReusableCellWithReuseIdentifier:@"RecommendAdView" forIndexPath:indexPath];
//            self.cellRecommendAd.frame = CGRectMake(self.cellRecommendAd.frame.origin.x, self.cellRecommendAd.frame.origin.y, KScreenW, KScreenW*AD_SIZE_RATE);
            self.cellRecommendAd.delegate = self;
        }
        // æ˜¾ç¤ºå¹¿å‘Šæ•°æ®
@@ -651,7 +653,7 @@
    } else  if (cell_type ==CELL_TYPE_VIDEO_CARD) {
        return  CGSizeMake(KScreenW, KScreenW/2.4 * 1.4);
    }else  if (cell_type ==CELL_TYPE_AD) {
            return  CGSizeMake(KScreenW, KScreenW*0.6);
        return  CGSizeMake(KScreenW, KScreenW*AD_SIZE_RATE);
    }
    else {
        if(self.arrayContent!=nil&&self.arrayContent.count>0){
@@ -806,13 +808,18 @@
}
- (void) loadAd{
    id other=[YTHsharedManger startManger].ad[@"other"];
    if(other==nil|| other==[NSNull null] ||other[@"type"]==nil){
        return;
    }
    if (self.adManager) {
            // é”€æ¯ä¸Šæ¬¡å¹¿å‘Šå¯¹è±¡ èšåˆç»´åº¦æ–¹æ³•
            [self.adManager.mediation destory];
    }
    BUAdSlot *slot = [[BUAdSlot alloc] init];
    slot.ID = @"102509315"; // èšåˆç»´åº¦é€šè¿‡å¹¿å‘Šä½ID发起请求,仅接入CSJ广告通过代码位ID发起请求
    slot.adSize = CGSizeMake(KScreenW-9*2, (KScreenW-9*2)*0.6); // æŒ‰ç…§å®žé™…情况设置广告尺寸
    slot.ID = CSJ_AD_PID_HOME_DRAW; // èšåˆç»´åº¦é€šè¿‡å¹¿å‘Šä½ID发起请求,仅接入CSJ广告通过代码位ID发起请求
    slot.adSize = CGSizeMake(KScreenW-9*2, (KScreenW-9*2)*AD_SIZE_RATE); // æŒ‰ç…§å®žé™…情况设置广告尺寸
    slot.mediation.mutedIfCan = YES; // é™éŸ³ ï¼ˆèšåˆåŠŸèƒ½ï¼‰
    BUNativeAdsManager *adManager = [[BUNativeAdsManager alloc] initWithSlot:slot];
    self.adManager = adManager;
BuWanVideo2.0/Recommend/RecommendMainController.m
@@ -13,6 +13,7 @@
#import <BUAdSDK/BUAdSDK.h>
#import "DYGridVideoController.h"
#import "UIView+Toast.h"
#import "AppDelegate.h"
@interface RecommendMainController () <ZJScrollPageViewDelegate,BUNativeExpressFullscreenVideoAdDelegate>
@@ -26,6 +27,8 @@
@property (nonatomic, strong)BUNativeExpressFullscreenVideoAd *fullscreenAd;
@end
@implementation RecommendMainController
@@ -62,16 +65,39 @@
}
-(void) requestVideoClass:(YthNetWorkBlock)block count:(int) count{
    //NSLog(@"测试:请求网络第%d次",count);
    [[YTHNetInterface startInterface] getVideoClassWithUid:[YTHsharedManger startManger].Uid WithSystem:@"1" withBlock:^(BOOL isSuccessful, id result, NSString *error) {
        if (isSuccessful) {
            block(isSuccessful,result,error);
        } else{
            if(count > 3){
                block(isSuccessful,result,@"请求出错3次");
            }else{
                [self requestVideoClass:block count:count+1];
            }
        }
    }];
}
-(void)loadDataFromFile {
    //NSLog(@"测试:loadDataFromFile");
    if (_isRequest) {
        return;
    }
    self.isRequest = YES;
    //NSLog(@"测试:请求网络数据-%@",[NSDate date]);
    [[YTHNetInterface startInterface]cancelAll];
    
    
    [[YTHNetInterface startInterface] getVideoClassWithUid:[YTHsharedManger startManger].Uid WithSystem:@"1" withBlock:^(BOOL isSuccessful, id result, NSString *error) {
    [self requestVideoClass:^(BOOL isSuccessful, id result, NSString *error) {
        if (isSuccessful) {
           // NSLog(@"测试:网络请求成功");
            [self.arrayClassName removeAllObjects];
            [self.arrayKeyName removeAllObjects];
            for (int i = 0; i < [result[@"Data"][@"data"] count]; i++) {
@@ -82,20 +108,18 @@
//                    [self.arrayKeyName addObject:@{@"Id":@123,@"DataType":@"gridVideo"}];
//                }
            }
            self.primtView.hidden = YES;
            [self setupViewConfig];
            self.isRequest = NO;
        } else{
            //NSLog(@"测试:网络请求失败-%@",[NSDate date]);
            //NSLog(@"测试:%@",error);
            if ([error compare:@"似乎已断开与互联网的连接。"] == 0) {
                [self notHaveNetWork];
            }
            self.isRequest = NO;
        }
    }];
    } count:0];
}
#pragma mark æ·»åŠ ç½‘ç»œç›‘æµ‹
@@ -110,6 +134,7 @@
- (void) reachabilityChang: (NSNotification*)note {
    switch ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus) {
        case AFNetworkReachabilityStatusNotReachable:{//无网
            //NSLog(@"测试:无网络");
            [YTHsharedManger startManger].NetworkStatus = 0;
            
            if (self.arrayClassName.count == 0) {
@@ -121,6 +146,7 @@
        }
            break;
        case AFNetworkReachabilityStatusReachableViaWWAN:{//万维网
            //NSLog(@"测试:万维网");
            [YTHsharedManger startManger].NetworkStatus = 1;
            
            if (self.arrayClassName.count == 0) {
@@ -129,6 +155,7 @@
        }
            break;
        case AFNetworkReachabilityStatusReachableViaWiFi:{// ä½¿ç”¨WiFi网络
            //NSLog(@"测试:WiFi网络");
            [YTHsharedManger startManger].NetworkStatus = 2;
            
            if (self.arrayClassName.count == 0) {
@@ -137,6 +164,7 @@
        }
            break;
        case AFNetworkReachabilityStatusUnknown:{// å½“前网络未知
            //NSLog(@"测试:网络未知");
            [YTHsharedManger startManger].NetworkStatus = 3;
            
        }
@@ -145,6 +173,7 @@
}
- (void)notHaveNetWork {
    //NSLog(@"测试:notHaveNetWork");
    self.primtView.hidden = NO;
}
@@ -242,7 +271,7 @@
    
    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(imageview.frame), KScreenW , 30)];
    label.textColor = SJColor(98, 98, 98, 1);
    label.text = @"无法连接到网络...";
    label.text = @"数据加载失败";
    label.font = [UIFont boldSystemFontOfSize:18];
    label.textAlignment = NSTextAlignmentCenter;
    [_primtView addSubview:label];
@@ -250,7 +279,7 @@
    button.frame = CGRectMake((KScreenW - KScreenW / 3) / 2, CGRectGetMaxY(label.frame) + 15, KScreenW / 3, 30);
    button.backgroundColor = SJColor(25, 169, 249, 1);
    button.titleLabel.font = [UIFont systemFontOfSize:16];
    [button setTitle:@"重新加载" forState:UIControlStateNormal];
    [button setTitle:@"点击重试" forState:UIControlStateNormal];
    button.layer.cornerRadius = 5;
    button.layer.masksToBounds = YES;
    [button addTarget:self action:@selector(refreshTaped:) forControlEvents:UIControlEventTouchUpInside];
@@ -268,19 +297,26 @@
        //[self.view makeToast:@"首页插屏广告被屏蔽"];
        return;
    }
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        //[self.view makeToast:@"开始加载插屏广告"];
        NSLog(@"广告开始加载-首页插屏");
        self.fullscreenAd = [[BUNativeExpressFullscreenVideoAd alloc] initWithSlotID:@"947698171"];
        self.fullscreenAd = [[BUNativeExpressFullscreenVideoAd alloc] initWithSlotID:CSJ_AD_PID_HOME_INTERSTITIAL];
        self.fullscreenAd.delegate = self;
        [self.fullscreenAd loadAdData];
        
    });
    
    // ï»¿ï»¿ï»¿é¢„加载搜索页广告
    if(ApplicationDelegate.searchAdManager){
        if(ApplicationDelegate.searchAdManager.buNativeAd==nil){
            [ApplicationDelegate.searchAdManager preLoadSearchAd];
        }
    }
}
//此方法在视频广告素材加载成功时调用。
- (void)nativeExpressFullscreenVideoAdDidLoad:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd {
@@ -289,7 +325,10 @@
//当视频广告素材加载失败时调用此方法。
- (void)nativeExpressFullscreenVideoAd:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error {
    NSLog(@"nativeExpressFullscreenVideoAd");
    if(error!=nil&&error.code == 20001){
        NSLog(@"穿山甲首页插屏加载失败,需要加载海外广告:%@",error);
    }
    NSLog(@"nativeExpressFullscreenVideoAd:%@",error);
    //[self.view makeToast:@"插屏广告加载失败"];
}
BuWanVideo2.0/RegisteViewController.m
@@ -12,6 +12,8 @@
    UITextField * FillInTheAccountNumber;
    UITextField * FillInThePassWord;
    UITextField * FillInTheVerificationCode;
    UIImageView *showPassWordSwitch;
    UIButton * agreeBtn;
    UIButton * registerBtn;
    UIButton * VerificationCode;
@@ -21,6 +23,21 @@
@end
@implementation RegisteViewController
- (IBAction)changePwdShow: (UITapGestureRecognizer *)gesture{
    if(showPassWordSwitch.tag == 0){
        [showPassWordSwitch setImage:[UIImage imageNamed:@"icon_password_show"]];
        showPassWordSwitch.tag = 1;
        FillInThePassWord.secureTextEntry = NO;
    }else{
        [showPassWordSwitch setImage:[UIImage imageNamed:@"icon_password_hidden"]];
        showPassWordSwitch.tag = 0;
        FillInThePassWord.secureTextEntry = YES;
    }
}
- (void)viewDidLoad {
    [super viewDidLoad];
@@ -63,6 +80,9 @@
    FillInTheAccountNumber=[[UITextField alloc] init];
    //填写密码
    FillInThePassWord=[[UITextField alloc] init];
    showPassWordSwitch = [[UIImageView alloc] init];
    //验证码框
    FillInTheVerificationCode=[[UITextField alloc] init];
    //获取验证码的按钮
@@ -82,6 +102,8 @@
        FillInTheAccountNumber.frame=CGRectMake(50, 120+(KScreenW-120)/394*171, KScreenW-100, 35);
        //填写密码
        FillInThePassWord.frame=CGRectMake(50, 178+(KScreenW-120)/394*171, KScreenW-100, 35);
        showPassWordSwitch.frame=CGRectMake(KScreenW-80, 178+(KScreenW-120)/394*171 + 10, 20, 15);
        //验证码框
        FillInTheVerificationCode.frame=CGRectMake(50, 236+(KScreenW-120)/394*171, 100, 35);
        //获取验证码的按钮
@@ -95,6 +117,8 @@
        FillInTheAccountNumber.frame=CGRectMake(50, 120, KScreenW-100, 35);
        //填写密码
        FillInThePassWord.frame=CGRectMake(50, 178, KScreenW-100, 35);
        showPassWordSwitch.frame=CGRectMake(KScreenW-80, 178 + 10, 20, 15);
        //验证码框
        FillInTheVerificationCode.frame=CGRectMake(50, 236, 100, 35);
        //获取验证码的按钮
@@ -129,9 +153,21 @@
    FillInThePassWord.placeholder=[NSString stringWithFormat:@"请输入密码"];
    FillInThePassWord.autocorrectionType=UITextAutocorrectionTypeNo;
    FillInThePassWord.autocapitalizationType=UITextAutocapitalizationTypeNone;
    FillInThePassWord.secureTextEntry = YES;
    // åˆå§‹åŒ–密码显示图片
    [showPassWordSwitch setImage:[UIImage imageNamed:@"icon_password_hidden"]];
    showPassWordSwitch.tag = 0;
    showPassWordSwitch.userInteractionEnabled = YES;
    // æ·»åŠ ç‚¹å‡»äº‹ä»¶
    UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(changePwdShow:)];
    [showPassWordSwitch addGestureRecognizer:singleTap];
    //前面空一个间距
    [self setTextFieldLeftPadding:FillInThePassWord forWidth:10.0];
    [self.view addSubview:FillInThePassWord];
    [self.view addSubview:showPassWordSwitch];
    
    //验证码框
    [FillInTheVerificationCode.layer setMasksToBounds:YES];
@@ -225,7 +261,7 @@
-(void)startTime:(UIButton *)sender{
   
    if ([Share isEmailAddress:FillInTheAccountNumber.text]){
        if (![FillInTheAccountNumber.text containsString:@"@qq.com"] ) {
        if (![FillInTheAccountNumber.text containsString:@"@qq.com"] &&FALSE) {
            [Share ShakeView:FillInTheAccountNumber WithInfomation:@"请使用QQ邮箱注册"];
        }else
            {
@@ -276,7 +312,7 @@
    }
  else{
        //邮箱格式不正确
        [Share ShakeView:FillInTheAccountNumber WithInfomation:@"请使用QQ邮箱注册"];
        [Share ShakeView:FillInTheAccountNumber WithInfomation:@"邮箱格式不正确"];
    }
}
BuWanVideo2.0/SDK_Setting_5096047.json
@@ -1,54 +1,73 @@
{
    "init": {
        "site_id": "5096047",
        "app_id": "300976",
        "partner": "pangle_300976",
        "secure_key": "ddf9a5e28cb24b2540a60b2990cd8a20"
    },
    "feed": {
        "news_list_ad_code_id": "947237101",
        "news_first_ad_code_id": "947237102",
        "news_second_ad_code_id": "947237090",
        "video_first_ad_code_id": "",
        "video_second_ad_code_id": "947237093",
        "related_ad_code_id": "947237099",
        "news_draw_ad_code_id": "947237104",
        "news_draw_native_ad_code_id": "947237091",
        "news_outer_list_ad_code_id": "947237110",
        "news_outer_first_ad_code_id": "947237107",
        "news_outer_second_ad_code_id": "947237111",
        "outer_video_second_ad_code_id": "947237085",
        "outer_related_ad_code_id": "947237095",
        "news_outer_draw_ad_code_id": "947237112",
        "news_outer_draw_native_ad_code_id": "947237096",
        "news_interstitial_code_id": "947237105"
    },
    "small_video": {
        "draw_ad_code_id": "947237092",
        "draw_native_ad_code_id": "947237086",
        "grid_ad_code_id": "947237082",
        "grid_draw_ad_code_id": "947237114",
        "grid_draw_native_ad_code_id": "947237080",
        "video_card_ad_code_id": "947237098",
        "video_card_draw_ad_code_id": "947237109",
        "video_card_draw_native_ad_code_id": "947237089",
        "interstitial_ad_code_id": "947237087",
        "interstitial_note_ad_code_id": "947237088",
        "staggered_grid_ad_code_id": "947237083",
        "staggered_grid_draw_ad_code_id": "947237092",
        "staggered_grid_draw_native_ad_code_id": "947237086",
        "draw_interstitial_ad_code_id": "947592757",
        "draw_fullscreen_interstitial_ad_code_id": "947592756",
        "draw_banner_code_id": "947592759"
    },
    "novel": {
        "status": 1,
        "pre_ad_code_id": "947236550",
        "mid_ad_code_id": "947236546",
        "exciting_ad_code_id": "947236552",
        "interstitial_code_id": "947236559",
        "banner_ad_code_id": "947236561",
        "end_ad_code_id": "947236562"
    },
    "live": null
}
    "init": {
        "site_id": "5096047",
        "app_id": "300976",
        "partner": "pangle_300976",
        "secure_key": "ddf9a5e28cb24b2540a60b2990cd8a20",
        "secure_key_d": "a6958cee3ecb314361f00e4c1675a539"
    },
    "feed": {
        "news_list_ad_code_id": "947237101",
        "news_first_ad_code_id": "947237102",
        "news_second_ad_code_id": "947237090",
        "video_first_ad_code_id": "",
        "video_second_ad_code_id": "947237093",
        "related_ad_code_id": "947237099",
        "news_draw_ad_code_id": "947237104",
        "news_draw_native_ad_code_id": "947237091",
        "news_outer_list_ad_code_id": "947237110",
        "news_outer_first_ad_code_id": "947237107",
        "news_outer_second_ad_code_id": "947237111",
        "outer_video_second_ad_code_id": "947237085",
        "outer_related_ad_code_id": "947237095",
        "news_outer_draw_ad_code_id": "947237112",
        "news_outer_draw_native_ad_code_id": "947237096",
        "news_interstitial_code_id": "947237105"
    },
    "small_video": {
        "draw_ad_code_id": "947237092",
        "draw_native_ad_code_id": "947237086",
        "grid_ad_code_id": "947237082",
        "grid_draw_ad_code_id": "947237114",
        "grid_draw_native_ad_code_id": "947237080",
        "video_card_ad_code_id": "947237098",
        "video_card_draw_ad_code_id": "947237109",
        "video_card_draw_native_ad_code_id": "947237089",
        "interstitial_ad_code_id": "947237087",
        "interstitial_note_ad_code_id": "947237088",
        "staggered_grid_ad_code_id": "947237083",
        "staggered_grid_draw_ad_code_id": "947237092",
        "staggered_grid_draw_native_ad_code_id": "947237086",
        "draw_interstitial_ad_code_id": "947592757",
        "draw_fullscreen_interstitial_ad_code_id": "947592756",
        "draw_banner_code_id": "947592759",
        "drama_rewarded_ad_code_id": "952310731",
        "drama_rewarded_ad_code_id_02": "952310730",
        "drama_draw_ad_code_id": "952310732",
        "staggered_grid_ad_code_id_02": "961663479"
    },
    "novel": {
        "status": 1,
        "pre_ad_code_id": "947236550",
        "mid_ad_code_id": "947236546",
        "exciting_ad_code_id": "947236552",
        "interstitial_code_id": "947236559",
        "banner_ad_code_id": "947236561",
        "end_ad_code_id": "947236562"
    },
    "live": null,
    "license_config": [
        {
            "PackageName": "com.yeshi.buwanshequ.ios",
            "BundleId": "com.yeshi.buwanshequ.ios",
            "StartTime": "20241126T085743Z",
            "ExpireTime": "20261126T085743Z",
            "CreatedTime": "20241126T085742Z",
            "Signature": "lUqaILYn5v3gF4iiOP0RUjeN7dhqy1L2Ba/SO2Fcj8GBFHy9lG+8R1XyzCOQHQw99wikR4Q+Gj8XOuvSROhC2I/UKKwfq1m4WNRcZirJtFD7SPyDP4pTRJ1GQ8XX6L9Gzx26PsaCtaiQ0WRHRzll7QgKh9+ShFnD+O44ksGLxPeWPS91ciev3nyvBzR4qS+OW/d5OcfEjsSRhgndj3r1Mg5y4w1aQt1jwQv0Cdtj5Tl4osvr0UgcuXU8UL1DYkJ5Ybh5+t4XSACBcpFH7Lo3cRNx4GeMG9xK2AghfEYlO07vbxM9XFHO6ueuyc8H7za8dIM1jMAxil5rWb6LaO85dQ==",
            "Content": "eyJJZCI6IjYxMzIwMTE1NCIsICJWZXJzaW9uIjoyLCAiQ2hhbm5lbCI6ImFkX2NzaiIsICJUeXBlIjoyLCAiUGFja2FnZU5hbWUiOiJjb20ueWVzaGkuYnV3YW5zaGVxdS5pb3MiLCAiQnVuZGxlSWQiOiJjb20ueWVzaGkuYnV3YW5zaGVxdS5pb3MiLCAiTW9kdWxlcyI6W3siTmFtZSI6InZvZF9wbGF5IiwgIkVkaXRpb24iOiJwcmVtaXVtX2VkaXRpb24iLCAiU3RhcnRUaW1lIjoxNzMyNjExNDYyODIyLCAiRXhwaXJlVGltZSI6MTc5NTY4MzQ2MjgyMiwgIkV4cGlyZUJ1ZmZlciI6MTU1NTIwMDAwMDB9XSwgIkZpbGVWZXJzaW9uIjoiMTczMjYxMTQ2Mjg0NTE1NjU5OSJ9",
            "MainURL": "https://vod-license-m.volccdn.com/vod-license/l-613201154-ch-ad_csj-a-300976.lic?lk3s=0d9f7a7d\u0026x-expires=4886211462\u0026x-signature=YT6dftRcSwk8oQzmoViuO%2BpJtcI%3D",
            "BackupURL": "https://vod-license-b.volccdn.com/vod-license/l-613201154-ch-ad_csj-a-300976.lic?lk3s=0d9f7a7d\u0026x-expires=4886211462\u0026x-signature=VU8QklZwuLPACj%2BYuV2%2FbitzIb4%3D",
            "Id": "613201154"
        }
    ]
}
BuWanVideo2.0/SearchController.m
@@ -20,8 +20,9 @@
#import "UICollectionViewLeftAlignedLayout.h"
#import "GDTNativeExpressAd.h"
#import "GDTNativeExpressAdView.h"
#import <BUAdSDK/BUAdSDK.h>
@interface SearchController () <UICollectionViewDelegate, UICollectionViewDataSource, SearchDelegate, UITableViewDelegate, UITableViewDataSource,GDTNativeExpressAdDelegete>
@interface SearchController () <UICollectionViewDelegate, UICollectionViewDataSource, SearchDelegate, UITableViewDelegate, UITableViewDataSource,GDTNativeExpressAdDelegete, BUMNativeAdsManagerDelegate, BUNativeAdDelegate>
@property (nonatomic, strong) SearchNavView *viewSearchNav;
@property (nonatomic, nullable, strong) UICollectionView *collectionView;
@@ -34,6 +35,12 @@
@property (nonatomic, nullable, strong) NSMutableArray *arraySearch;
@property (nonatomic, strong) GDTNativeExpressAd *nativeExpressAd;
@property (nonatomic) BUNativeAdsManager *adManager;
@property (nonatomic, strong) BUNativeAd *buNativeAd;
@end
@implementation SearchController
@@ -50,7 +57,9 @@
- (void)dealloc
{
    if( ApplicationDelegate&&ApplicationDelegate.searchAdManager){
        ApplicationDelegate.searchAdManager.buNativeAd=nil;
    }
}
- (void)viewDidLoad {
@@ -67,6 +76,9 @@
- (void)loadData {
    [SVProgressHUD show];
    dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
    
    // åˆ›å»ºå…¨å±€å¹¶è¡Œ
@@ -110,8 +122,7 @@
            [self.collectionView reloadData];
        });
    });
    [self loadAd];
    [self loadCSJAd];
}
- (void)setupViewConfig {
@@ -178,6 +189,33 @@
    [self.nativeExpressAd loadAd:1];
}
-(void) loadCSJAd{
    id search=[YTHsharedManger startManger].ad[@"videoSearch"];
    if(search==nil|| search==[NSNull null] ||search[@"type"]==nil){
        return;
    }
    if(ApplicationDelegate.searchAdManager!=nil&&ApplicationDelegate.searchAdManager.buNativeAd!=nil){
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
            dispatch_async(dispatch_get_main_queue(), ^{
                self.buNativeAd = ApplicationDelegate.searchAdManager.buNativeAd;
                [self showCSJAd:self.buNativeAd];
            });
        });
    }else{
        BUAdSlot *slot = [[BUAdSlot alloc] init];
        slot.ID = CSJ_AD_PID_SEARCH; // èšåˆç»´åº¦é€šè¿‡å¹¿å‘Šä½ID发起请求,仅接入CSJ广告通过代码位ID发起请求
        slot.adSize = CGSizeMake(KScreenW-9*2, (KScreenW-9*2)*0.6); // æŒ‰ç…§å®žé™…情况设置广告尺寸
        slot.mediation.mutedIfCan = YES; // é™éŸ³ ï¼ˆèšåˆåŠŸèƒ½ï¼‰
        BUNativeAdsManager *adManager = [[BUNativeAdsManager alloc] initWithSlot:slot];
        self.adManager = adManager;
        self.adManager.mediation.rootViewController = self;
        self.adManager.delegate = self;
        [self.adManager loadAdDataWithCount:1]; // åŠ è½½å¹¿å‘Šæ•°é‡ï¼Œæ”¯æŒ1~3个
        NSLog(@"搜索页广告开始请求:%.0f", [[NSDate date] timeIntervalSince1970] * 1000);
    }
}
- (void)nativeExpressAdSuccessToLoad:(GDTNativeExpressAd
                                      *)nativeExpressAd views:(NSArray<__kindof
                                                               GDTNativeExpressAdView *> *)views
@@ -208,6 +246,89 @@
    
}
- (void) showCSJAd:(BUNativeAd*) model{
    model.rootViewController = self;
    model.delegate = self;
    if (model.mediation.isExpressAd) {
        [model.mediation render];
    }
    if(model.mediation.canvasView){
        NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:3];
        UICollectionViewCell *cell = (UICollectionViewCell *)[self.collectionView cellForItemAtIndexPath:indexPath];
        if(cell!=nil){
            // delete origin ad view
            for(UIView *subview in cell.subviews){
                [subview removeFromSuperview];
            }
            cell.sd_layout.leftSpaceToView(self, 10);
            [cell addSubview:model.mediation.canvasView];
            // å¹¿å‘Šä½ render åŽåˆ·æ–° tableView
            [self.collectionView reloadData];
        }
    }
}
- (void)nativeAdsManagerSuccessToLoad:(BUNativeAdsManager *)adsManager nativeAds:(NSArray<BUNativeAd *> *)nativeAdDataArray{
    NSLog(@"搜索页广告请求成功:%.0f", [[NSDate date] timeIntervalSince1970] * 1000);
    for (BUNativeAd *model in nativeAdDataArray) {
        self.buNativeAd = model;
        [self showCSJAd:self.buNativeAd];
        break;
    }
}
- (void)nativeAdsManager:(BUNativeAdsManager *)adsManager didFailWithError:(NSError *)error{
    NSLog(@"搜索页CSJ广告加载失败:%@", error.userInfo.description);
    [self loadAd];
}
- (void)nativeAdDidLoad:(BUNativeAd *)nativeAd{
}
- (void)nativeAdDidLoad:(BUNativeAd *)nativeAd view:(UIView *_Nullable)view{
}
- (void)nativeAd:(BUNativeAd *)nativeAd didFailWithError:(NSError *_Nullable)error{
}
- (void)nativeAdDidBecomeVisible:(BUNativeAd *)nativeAd{
}
- (void)nativeAdDidCloseOtherController:(BUNativeAd *)nativeAd interactionType:(BUInteractionType)interactionType{
    if( ApplicationDelegate&&ApplicationDelegate.searchAdManager){
        ApplicationDelegate.searchAdManager.buNativeAd=nil;
    }
    [self loadCSJAd];
}
- (void)nativeAdDidClick:(BUNativeAd *)nativeAd withView:(UIView *_Nullable)view{
}
- (void)nativeAd:(BUNativeAd *_Nullable)nativeAd dislikeWithReason:(NSArray<BUDislikeWords *> *_Nullable)filterWords{
    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:3];
    UICollectionViewCell *cell = (UICollectionViewCell *)[self.collectionView cellForItemAtIndexPath:indexPath];
    for(UIView *subview in cell.subviews){
        [subview removeFromSuperview];
    }
}
#pragma mark ---------- SearchDelegate ---------
- (void)hotSearchEvent:(NSString *)name {
    [self writeSearchKey:name];
BuWanVideo2.0/SettingWebView.m
@@ -30,6 +30,9 @@
    button.frame = CGRectMake(0, 0, 32, 32);
    UIBarButtonItem *iconBarItem=[[UIBarButtonItem alloc] initWithCustomView:button];
    self.navigationItem.leftBarButtonItem = iconBarItem;
    self.navigationController.navigationBar.barTintColor = [UIColor whiteColor];
    //设置使用模态跳转的返回按钮
    if(_ispresent){
        //隐藏状态栏
BuWanVideo2.0/Share.h
@@ -27,6 +27,16 @@
 */
+(BOOL)isEmailAddress:(NSString*)candidate;
/**
 åˆ¤æ–­æ˜¯å¦æ˜¯ï»¿ç”µè¯ï»¿å·ç 
 @param candidate ä¼ å…¥éœ€è¦éªŒè¯çš„邮箱地址
 @return Yes为是
 */
+(BOOL)isPhone:(NSString*)candidate;
/**
 è¾“入框视图的晃动
 
BuWanVideo2.0/Share.m
@@ -23,6 +23,21 @@
    return [emailTest evaluateWithObject:candidate];
}
/**
 åˆ¤æ–­æ˜¯å¦æ˜¯ç”µå­é‚®ç®±
 @param candidate ä¼ å…¥éœ€è¦éªŒè¯çš„邮箱地址
 @return Yes为是
 */
+(BOOL)isPhone:(NSString*)candidate{
    NSString* regex = @"^1[3-9]\\d{9}$";
    NSPredicate* phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
    return [phoneTest evaluateWithObject:candidate];
}
/**
 è¾“入框视图的晃动
 
BuWanVideo2.0/WEBViewController.m
@@ -42,6 +42,9 @@
    _webView=[[WKWebView alloc] initWithFrame:CGRectMake(0, 64 , KScreenW, KScreenH - 64 )];
    _webView.contentMode=UIViewContentModeScaleAspectFill;
    _webView.configuration.allowsInlineMediaPlayback=YES;
    _webView.configuration.preferences.javaScriptEnabled=YES;
    
    [_webView setNavigationDelegate:self];
    [_webView setMultipleTouchEnabled:YES];
BuWanVideo2.0/XYRDetailViewController.m
@@ -61,6 +61,9 @@
#import <BUAdSDK/BUAdSDK.h>
#import <BUAdSDK/BUAdSDK.h>
#define MARGIN 5
#define BACK_WIDTH (DEVICE_TYPE_IPAD ? 30 : 20)
#define ui_round_size(x) (DEVICE_TYPE_IPAD ? ((x) < 50 ? 50 : (x)) : ((x) < 44 ? 44 : (x)))
@@ -70,7 +73,7 @@
#define BETWEEN_BOUND_FULL 100
#define BETWEEN_BOUND_NORMAL 20
@interface XYRDetailViewController ()<CMuneBarDelegate,UIScrollViewDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate,YTHNetDelegateRecommend,UIGestureRecognizerDelegate,YTHBacktoApplicationsDelegate,GDTNativeExpressAdDelegete,HXEasyCustomShareViewDelegate,BUNativeExpressFullscreenVideoAdDelegate>{
@interface XYRDetailViewController ()<CMuneBarDelegate,UIScrollViewDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate,YTHNetDelegateRecommend,UIGestureRecognizerDelegate,YTHBacktoApplicationsDelegate,GDTNativeExpressAdDelegete,HXEasyCustomShareViewDelegate,BUNativeExpressFullscreenVideoAdDelegate,BUMNativeAdsManagerDelegate, BUNativeAdDelegate>{
    int _gather;//集数加载更多的控制变量,默认为1
    int isCollectNum;//当前选中的集
    
@@ -140,10 +143,14 @@
@property (nonatomic, assign) CGRect playerFrame;
@property (nonatomic, assign) CGRect cloudPlayerFrame;
@property (nonatomic, strong) NSDate *startTime;
@property (nonatomic, strong) NSArray *expressAdViews;
@property (nonatomic, strong) NSMutableArray *expressAdViews;
@property (nonatomic, strong) GDTNativeExpressAd *nativeExpressAd;
@property (nonatomic, strong) NSMutableArray *buNativeAds;
@property (nonatomic, strong) BUNativeExpressFullscreenVideoAd *fullscreenVideoAd;
@property (nonatomic) BUNativeAdsManager *adManager;
@end
@@ -190,8 +197,7 @@
                return;
         }
    }
    self.fullscreenVideoAd = [[BUNativeExpressFullscreenVideoAd alloc] initWithSlotID:@"945472378"];
    self.fullscreenVideoAd = [[BUNativeExpressFullscreenVideoAd alloc] initWithSlotID:CSJ_AD_PID_VIDEO_DETAIL];
    self.fullscreenVideoAd.delegate = self;
    [self.fullscreenVideoAd loadAdData];
}
@@ -203,7 +209,10 @@
//当视频广告素材加载失败时调用此方法。
- (void)nativeExpressFullscreenVideoAd:(BUNativeExpressFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error {
    NSLog(@"广告-详情页插屏穿山甲加载失败:%@", error);
    if(error!=nil&&error.code == 20001){
    
    }
}
//此方法在成功呈现nativeExpressAdView时调用。
@@ -257,7 +266,6 @@
    //网络状态
    [self NetWorkStuas];
}
-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    //删除通知中心的监听
@@ -323,7 +331,7 @@
        }
    }else{
        //未登录,引导用户登录
        LoggingViewController *loginVC=[[LoggingViewController alloc] init];
        LoggingViewController *loginVC=((AppDelegate*)[UIApplication sharedApplication].delegate).loggingViewController;
        loginVC.modalPresentationStyle = 0;
        loginVC.ispresent=YES;
        [self presentViewController:loginVC animated:YES completion:^{
@@ -765,7 +773,7 @@
            }];
        }else{
            //未登录,引导用户登录
            LoggingViewController *loginVC=[[LoggingViewController alloc] init];
            LoggingViewController *loginVC=((AppDelegate*)[UIApplication sharedApplication].delegate).loggingViewController;
            loginVC.modalPresentationStyle = 0;
            loginVC.ispresent=YES;
            [self presentViewController:loginVC animated:YES completion:^{
@@ -1394,7 +1402,7 @@
            [self CalculateHeightWithArray:_VideoDetailList];
            
            //加载广告
            [self loadAd];
            [self loadCSJAd];
            //加载相关视频
            [self getRelativeVideosWithVideoId:movieid];
            //加载猜你喜欢
@@ -1522,13 +1530,74 @@
    self.nativeExpressAd.videoMuted = NO;
    [self.nativeExpressAd loadAd:4];
}
-(void) loadCSJAd{
    id other=[YTHsharedManger startManger].ad[@"other"];
    if(other==nil|| other==[NSNull null] ||other[@"type"]==nil){
        return;
    }
    BUAdSlot *slot = [[BUAdSlot alloc] init];
    slot.ID = CSJ_AD_PID_VIDEO_DETAIL_DRAW; // èšåˆç»´åº¦é€šè¿‡å¹¿å‘Šä½ID发起请求,仅接入CSJ广告通过代码位ID发起请求
    slot.adSize = CGSizeMake(KScreenW, (KScreenW-20)/16*9 + 10);
    slot.mediation.mutedIfCan = YES; // é™éŸ³ ï¼ˆèšåˆåŠŸèƒ½ï¼‰
    BUNativeAdsManager *adManager = [[BUNativeAdsManager alloc] initWithSlot:slot];
    self.adManager = adManager;
    self.adManager.mediation.rootViewController = self;
    self.adManager.delegate = self;
    [self.adManager loadAdDataWithCount:1]; // åŠ è½½å¹¿å‘Šæ•°é‡ï¼Œæ”¯æŒ1~3个
}
- (void)nativeAdsManagerSuccessToLoad:(BUNativeAdsManager *)adsManager nativeAds:(NSArray<BUNativeAd *> *)nativeAdDataArray{
    if(!self.buNativeAds){
        self.buNativeAds  = [[NSMutableArray alloc] init];
    }
    [self.buNativeAds removeAllObjects];
    if(!self.expressAdViews){
        self.expressAdViews =[[NSMutableArray alloc] init];
    }
    [self.expressAdViews removeAllObjects];
    for (BUNativeAd *model in nativeAdDataArray) {
        model.rootViewController = self;
        model.delegate = self;
        if (model.mediation.isExpressAd) {
            [model.mediation render];
        }
        if(model.mediation.canvasView){
            [self.expressAdViews addObject: model.mediation.canvasView];
        }
        [self.buNativeAds addObject:model];
    }
    [self.collectionView reloadData];
}
- (void)nativeAdsManager:(BUNativeAdsManager *)adsManager didFailWithError:(NSError *)error{
    NSLog(@"搜索页CSJ广告加载失败:%@", error.userInfo.description);
//    [self loadAd];
}
- (void)nativeAd:(BUNativeAd *_Nullable)nativeAd dislikeWithReason:(NSArray<BUDislikeWords *> *_Nullable)filterWords{
    for (int i = 0; i < self.expressAdViews.count; i++) {
        if([self.expressAdViews objectAtIndex:i] == nativeAd.mediation.canvasView ){
            [self.expressAdViews replaceObjectAtIndex:i withObject:[NSNull null]];
            break;
        }
    }
    [self.collectionView reloadData];
}
- (void)nativeExpressAdSuccessToLoad:(GDTNativeExpressAd
                                      *)nativeExpressAd views:(NSArray<__kindof
                                                               GDTNativeExpressAdView *> *)views
{
    if(views&&views.count>=3)
    {
        self.expressAdViews = [NSArray arrayWithArray:views];
        self.expressAdViews = [NSMutableArray arrayWithArray:views];
    }
    if (self.expressAdViews.count) {
        [self.expressAdViews enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
@@ -1550,6 +1619,8 @@
        [subview removeFromSuperview];
    }
}
/**
 *  èŽ·å–è§†é¢‘çš„ç›¸å…³è§†é¢‘ä¿¡æ¯
 *
@@ -1655,7 +1726,7 @@
        }
    }else{
        //如果用户未登录
        LoggingViewController *loginVC=[[LoggingViewController alloc] init];
        LoggingViewController *loginVC=((AppDelegate*)[UIApplication sharedApplication].delegate).loggingViewController;
        loginVC.modalPresentationStyle = 0;
        loginVC.ispresent=YES;
        [self presentViewController:loginVC animated:YES completion:nil];
@@ -1729,7 +1800,7 @@
            } cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"营销诈骗", @"淫秽色情", @"地域攻击",@"其他理由",nil];
        }else{
            //如果用户未登录
            LoggingViewController *loginVC=[[LoggingViewController alloc] init];
            LoggingViewController *loginVC=((AppDelegate*)[UIApplication sharedApplication].delegate).loggingViewController;
            loginVC.modalPresentationStyle = 0;
            loginVC.ispresent=YES;
            [self presentViewController:loginVC animated:YES completion:nil];
@@ -1858,7 +1929,7 @@
#pragma mark -UICollectionViewDataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    if (section==0) {
        if(self.expressAdViews.count>3){
        if(self.expressAdViews.count>0){
            return 1;
        }else{
            return 0;
@@ -1915,17 +1986,19 @@
        case 0:{
            newADCollectionViewCell *cell;
            cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"newADCollectionViewCell" forIndexPath:indexPath];
            if (self.expressAdViews.count <= 3) {
            if (self.expressAdViews.count < 1) {
                return cell;
            }
            GDTNativeExpressAdView *adView = (GDTNativeExpressAdView *)self.expressAdViews[3];
            [cell.contentView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
            [cell.contentView addSubview:adView];
            //            GDTNativeAdData *info=nativeArray[3];
            //            cell.ADtitle.text=[info.properties objectForKey:GDTNativeAdDataKeyTitle];
            //            cell.ADtitle.backgroundColor=[UIColor clearColor];
            //            [cell.ADimage setYthImageWithURL:[info.properties objectForKey:GDTNativeAdDataKeyImgUrl] placeholderImage:nil];
            //            [_nativeAd attachAd:info toView:cell];
            UIView *adView = (UIView *)self.expressAdViews[0];
            if(adView&& ![adView isKindOfClass:[NSNull class]]){
                [cell.contentView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
                [cell.contentView addSubview:adView];
                //            GDTNativeAdData *info=nativeArray[3];
                //            cell.ADtitle.text=[info.properties objectForKey:GDTNativeAdDataKeyTitle];
                //            cell.ADtitle.backgroundColor=[UIColor clearColor];
                //            [cell.ADimage setYthImageWithURL:[info.properties objectForKey:GDTNativeAdDataKeyImgUrl] placeholderImage:nil];
                //            [_nativeAd attachAd:info toView:cell];
            }
            return cell;
        }
            break;
@@ -2110,16 +2183,18 @@
                //返回广告视图
                if (indexPath.section>3) {
                    
                    if(self.expressAdViews.count>0){
                    NSInteger adIndex = indexPath.section-3;
                    if(adIndex < self.expressAdViews.count){
                        ADCollectionReusableView *groupfootSection = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"ADCollectionReusableView" forIndexPath:indexPath];
                        
                        //把button设为透明
                        groupfootSection.ADClickButton.backgroundColor=[UIColor clearColor];
                        [groupfootSection.ADClickButton setTag:520+indexPath.section];
                        [groupfootSection.ADClickButton addTarget:self action:@selector(getMoreInformation:) forControlEvents:UIControlEventTouchUpInside];
                        GDTNativeExpressAdView *adView = (GDTNativeExpressAdView *)self.expressAdViews[indexPath.section-3];
                        [groupfootSection addSubview:adView];
                        UIView *adView = (UIView *)self.expressAdViews[adIndex];
                        if(adView&& ![adView isKindOfClass:[NSNull class]]){
                            [groupfootSection addSubview:adView];
                        }
                        return groupfootSection;
                    }else{
                        return nil;
@@ -2164,9 +2239,15 @@
        return CGSizeMake(0, 0);
    }else{
        if (section>3) {
            if(self.expressAdViews.count>0){
                GDTNativeExpressAdView *adView = (GDTNativeExpressAdView *)self.expressAdViews[section-3];
                return CGSizeMake(0, adView.bounds.size.height);
            NSInteger adIndex = section-3;
            if(self.expressAdViews.count>0 && adIndex < self.expressAdViews.count){
                UIView *adView = (UIView *)self.expressAdViews[adIndex];
                if(adView&& ![adView isKindOfClass:[NSNull class]]){
                    return CGSizeMake(0, adView.bounds.size.height);
                }
                else{
                    return CGSizeMake(0, 0);
                }
            }else{
                return CGSizeMake(0, 0);
            }
@@ -2182,8 +2263,12 @@
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section==0) {
        //        return CGSizeMake(KScreenW-20, (KScreenW-20)/16*9);
        GDTNativeExpressAdView *adView = (GDTNativeExpressAdView *)self.expressAdViews[indexPath.section];
        return CGSizeMake(KScreenW, adView.bounds.size.height);
        UIView *adView = (UIView *)self.expressAdViews[indexPath.section];
        if(adView&& ![adView isKindOfClass:[NSNull class]]){
            return CGSizeMake(KScreenW, adView.bounds.size.height);
        }else{
            return CGSizeMake(0, 0);
        }
    }else if (indexPath.section==1) {
        return CELLSize;
    }else if(indexPath.section==2){
BuWanVideo2.0/XYRDetailViewController.xib
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
    <device id="retina4_7" orientation="portrait">
        <adaptation id="fullscreen"/>
    </device>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22505" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
    <device id="retina4_7" orientation="portrait" appearance="light"/>
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22504"/>
        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
    </dependencies>
    <objects>
@@ -90,7 +88,7 @@
                    <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                    <nil key="highlightedColor"/>
                </label>
                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rbi-cV-2cd">
                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rbi-cV-2cd">
                    <rect key="frame" x="8" y="57" width="359" height="60"/>
                    <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
                    <constraints>
@@ -139,11 +137,11 @@
                <constraint firstItem="BSc-Ri-J22" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="zZU-M9-nYN"/>
            </constraints>
            <simulatedStatusBarMetrics key="simulatedStatusBarMetrics" statusBarStyle="lightContent"/>
            <point key="canvasLocation" x="359.5" y="432.5"/>
            <point key="canvasLocation" x="575.20000000000005" y="389.05547226386807"/>
        </view>
    </objects>
    <resources>
        <image name="开始播放按钮" width="79" height="55"/>
        <image name="开始播放按钮" width="79" height="55.5"/>
        <image name="详情页面返回" width="32" height="32"/>
        <image name="默认加载图片" width="240" height="135"/>
    </resources>
BuWanVideo2.0/YTHNetInterface.h
@@ -265,7 +265,30 @@
/**
 *  é‚®ç®±ç™»å½•
 */
-(void)getloginWithUid:(NSString *)uid WithSystem:(NSString *)system WithEmail:(NSString *)Email WithPwd:(NSString *)Pwd withBlock:(YthNetWorkBlock)block;
-(void)loginWithEmail:(NSString *)uid WithSystem:(NSString *)system WithEmail:(NSString *)Email WithPwd:(NSString *)Pwd withBlock:(YthNetWorkBlock)block;
/**
 *  ï»¿æ‰‹æœºï»¿å·ç™»å½•
 */
-(void)loginWithPhone:(NSString *)uid WithSystem:(NSString *)system WithPhone:(NSString *)phone WithPwd:(NSString *)pwd withBlock:(YthNetWorkBlock)block;
/**
 *  ï»¿QQ登录
 */
-(void)loginWithQQ:(NSString *)uid WithSystem:(NSString *)system WithAcessToken:(NSString *)accessToken WithOpenid:(NSString *)openId withBlock:(YthNetWorkBlock)block;
/**
 *  ï»¿ï»¿å¾®ä¿¡ç™»å½•
 */
-(void)loginWithWX:(NSString *)uid WithSystem:(NSString *)system WithCode:(NSString *)code withBlock:(YthNetWorkBlock)block;
/**
 ä¿®æ”¹ä¸ªäººä¿¡æ¯
BuWanVideo2.0/YTHNetInterface.m
@@ -191,7 +191,7 @@
    
    NSString *url = [NSString stringWithFormat:@"%@/user",domainHTTP];
    
    [self mangerPostWithURL:url WithMutableDictionary:dic withTimeout:5.0f withBlock:block];
    [self mangerPostWithURL:url WithMutableDictionary:dic withTimeout:10.0f withBlock:block];
}
- (void)postUserRequestDataNewWith:(NSMutableDictionary *)dic withBlock:(YthNetWorkBlock)block {
@@ -1019,7 +1019,7 @@
}
#pragma mark é‚®ç®±ç™»å½•
-(void)getloginWithUid:(NSString *)uid WithSystem:(NSString *)system WithEmail:(NSString *)Email WithPwd:(NSString *)Pwd withBlock:(YthNetWorkBlock)block{
-(void)loginWithEmail:(NSString *)uid WithSystem:(NSString *)system WithEmail:(NSString *)Email WithPwd:(NSString *)Pwd withBlock:(YthNetWorkBlock)block{
    NSMutableDictionary *dic = [YTHNetdata loginWithUid:uid WithSystem:system WithEmail:Email WithPwd:Pwd];
    [self postUserRequestDataWith:dic withBlock:^(BOOL isSuccessful, id result, NSString *error) {
        if (isSuccessful) {
@@ -1031,6 +1031,56 @@
    }];
}
#pragma mark æ‰‹æœºï»¿å·ç™»å½•
-(void)loginWithPhone:(NSString *)uid WithSystem:(NSString *)system WithPhone:(NSString *)phone WithPwd:(NSString *)pwd withBlock:(YthNetWorkBlock)block{
    NSMutableDictionary *dic = [YTHNetdata loginWithUid:uid WithSystem:system WithPhone:phone WithPwd:pwd];
    [self postUserRequestDataWith:dic withBlock:^(BOOL isSuccessful, id result, NSString *error) {
        if (isSuccessful) {
            NSDictionary *data = (NSDictionary *)result;
            block(TRUE , data , nil);
        }else{
            block(FALSE , nil , error);
        }
    }];
}
#pragma mark QQ登录
-(void)loginWithQQ:(NSString *)uid WithSystem:(NSString *)system WithAcessToken:(NSString *)accessToken WithOpenid:(NSString *)openId withBlock:(YthNetWorkBlock)block{
    NSMutableDictionary *dic = [YTHNetdata loginWithUid:uid WithSystem:system WithQQ:accessToken WithOpenId:openId];
    [self postUserRequestDataWith:dic withBlock:^(BOOL isSuccessful, id result, NSString *error) {
        if (isSuccessful) {
            NSDictionary *data = (NSDictionary *)result;
            block(TRUE , data , nil);
        }else{
            block(FALSE , nil , error);
        }
    }];
}
#pragma mark å¾®ä¿¡ç™»å½•
-(void)loginWithWX:(NSString *)uid WithSystem:(NSString *)system WithCode:(NSString *)code withBlock:(YthNetWorkBlock)block{
    NSMutableDictionary *dic = [YTHNetdata loginWithUid:uid WithSystem:system WithWX:code];
    [self postUserRequestDataWith:dic withBlock:^(BOOL isSuccessful, id result, NSString *error) {
        if (isSuccessful) {
            NSDictionary *data = (NSDictionary *)result;
            block(TRUE , data , nil);
        }else{
            block(FALSE , nil , error);
        }
    }];
}
#pragma mark ä¿®æ”¹ä¸ªäººä¿¡æ¯
-(void)getupdateLoginUserInfoWithUid:(NSString *)uid WithSystem:(NSString *)system WithLoginUid:(NSString *)loginUid WithSex:(NSString *)sex WithBirthDay:(NSString *)birthday WithPersonalSign:(NSString *)PersonalSign WithNickName:(NSString *)NickName WithPortrait:(NSString *)Portrait withBlock:(YthNetWorkBlock)block{
    NSMutableDictionary *dic = [YTHNetdata updateLoginUserInfoWithUid:(NSString *)uid WithSystem:(NSString *)system WithLoginUid:(NSString *)loginUid WithSex:(NSString *)sex WithBirthDay:(NSString *)birthday WithPersonalSign:(NSString *)PersonalSign WithNickName:(NSString *)NickName WithPortrait:(NSString *)Portrait];
BuWanVideo2.0/YTHNetdata.h
@@ -248,6 +248,30 @@
 */
+ (NSMutableDictionary *)loginWithUid:(NSString *)uid WithSystem:(NSString *)system WithEmail:(NSString *)Email WithPwd:(NSString *)Pwd;
/// ï»¿ç”µè¯ï»¿å·ç ï»¿ç™»å½•
/// @param uid ï»¿ç”¨æˆ·ID
/// @param system ï»¿ç³»ç»Ÿ
/// @param phone ï»¿ç”µè¯ï»¿å·ç 
/// @param Pwd ï»¿å¯†ç 
+ (NSMutableDictionary *)loginWithUid:(NSString *)uid WithSystem:(NSString *)system WithPhone:(NSString *)phone WithPwd:(NSString *)Pwd;
/// QQ登录
/// @param uid ï»¿ç”¨æˆ·ID
/// @param system ï»¿ç³»ç»Ÿ
/// @param accessToken QQ授权token
/// @param openId QQ授权openId
+ (NSMutableDictionary *)loginWithUid:(NSString *)uid WithSystem:(NSString *)system WithQQ:(NSString *)accessToken WithOpenId:(NSString *)openId;
/// ï»¿å¾®ä¿¡ï»¿ç™»å½•
/// @param uid ï»¿ç”¨æˆ·ID
/// @param system ï»¿ç³»ç»Ÿ
/// @param code ï»¿å¾®ä¿¡ï»¿æŽˆæƒï»¿code
+ (NSMutableDictionary *)loginWithUid:(NSString *)uid WithSystem:(NSString *)system WithWX:(NSString *)code;
/**
 ä¿®æ”¹ä¸ªäººä¿¡æ¯
BuWanVideo2.0/YTHNetdata.m
@@ -1112,10 +1112,100 @@
    if (Pwd != nil) {
        [dic setObject:Pwd forKey:@"Pwd"];
    }
    [dic setObject:@"3" forKey:@"LoginType"];
    [dic setObject:[[UIDevice currentDevice].identifierForVendor UUIDString] forKey:@"Device"];
    return dic;
}
+ (NSMutableDictionary *)loginWithUid:(NSString *)uid WithSystem:(NSString *)system WithPhone:(NSString *)phone WithPwd:(NSString *)Pwd{
    NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithCapacity:0];
    [dic setObject:logins forKey:@"Method"];
    [dic setObject:@"ios" forKey:@"Platform"];
    NSString *sign;
    if (uid!=nil) {
        [dic setObject:uid forKey:@"Uid"];
        sign = [NSString stringWithFormat:@"%@%@%@",logins,uid,system];
    }else{
        sign = [NSString stringWithFormat:@"%@%@%@",logins,[[UIDevice currentDevice].identifierForVendor UUIDString],system];
    }
    [dic setObject:[NSString md5:sign] forKey:@"Sign"];
    [dic setObject:Version forKey:@"Version"];
    [dic setObject:Package forKey:@"Package"];
    [dic setObject:system forKey:@"System"];
    if(phone != nil){
        [dic setObject:phone forKey:@"Phone"];
    }
    if (Pwd != nil) {
        [dic setObject:Pwd forKey:@"Pwd"];
    }
    [dic setObject:@"4" forKey:@"LoginType"];
    [dic setObject:[[UIDevice currentDevice].identifierForVendor UUIDString] forKey:@"Device"];
    return dic;
}
+ (NSMutableDictionary *)loginWithUid:(NSString *)uid WithSystem:(NSString *)system WithQQ:(NSString *)accessToken WithOpenId:(NSString *)openId{
    NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithCapacity:0];
    [dic setObject:logins forKey:@"Method"];
    [dic setObject:@"ios" forKey:@"Platform"];
    NSString *sign;
    if (uid!=nil) {
        [dic setObject:uid forKey:@"Uid"];
        sign = [NSString stringWithFormat:@"%@%@%@",logins,uid,system];
    }else{
        sign = [NSString stringWithFormat:@"%@%@%@",logins,[[UIDevice currentDevice].identifierForVendor UUIDString],system];
    }
    [dic setObject:[NSString md5:sign] forKey:@"Sign"];
    [dic setObject:Version forKey:@"Version"];
    [dic setObject:Package forKey:@"Package"];
    [dic setObject:system forKey:@"System"];
    if(accessToken != nil){
        [dic setObject:accessToken forKey:@"AccessToken"];
    }
    if (openId != nil) {
        [dic setObject:openId forKey:@"OpenId"];
    }
    [dic setObject:@"1" forKey:@"LoginType"];
    [dic setObject:[[UIDevice currentDevice].identifierForVendor UUIDString] forKey:@"Device"];
    return dic;
}
+ (NSMutableDictionary *)loginWithUid:(NSString *)uid WithSystem:(NSString *)system WithWX:(NSString *)code{
    NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithCapacity:0];
    [dic setObject:logins forKey:@"Method"];
    [dic setObject:@"ios" forKey:@"Platform"];
    NSString *sign;
    if (uid!=nil) {
        [dic setObject:uid forKey:@"Uid"];
        sign = [NSString stringWithFormat:@"%@%@%@",logins,uid,system];
    }else{
        sign = [NSString stringWithFormat:@"%@%@%@",logins,[[UIDevice currentDevice].identifierForVendor UUIDString],system];
    }
    [dic setObject:[NSString md5:sign] forKey:@"Sign"];
    [dic setObject:Version forKey:@"Version"];
    [dic setObject:Package forKey:@"Package"];
    [dic setObject:system forKey:@"System"];
    if(code != nil){
        [dic setObject:code forKey:@"Code"];
    }
    [dic setObject:@"2" forKey:@"LoginType"];
    [dic setObject:[[UIDevice currentDevice].identifierForVendor UUIDString] forKey:@"Device"];
    return dic;
}
#pragma mark ä¿®æ”¹ä¸ªäººä¿¡æ¯
+ (NSMutableDictionary *)updateLoginUserInfoWithUid:(NSString *)uid WithSystem:(NSString *)system WithLoginUid:(NSString *)loginUid WithSex:(NSString *)sex WithBirthDay:(NSString *)birthday WithPersonalSign:(NSString *)PersonalSign WithNickName:(NSString *)NickName WithPortrait:(NSString *)Portrait{
    NSMutableDictionary *dic = [[NSMutableDictionary alloc] initWithCapacity:0];
BuWanVideo2.0/allCommentsViewController.m
@@ -10,6 +10,7 @@
#import "findcommentTableViewCell.h"
#import "LoggingViewController.h"
#import "AppDelegate.h"
@interface allCommentsViewController ()<UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate,UIGestureRecognizerDelegate>{
    UITableView *_tableView;
@@ -125,7 +126,7 @@
        }];
    }else{
        //未登录,引导用户登录
        LoggingViewController *loginVC=[[LoggingViewController alloc] init];
        LoggingViewController *loginVC=((AppDelegate*)[UIApplication sharedApplication].delegate).loggingViewController;
        loginVC.ispresent=YES;
        [self presentViewController:loginVC animated:YES completion:^{
            
BuWanVideo2.0/attentionView.m
@@ -9,6 +9,7 @@
#import "attentionView.h"
#import "AttentionCell.h"
#import "LoggingViewController.h"
#import "AppDelegate.h"
#import "WebControllerView.h"
#import "XYRDetailViewController.h"
@@ -188,7 +189,7 @@
 *  ç™»å½•
 */
-(void)ClickLogin:(id)sender{
    LoggingViewController *LG = [LoggingViewController new];
    LoggingViewController *LG = ((AppDelegate*)[UIApplication sharedApplication].delegate).loggingViewController;
    [temp.navigationController pushViewController:LG animated:YES];
}
BuWanVideo2.0/discoverGoodsDetailViewController.m
@@ -15,6 +15,7 @@
#import "allCommentsViewController.h"
#import "WEBViewController.h"
#import "LoggingViewController.h"
#import "AppDelegate.h"
//#import <AlibcTradeSDK/AlibcTradeSDK.h>
//#import <AlibcTradeSDK/AlibcTradeService.h>
@@ -184,7 +185,7 @@
        }];
    }else{
        //未登录,引导用户登录
        LoggingViewController *loginVC=[[LoggingViewController alloc] init];
        LoggingViewController *loginVC=((AppDelegate*)[UIApplication sharedApplication].delegate).loggingViewController;
        loginVC.ispresent=YES;
        [self presentViewController:loginVC animated:YES completion:^{
            
BuWanVideo2.0/forgetPasswordViewController.m
@@ -25,7 +25,10 @@
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.navigationItem.title = @"忘记密码";
    self.view.backgroundColor=[UIColor whiteColor];
    self.view.backgroundColor=KGlobalLightGreyColor_245;
    if(@available(iOS 13.0,*)){
        self.overrideUserInterfaceStyle = UIUserInterfaceStyleLight;
    }
    
    //设置账号登录的字体样式
    self.navigationController.navigationBar.titleTextAttributes =@{NSFontAttributeName:[UIFont systemFontOfSize:18],NSForegroundColorAttributeName:[UIColor blackColor]};
@@ -77,6 +80,7 @@
    [FillInTheVerificationCode.layer setBorderWidth:1.0];
    [FillInTheVerificationCode.layer setBorderColor:(kGlobalLightGreyColor_210.CGColor)];
    FillInTheVerificationCode.placeholder=[NSString stringWithFormat:@"验证码"];
    FillInTheVerificationCode.secureTextEntry = YES;
    
    //前面空一个间距
    [self setTextFieldLeftPadding:FillInTheVerificationCode forWidth:10.0];
@@ -106,7 +110,8 @@
    [self setTextFieldLeftPadding:FillInThePassWord forWidth:10.0];
    [self.view addSubview:FillInThePassWord];
    //确认修改的按钮
    registerBtn=[[UIButton alloc] initWithFrame:CGRectMake(70, KScreenH-110, KScreenW-140, 32)];
    registerBtn=[[UIButton alloc] initWithFrame:CGRectMake(70, KScreenH-kStatusBarH - 110, KScreenW-140, 32)];
//    registerBtn=[[UIButton alloc] initWithFrame:CGRectMake(70, 0, KScreenW-140, 32)];
    [registerBtn.layer setMasksToBounds:YES];
    [registerBtn.layer setCornerRadius:5.0];
    registerBtn.backgroundColor=kGlobalYellowColor;
BuWanVideo2.0/searchDetailViewController.m
@@ -20,11 +20,12 @@
#import "SearchTitleView.h"
#import "SearchNavView.h"
#import <BUAdSDK/BUAdSDK.h>
static NSString *indentfly = @"cell";
static NSString *indentfly2=@"searchTableViewCellID";
@interface searchDetailViewController ()<YTHSearchTextFieldDelegate,UITableViewDataSource,UITableViewDelegate,GDTNativeExpressAdDelegete,SearchDetailListCellDelegate,SearchTitleViewDelegate, SearchDelegate>{
@interface searchDetailViewController ()<YTHSearchTextFieldDelegate,UITableViewDataSource,UITableViewDelegate,GDTNativeExpressAdDelegete,SearchDetailListCellDelegate,SearchTitleViewDelegate, SearchDelegate,BUMNativeAdsManagerDelegate, BUNativeAdDelegate>{
    NSInteger pagenumber;
    NSInteger typenumber;
    //广点通原生广告
@@ -38,7 +39,7 @@
@property (nonatomic , strong) NSMutableArray *suggestSearch;//搜索建议
@property (nonatomic , strong) UITableView *DisplayTabelView;//用于显示搜索结果的列表
@property (nonatomic, strong) NSArray *expressAdViews;
@property (nonatomic, strong) NSMutableArray *expressAdViews;
@property (nonatomic, strong) GDTNativeExpressAd *nativeExpressAd;
@property (nonatomic, strong) SearchTitleView *viewSearchTitle;
@@ -46,6 +47,13 @@
@property (nonatomic, strong) NSArray *typeList;
@property (nonatomic, strong) SearchNavView *viewSearchNav;
@property (nonatomic, strong) NSMutableArray *buNativeAds;
@property (nonatomic) BUNativeAdsManager *adManager;
@end
@implementation searchDetailViewController
@@ -60,8 +68,7 @@
    [self addsuggestTableview];
    //添加搜索结果的列表
    [self addTabelView];
    [self loadAd];
    [self loadCSJAd];
}
- (void)viewWillAppear:(BOOL)animated {
@@ -123,10 +130,78 @@
    //    [self.view addSubview:self.viewSearchTitle];
}
-(void) loadCSJAd{
    id search=[YTHsharedManger startManger].ad[@"videoSearch"];
    if(search==nil|| search==[NSNull null] ||search[@"type"]==nil){
        return;
    }
    BUAdSlot *slot = [[BUAdSlot alloc] init];
    slot.ID = CSJ_AD_PID_SEARCH_RESULT; // èšåˆç»´åº¦é€šè¿‡å¹¿å‘Šä½ID发起请求,仅接入CSJ广告通过代码位ID发起请求
    slot.adSize = CGSizeMake(KScreenW, KScreenW*0.3); // æŒ‰ç…§å®žé™…情况设置广告尺寸
    slot.mediation.mutedIfCan = YES; // é™éŸ³ ï¼ˆèšåˆåŠŸèƒ½ï¼‰
    BUNativeAdsManager *adManager = [[BUNativeAdsManager alloc] initWithSlot:slot];
    _adManager = adManager;
    _adManager.mediation.rootViewController = self;
    _adManager.delegate = self;
    [_adManager loadAdDataWithCount:1]; // åŠ è½½å¹¿å‘Šæ•°é‡ï¼Œæ”¯æŒ1~3个
}
- (void)nativeAdsManagerSuccessToLoad:(BUNativeAdsManager *)adsManager nativeAds:(NSArray<BUNativeAd *> *)nativeAdDataArray{
    if(!self.buNativeAds){
        self.buNativeAds  = [[NSMutableArray alloc] init];
    }
    [self.buNativeAds removeAllObjects];
    if(!self.expressAdViews){
        self.expressAdViews =[[NSMutableArray alloc] init];
    }
    [self.expressAdViews removeAllObjects];
    for (BUNativeAd *model in nativeAdDataArray) {
        model.rootViewController = self;
        model.delegate = self;
        if (model.mediation.isExpressAd) {
            [model.mediation render];
        }
//        [model loadAdData];
        if(model.mediation.canvasView){
            [self.expressAdViews addObject: model.mediation.canvasView];
        }
        [self.buNativeAds addObject:model];
    }
    [self.DisplayTabelView reloadData];
}
- (void)nativeAdsManager:(BUNativeAdsManager *)adsManager didFailWithError:(NSError *)error{
    NSLog(@"搜索页CSJ广告加载失败:%@", error.userInfo.description);
    [self loadAd];
}
- (void)nativeAd:(BUNativeAd *_Nullable)nativeAd dislikeWithReason:(NSArray<BUDislikeWords *> *_Nullable)filterWords{
    if(nativeAd){
        [nativeAd.mediation.canvasView removeFromSuperview];
    }
    for (int i = 0; i < self.expressAdViews.count; i++) {
        if([self.expressAdViews objectAtIndex:i] == nativeAd.mediation.canvasView ){
            [self.expressAdViews replaceObjectAtIndex:i withObject:[NSNull null]];
            break;
        }
    }
    [self.DisplayTabelView reloadData];
}
/**
 *  åŠ è½½å¹¿ç‚¹é€šåŽŸç”Ÿå¹¿å‘Š
 */
-(void)loadAd{
    id search=[YTHsharedManger startManger].ad[@"videoSearch"];
    if(search==nil|| search==[NSNull null] ||search[@"type"]==nil){
        return;
    }
    //    _nativeAd = [[GDTNativeAd alloc]initWithAppId: GDTADkey placementId:GDTYSADkey3];
    //    _nativeAd.controller = self;
    //    _nativeAd.delegate = self;
@@ -147,7 +222,7 @@
#pragma mark -GDTNativeAdDelegate
- (void)nativeExpressAdSuccessToLoad:(GDTNativeExpressAd *)nativeExpressAd views:(NSArray<__kindof GDTNativeExpressAdView *> *)views
{
    self.expressAdViews = [NSArray arrayWithArray:views];
    self.expressAdViews = [NSMutableArray arrayWithArray:views];
    if (self.expressAdViews.count) {
        [self.expressAdViews enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            GDTNativeExpressAdView *expressView = (GDTNativeExpressAdView *)obj;
@@ -558,9 +633,11 @@
        } else {
            infoIndex = section / 20;
        }
        GDTNativeExpressAdView *adView = (GDTNativeExpressAdView *)self.expressAdViews[infoIndex];
        return adView.bounds.size.height;
        UIView *adView = (UIView *)self.expressAdViews[infoIndex];
        if(adView&&![adView isKindOfClass:[NSNull class]]){
            return adView.bounds.size.height;
        }
        return  CGFLOAT_MIN;
    } else {
        return CGFLOAT_MIN;
    }
@@ -573,9 +650,14 @@
        }else{
            infoIndex = section / 20;
        }
        GDTNativeExpressAdView *adView = (GDTNativeExpressAdView *)self.expressAdViews[infoIndex];
        adView.backgroundColor = kGlobalBackgroundColor;
        return adView;
        UIView *adView = (UIView *)self.expressAdViews[infoIndex];
        if(adView&&![adView isKindOfClass:[NSNull class]]){
            adView.backgroundColor = kGlobalBackgroundColor;
            return adView;
        }else{
            UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, 0)];
            return view;
        }
    } else {
        UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, 0)];
        return view;
BuWanVideo2.0/subregionView.m
@@ -12,13 +12,11 @@
#import "SubregionDetailViewController.h"
//#import "GDTNativeAd.h"//广点通原生广告
#import "ADCollectionReusableView.h"
#import "GDTNativeExpressAd.h"
#import "GDTNativeExpressAdView.h"
#import "FaxianCReusableView.h"
//#import "BannerViewController.h"
#import "GDTUnifiedBannerView.h"
#import <BUAdSDK/BUAdSDK.h>
@interface subregionView ()<UICollectionViewDelegate,UICollectionViewDataSource,GDTNativeExpressAdDelegete,GDTUnifiedBannerViewDelegate>{
@interface subregionView ()<UICollectionViewDelegate,UICollectionViewDataSource, BUNativeExpressBannerViewDelegate>{
    UICollectionView *_collview;
//    GDTNativeAd *_nativeAd;     //原生广告实例
//    NSArray *nativeArray;//存储请求下来的原生广告信息
@@ -26,8 +24,7 @@
}
@property (nonatomic , strong) NSMutableArray *dataClass;//分区数据
@property (nonatomic, strong) NSArray *expressAdViews;
@property (nonatomic, strong) GDTNativeExpressAd *nativeExpressAd;
@property (nonatomic, strong) GDTUnifiedBannerView *bannerView;
@property (nonatomic, strong) BUNativeExpressBannerView *bannerView;
@end
@implementation subregionView
@@ -37,7 +34,7 @@
    self = [super initWithFrame:frame];
    if (self) {
        //从file中读取数据
        [self loadAd];
        [self loadCSJAd];
        [self loadDataFromFile];
        //配置collectionView的属性
        UICollectionViewFlowLayout *flowlayout = [[UICollectionViewFlowLayout alloc] init];
@@ -46,7 +43,7 @@
        flowlayout.minimumInteritemSpacing=(KScreenW)/10;//item之间的距离
        flowlayout.itemSize = CGSizeMake((KScreenW)/6, (KScreenW)/6+30);//设置itme的大小
        flowlayout.sectionInset = UIEdgeInsetsMake((KScreenW)/10,(KScreenW)/9,(KScreenW)/10,(KScreenW)/9);//设置itme之间的间距
        flowlayout.headerReferenceSize = CGSizeMake(0, 60);
        flowlayout.headerReferenceSize = CGSizeMake(0, KScreenW * 0.25);
        //创建collectionView视图
        if (!_collview) {
            _collview = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height) collectionViewLayout:flowlayout];
@@ -106,7 +103,7 @@
            [data writeToFile:CHANNELfILE atomically:YES];
            //刷新collectionView视图
            [_collview reloadData];
            [self loadAd];
            [self loadCSJAd];
        }else{
            
        }
@@ -160,25 +157,52 @@
//- (void)nativeAdFailToLoad:(NSError *)error{
//    NSLog(@"%@",error);
//}
/**
 *  åŠ è½½å¹¿ç‚¹é€šåŽŸç”Ÿå¹¿å‘Š
 */
-(void)loadAd{
//    _nativeAd = [[GDTNativeAd alloc]initWithAppId: GDTADkey placementId:GDTYSADkey5];
//    _nativeAd.controller = [self topViewController];
//    _nativeAd.delegate = self;
//    [_nativeAd loadAd:1];
   //  æ”¯æŒè§†é¢‘广告的 PlacementId ä¼šæ··å‡ºè§†é¢‘与图片广告
    self.nativeExpressAd =[[GDTNativeExpressAd alloc] initWithPlacementId:@"6000418684535350" adSize:CGSizeMake(KScreenW, (KScreenW-20)/16*9 + 10)];
    self.nativeExpressAd.delegate = self;
    // é…ç½®è§†é¢‘播放属性
    self.nativeExpressAd.videoAutoPlayOnWWAN = YES;
    self.nativeExpressAd.videoMuted = NO;
    [self.nativeExpressAd loadAd:1];
-(void) loadCSJAd{
    [self.bannerView removeFromSuperview];
       // é‡æ–°é…ç½®å¹¿å‘Šå¹¶åŠ è½½
       CGSize adSize = CGSizeMake(KScreenW, KScreenW*0.2); // æ ¹æ®å®žé™…情况设置广告尺寸大小
       BUAdSlot *slot = [[BUAdSlot alloc] init];
       slot.ID = CSJ_AD_PID_CLASS_BANNER; // èšåˆç»´åº¦é€šè¿‡å¹¿å‘Šä½ID发起请求;仅接入CSJ广告通过代码位ID发起请求
       BUNativeExpressBannerView *bannerView = [[BUNativeExpressBannerView alloc] initWithSlot:slot rootViewController:self adSize:adSize];
       bannerView.delegate = self;
       self.bannerView = bannerView;
       [self.bannerView loadAdData];
}
/******** Banner广告回调处理 *********/
#pragma BUMNativeExpressBannerViewDelegate
// å¹¿å‘ŠåŠ è½½æˆåŠŸ
- (void)nativeExpressBannerAdViewDidLoad:(BUNativeExpressBannerView *)bannerAdView {
}
// å¹¿å‘ŠåŠ è½½å¤±è´¥
- (void)nativeExpressBannerAdView:(BUNativeExpressBannerView *)bannerAdView didLoadFailWithError:(NSError *)error {
}
// ç”¨æˆ·é€‰æ‹©äº†è´Ÿåé¦ˆä¿¡æ¯
- (void)nativeExpressBannerAdView:(BUNativeExpressBannerView *)bannerAdView dislikeWithReason:(NSArray<BUDislikeWords *> *)filterwords {
}
// å¹¿å‘Šè§†å›¾è¢«ç§»é™¤
- (void)nativeExpressBannerAdViewDidRemoved:(BUNativeExpressBannerView *)nativeExpressAdView {
}
- (void)nativeExpressBannerAdNeedLayoutUI:(BUNativeExpressBannerView *)bannerAd canvasView:(BUMCanvasView *)canvasView {
    // ä»…在使用自渲染混出时会回调这个方法
    // å¼€å‘者需在该方法中实现UI渲染
    // ä»ŽcanvasView中获取UI展示的数据,创建UI控件,添加到canvasView中
}
- (void)clickRemoveAd:(id)sender {
    [self.bannerView removeFromSuperview];
    self.bannerView = nil;
@@ -186,46 +210,17 @@
- (void)clickLoadAd:(id)sender {
}
// è¯·æ±‚广告条数据成功后调用
- (void)unifiedBannerViewDidLoad:(GDTUnifiedBannerView *)unifiedBannerView {
}
// è¯·æ±‚广告条数据失败后调用
- (void)unifiedBannerViewFailedToLoad:(GDTUnifiedBannerView *)unifiedBannerView error:(NSError *)error {
}
- (GDTUnifiedBannerView *)bannerView {
- (BUNativeExpressBannerView *)bannerView {
    if (_bannerView) {
        return _bannerView;
    }
    CGRect rect = CGRectMake(0, 0, KScreenW, 60);
    //_bannerView = [[GDTUnifiedBannerView alloc] initWithFrame:rect appId:GDTADkey placementId:GDTYSADkey5];
    _bannerView = [[GDTUnifiedBannerView alloc] initWithFrame:rect placementId:GDTYSADkey5 viewController:[self topViewController]];
    //设置广告轮播时间,范围为30-120秒,0表示不轮播
    _bannerView.autoSwitchInterval = 0;
    //设置Delegate
    CGSize adSize = CGSizeMake(KScreenW, KScreenW * 0.25); // æ ¹æ®å®žé™…情况设置广告尺寸大小
    BUAdSlot *slot = [[BUAdSlot alloc] init];
    slot.ID = CSJ_AD_PID_CLASS_BANNER; // èšåˆç»´åº¦é€šè¿‡å¹¿å‘Šä½ID发起请求;仅接入CSJ广告通过代码位ID发起请求
    _bannerView = [[BUNativeExpressBannerView alloc] initWithSlot:slot rootViewController:[self topViewController] adSize:adSize];
    _bannerView.delegate = self;
    return _bannerView;
}
- (void)nativeExpressAdSuccessToLoad:(GDTNativeExpressAd
                                      *)nativeExpressAd views:(NSArray<__kindof
                                                               GDTNativeExpressAdView *> *)views
{
    self.expressAdViews = [NSArray arrayWithArray:views];
    if (self.expressAdViews.count) {
        [self.expressAdViews enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            GDTNativeExpressAdView *expressView = (GDTNativeExpressAdView *)obj;
            expressView.controller = [self topViewController];;
            [expressView render];
        }];
    }
    // å¹¿å‘Šä½ render åŽåˆ·æ–°
    [_collview reloadData];
}
- (void)nativeExpressAdFailToLoad:(GDTNativeExpressAd *)nativeExpressAd error:(NSError *)error{
    NSLog(@"%@",error);
}
- (UIViewController *)_topViewController:(UIViewController *)vc {
@@ -297,7 +292,7 @@
            [self clickRemoveAd:nil];
            
            [view addSubview:self.bannerView];
            [self.bannerView loadAdAndShow];
            [self.bannerView loadAdData];
        }
        return view;
Podfile
@@ -2,7 +2,9 @@
#source 'https://gitee.com/mirrors/CocoaPods-Specs.git'
#source 'https://github.com/volcengine/volcengine-specs.git'
#source 'http://repo.baichuan-ios.taobao.com/baichuanSDK/AliBCSpecs.git'
platform :ios, '10.0'
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/volcengine/volcengine-specs.git'
platform :ios, '12.0'
#platform :ios, '13.0'
install! 'cocoapods', :disable_input_output_paths => true
use_frameworks!
@@ -22,30 +24,34 @@
  pod 'SDAutoLayout'
  pod 'IQKeyboardManager'
  pod 'SVProgressHUD'
  pod 'GDTMobSDK', '4.14.45'
  # ï»¿è…¾è®¯ï»¿å¹¿å‘Š
  pod 'GDTMobSDK', '4.15.10'
  # ï»¿ç™¾åº¦ï»¿å¹¿å‘Š
  pod 'BaiduMobAdSDK', '5.370'
  # ï»¿å¿«æ‰‹ï»¿å¹¿å‘Š
  pod 'KSAdSDK', '3.3.71'
  # GroMore SDK
  pod 'Ads-Fusion-CN-Beta','5.7.0.8', :subspecs => ['BUAdSDK','CSJMediation']
  pod 'BUAdTestMeasurement','5.6.0.5', :configuration => ['Debug']
  pod 'CSJMGdtAdapter','4.14.45.0'
  pod 'Ads-CN','6.6.1.0', :subspecs => ['BUAdSDK','CSJMediation']
  pod 'TTSDKFramework', '1.45.2.5-standard', :subspecs => [ 'Player-SR' ]
  pod 'RangersAPM', '5.1.3', :subspecs => [ 'Crash', 'EventMonitor', 'CN' ]
  pod 'RangersAppLog', '6.16.9', :subspecs => [ 'Log', 'Host/CN' ]
  pod 'GMBaiduAdapter', '5.370.1'
  pod 'GMGdtAdapter', '4.15.10.0'
  pod 'GMKsAdapter', '3.3.71.0'
  # LCDSDK,版本号以赋能平台生成的Pod命令为准
  pod 'Pangrowth', '3.9.0.2', :subspecs => ['media']
  # AppLog SDK
  # pod 'RangersAppLog', '~> 5.6.6',
  #       :subspecs => ['Core', 'Log', 'Host/CN'],
  #       :source=> 'https://github.com/bytedance/cocoapods_sdk_source_repo.git'
  # ç©¿å±±ç”²SDK,版本号以赋能平台生成的Pod命令为准
  # pod 'Ads-CN'
  # APMInsight SDK
  pod 'RangersAPM', '3.3.1', :subspecs => [
       'Core',
       'Public',
       'Crash',
       'HMD',
       'EventMonitor'
   ], :source => 'https://github.com/volcengine/volcengine-specs.git'
   pod 'Toast', '~> 4.0.0'
#  pod 'Pangrowth', '5.0.0.0', :subspecs => [ 'media', 'djx-lite', 'nov' ]
  pod 'Pangrowth', '5.3.0.0', :subspecs => [ 'media' ]
  pod 'PangrowthX', '2.7.0.0', :subspecs => [ 'shortplay','ministory' ]
  pod 'Toast', '~> 4.0.0'
#  pod 'Ads-Global'
  # å¾®ä¿¡ç™»å½•
  pod 'WechatOpenSDK-XCFramework'
end
def find_and_replace(dir, findstr, replacestr)
@@ -61,8 +67,24 @@
  Dir[dir + '*/'].each(&method(:find_and_replace))
end
post_install do |installer_representation|
  installer_representation.generated_projects.each do |project|
    project.targets.each do |target|
      if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
        target.build_configurations.each do |config|
          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
      target.build_configurations.each do |config|
        config.build_settings["ENABLE_MODULE_VERIFIER"] = "NO"
        config.build_settings["ENABLE_USER_SCRIPT_SANDBOXING"] = "NO"
        config.build_settings["CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER"] = "NO"
      end
    end
  end
  # çœç•¥
  # Xcode14问题补丁,升级后可以移除:https://github.com/CocoaPods/CocoaPods/pull/11828
  find_and_replace("./Pods/Target Support Files/Pods-projectName/Pods-projectName-frameworks.sh", 'source="$(readlink "${source}")"', 'source="$(readlink -f "${source}")"')
PrivacyInfo.xcprivacy
New file
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>NSPrivacyCollectedDataTypes</key>
        <array/>
        <key>NSPrivacyAccessedAPITypes</key>
        <array>
                <dict>
                        <key>NSPrivacyAccessedAPIType</key>
                        <string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
                        <key>NSPrivacyAccessedAPITypeReasons</key>
                        <array>
                                <string>C617.1</string>
                 <string>我们需要访问文件时间戳以便管理和同步用户的数据,确保应用功能的准确性和一致性。</string>
                        </array>
                </dict>
                <dict>
                        <key>NSPrivacyAccessedAPIType</key>
                        <string>NSPrivacyAccessedAPICategorySystemBootTime</string>
                        <key>NSPrivacyAccessedAPITypeReasons</key>
                        <array>
                                <string>35F9.1</string>
                 <string>我们需要访问系统启动时间以确保应用在启动时能够执行特定初始化任务,并优化用户体验。</string>
                        </array>
                </dict>
                <dict>
                        <key>NSPrivacyAccessedAPIType</key>
                        <string>NSPrivacyAccessedAPICategoryDiskSpace</string>
                        <key>NSPrivacyAccessedAPITypeReasons</key>
                        <array>
                                <string>7D9E.1</string>
                                <string>E174.1</string>
                <string>我们需要访问磁盘空间以便为用户缓存视频内容,从而提高播放性能和用户体验。</string>
                        </array>
                </dict>
                <dict>
                        <key>NSPrivacyAccessedAPIType</key>
                        <string>NSPrivacyAccessedAPICategoryUserDefaults</string>
                        <key>NSPrivacyAccessedAPITypeReasons</key>
                        <array>
                                <string>CA92.1</string>
                                <string>我们使用 UserDefaults æ¥å­˜å‚¨ç”¨æˆ·çš„偏好设置和应用状态,以便用户下次使用应用时可以快速恢复到之前的状态。</string>
                        </array>
                </dict>
        </array>
</dict>
</plist>
lib/TencentOpenAPI.framework/Headers/QQApiInterface.h
New file
@@ -0,0 +1,232 @@
///
/// \file QQApiInterface.h
/// \brief QQApi接口简化封装
///
/// Created by Tencent on 12-5-15.
/// Copyright (c) 2012å¹´ Tencent. All rights reserved.
///
#import <Foundation/Foundation.h>
#import "QQApiInterfaceObject.h"
typedef void (^sendResultBlock)(NSDictionary *result);
// å‘送消息回调是否发送成功
typedef void(^QQApiInterfaceSendMessageResultBlock)(QQApiSendResultCode sendResultCode, NSString *message);
/**
 \brief å¤„理来至QQ的请求及响应的回调协议
 */
@protocol QQApiInterfaceDelegate <NSObject>
/**
 å¤„理来至QQ的请求
 */
- (void)onReq:(QQBaseReq *)req;
/**
 å¤„理来至QQ的响应
 */
- (void)onResp:(QQBaseResp *)resp;
/**
 å¤„理QQ在线状态的回调
 */
- (void)isOnlineResponse:(NSDictionary *)response;
@end
/**
 \brief å¯¹QQApi的简单封装类
 */
@interface QQApiInterface : NSObject
/**
 å¤„理由手Q唤起的普通跳转请求
 \param url å¾…处理的url跳转请求
 \param delegate ç¬¬ä¸‰æ–¹åº”用用于处理来至QQ请求及响应的委托对象
 \return è·³è½¬è¯·æ±‚处理结果,YES表示成功处理,NO表示不支持的请求协议或处理失败
 */
+ (BOOL)handleOpenURL:(NSURL *)url delegate:(id<QQApiInterfaceDelegate>)delegate;
/**
 å¤„理由手Q唤起的universallink跳转请求
 \param universallink å¾…处理的universallink跳转请求
 \param delegate ç¬¬ä¸‰æ–¹åº”用用于处理来至QQ请求及响应的委托对象
 \return è·³è½¬è¯·æ±‚处理结果,YES表示成功处理,NO表示不支持的请求协议或处理失败
 */
+ (BOOL)handleOpenUniversallink:(NSURL*)universallink delegate:(id<QQApiInterfaceDelegate>)delegate;
/**
 å‘手Q发起分享请求
 \param req åˆ†äº«å†…容的请求
 \return è¯·æ±‚发送结果码
 */
+ (QQApiSendResultCode)sendReq:(QQBaseReq *)req;
/**
 å‘手Q QZone结合版发起分享请求
 \note H5分享只支持单张网络图片的传递
 \param req åˆ†äº«å†…容的请求
 \return è¯·æ±‚发送结果码
 */
+ (QQApiSendResultCode)SendReqToQZone:(QQBaseReq *)req;
/**
 å‘手Q发起设置QQ头像
 \param req åˆ†äº«å†…容的请求
 \return è¯·æ±‚发送结果码
 */
+ (QQApiSendResultCode)sendMessageToQQAvatarWithReq:(QQBaseReq*)req;
+ (QQApiSendResultCode)sendMessageToQQAuthWithReq:(QQBaseReq*)req;
/**
 å‘手Q发起绑群请求
 \param req è¯·æ±‚的内容
 \param resultBlock è¯·æ±‚回调
 */
+ (void)sendThirdAppBindGroupReq:(QQBaseReq *)req resultBlock:(sendResultBlock)resultBlock;
/**
 å‘手Q发起加群请求
 \param req è¯·æ±‚的内容
 \param resultBlock è¯·æ±‚回调
 */
+ (void)sendThirdAppJoinGroupReq:(QQBaseReq *)req resultBlock:(sendResultBlock)resultBlock;
/**
 å‘手Q发起解绑群请求
 \param req è¯·æ±‚的内容
 \param resultBlock è¯·æ±‚回调
 */
+ (void)sendThirdAppUnBindGroupReq:(QQBaseReq *)req resultBlock:(sendResultBlock)resultBlock;
/**
 å‘手Q发起创建QQ频道的请求
 \param req è¯·æ±‚的内容
 \param resultBlock å›žè°ƒå‘送结果
 \return void
 */
+ (void)sendMessageToCreateQQGroupProWithMessageRequest:(SendMessageToQQReq *)messageRequest sendResultBlock:(QQApiInterfaceSendMessageResultBlock)sendResultBlock;
/**
 å‘手Q发起加入QQ频道的请求
 \param req è¯·æ±‚的内容
 \param resultBlock å›žè°ƒå‘送结果
 \return void
 */
+ (void)sendMessageToJoinQQGroupProWithMessageRequest:(SendMessageToQQReq *)messageRequest sendResultBlock:(QQApiInterfaceSendMessageResultBlock)sendResultBlock;
/**
 å‘手Q发起查询QQ频道openID的请求
 \param req è¯·æ±‚的内容
 \param resultBlock è¯·æ±‚回调
 */
+ (void)sendQueryQQGroupProInfo:(QQBaseReq *)req resultBlock:(sendResultBlock)resultBlock;
/**
 å‘手Q发起组图分享到表情收藏
 \param req åˆ†äº«å†…容的请求
 \return è¯·æ±‚发送结果码
 */
+ (QQApiSendResultCode)sendMessageToFaceCollectionWithReq:(QQBaseReq*)req;
/**
 æ£€æµ‹æ˜¯å¦å·²å®‰è£…QQ
 \return å¦‚æžœQQ已安装则返回YES,否则返回NO
 \note SDK目前已经支持QQ、TIM授权登录及分享功能, ä¼šæŒ‰ç…§QQ>TIM的顺序进行调用。
 åªè¦ç”¨æˆ·å®‰è£…了QQ、TIM中任意一个应用,都可为第三方应用进行授权登录、分享功能。
 ç¬¬ä¸‰æ–¹åº”用在接入SDK时不需要判断是否安装QQ、TIM。若有判断安装QQ、TIM的逻辑建议移除。
 */
+ (BOOL)isQQInstalled;
/**
 æ£€æµ‹æ˜¯å¦å·²å®‰è£…TIM
 \return å¦‚æžœTIM已安装则返回YES,否则返回NO
 \note SDK目前已经支持QQ、TIM授权登录及分享功能, ä¼šæŒ‰ç…§QQ>TIM的顺序进行调用。
 åªè¦ç”¨æˆ·å®‰è£…了QQ、TIM中任意一个应用,都可为第三方应用进行授权登录、分享功能。
 ç¬¬ä¸‰æ–¹åº”用在接入SDK时不需要判断是否安装QQ、TIM。若有判断安装QQ、TIM的逻辑建议移除。
 */
+ (BOOL)isTIMInstalled;
/**
 æ£€æµ‹QQ是否支持API调用
 \return å¦‚果当前安装QQ版本支持API调用则返回YES,否则返回NO
 */
+ (BOOL)isQQSupportApi;
/**
 æ£€æµ‹TIM是否支持API调用
 \return å¦‚果当前安装TIM版本支持API调用则返回YES,否则返回NO
 */
+ (BOOL)isTIMSupportApi __attribute__((deprecated("已过期, å»ºè®®åˆ é™¤è°ƒç”¨ï¼Œè°ƒç”¨åœ°æ–¹ç”¨YES替代。")));
/**
 æ£€æµ‹æ˜¯å¦æ”¯æŒåˆ†äº«
 \return å¦‚果当前已安装QQ且QQ版本支持API调用 æˆ–者 å½“前已安装TIM且TIM版本支持API调用则返回YES,否则返回NO
 */
+ (BOOL)isSupportShareToQQ;
/**
 æ£€æµ‹æ˜¯å¦æ”¯æŒåˆ†äº«åˆ°QQ结合版QZone
 \return å¦‚果当前已安装QQ且QQ版本支持API调用则返回YES,否则返回NO
 */
+ (BOOL)isSupportPushToQZone;
/**
 å¯åЍQQ
 \return æˆåŠŸè¿”å›žYES,否则返回NO
 */
+ (BOOL)openQQ;
/**
 å¯åЍTIM
 \return æˆåŠŸè¿”å›žYES,否则返回NO
 */
+ (BOOL)openTIM;
/**
 èŽ·å–QQ下载地址
 å¦‚æžœApp通过<code>QQApiInterface#isQQInstalled</code>和<code>QQApiInterface#isQQSupportApi</code>检测发现QQ没安装或当前版本QQ不支持API调用,可引导用户通过打开此链接下载最新版QQ。
 \return iPhoneQQ下载地址
 */
+ (NSString *)getQQInstallUrl;
/**
 èŽ·å–TIM下载地址
 å¦‚æžœApp通过<code>QQApiInterface#isTIMInstalled</code>检测发现TIM没安装或当前版本TIM不支持API调用,可引导用户通过打开此链接下载最新版TIM。
 \return iPhoneTIM下载地址
 */
+ (NSString *)getTIMInstallUrl;
#pragma mark - Log
/*! @brief è°ƒç”¨æ­¤å‡½æ•°å¯ä»¥å¯¼å‡ºQQSDK的Log到第三方中,用于定位问题
    æ³¨æ„1:SDK会强引用这个block,注意不要导致内存泄漏,注意不要导致内存泄漏
    æ³¨æ„2:调用过一次startLog by block之后,如果再调用一次任意方式的startLoad,会释放上一次logBlock,不再回调上一个logBlock
 *
 *  @param logBlock æ‰“印log的回调block
 */
+ (void)startLogWithBlock:(QQApiLogBolock)logBlock;
///停止回调打印
+ (void)stopLog;
///设置打印日志到文件开关on/off,如果不设置,默认不打印到文件
+ (void)setSwitchPrintLogToFile:(BOOL)on;
///日志文件目录
+ (NSString *)getLogFilePath;
@end
lib/TencentOpenAPI.framework/Headers/QQApiInterfaceObject.h
New file
@@ -0,0 +1,754 @@
///
/// \file QQApiInterfaceObject.h
/// \brief QQApiInterface所依赖的请求及应答消息对象封装帮助类
///
/// Created by Tencent on 12-5-15.
/// Copyright (c) 2012å¹´ Tencent. All rights reserved.
///
#ifndef QQApiInterface_QQAPIOBJECT_h
#define QQApiInterface_QQAPIOBJECT_h
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, QQApiSendResultCode) {
    EQQAPISENDSUCESS                                 = 0,
    EQQAPIQQNOTINSTALLED                             = 1,   // QQ未安装
    EQQAPIQQNOTSUPPORTAPI                            = 2,   // QQ api不支持
    EQQAPIMESSAGETYPEINVALID                         = 3,
    EQQAPIMESSAGECONTENTNULL                         = 4,
    EQQAPIMESSAGECONTENTINVALID                      = 5,
    EQQAPIAPPNOTREGISTED                             = 6,
    EQQAPIAPPSHAREASYNC                              = 7,
    EQQAPIQQNOTSUPPORTAPI_WITH_ERRORSHOW             = 8,   // QQ api不支持 && SDK显示error提示(已废弃)
    EQQAPIMESSAGEARKCONTENTNULL                      = 9,   // ark内容为空
    EQQAPIMESSAGE_MINI_CONTENTNULL                   = 10,  // å°ç¨‹åºå‚数为空
    EQQAPISENDFAILD                                  = -1,  // å‘送失败
    EQQAPISHAREDESTUNKNOWN                           = -2,  // æœªæŒ‡å®šåˆ†äº«åˆ°QQ或TIM
    EQQAPITIMSENDFAILD                               = -3,  // å‘送失败
    EQQAPITIMNOTINSTALLED                            = 11,  // TIM未安装
    EQQAPITIMNOTSUPPORTAPI                           = 12,  // TIM api不支持
    EQQAPI_INCOMING_PARAM_ERROR                      = 13,  // å¤–部传参错误
    EQQAPI_THIRD_APP_GROUP_ERROR_APP_NOT_AUTHORIZIED = 14,  // APP未获得授权
    EQQAPI_THIRD_APP_GROUP_ERROR_CGI_FAILED          = 15,  // CGI请求失败
    EQQAPI_THIRD_APP_GROUP_ERROR_HAS_BINDED          = 16,  // è¯¥ç»„织已经绑定群聊
    EQQAPI_THIRD_APP_GROUP_ERROR_NOT_BINDED          = 17,  // è¯¥ç»„织尚未绑定群聊
    EQQAPI_THIRD_APP_GROUP_ERROR_HAS_UNBINDED        = 18,  // è¯¥ç»„织已经解绑群聊
    EQQAPIQZONENOTSUPPORTTEXT                        = 10000,   // qzone分享不支持text类型分享
    EQQAPIQZONENOTSUPPORTIMAGE                       = 10001,   // qzone分享不支持image类型分享
    EQQAPIVERSIONNEEDUPDATE                          = 10002,   // å½“前QQ版本太低,需要更新至新版本才可以支持
    ETIMAPIVERSIONNEEDUPDATE                         = 10004,   // å½“前TIM版本太低,需要更新至新版本才可以支持
    EAPPURLTYPESILLEGALITY                           = 20000,   // (>=3.3.8)第三方APP的info.plist中UrlTypes字段存在QQ的UrlScheme
    EQQAPI_ERROR_USER_NOT_AGREED_AUTHORIZATION       = 30001,   // ç”¨æˆ·æœªåŒæ„éšç§åè®®ï¼Œç”¨æˆ·åŒæ„éšç§åè®®åŽï¼Œéœ€è¦è®¾ç½®[TencentOAuth setIsUserAgreedAuthorization:YES];
};
#pragma mark - QQApiObject(分享对象类型)
// QQApiObject control flags
typedef NS_ENUM(NSUInteger,kQQAPICtrlFlag) {
    kQQAPICtrlFlagQZoneShareOnStart         = 0x01,
    kQQAPICtrlFlagQZoneShareForbid          = 0x02, //屏蔽好友选择器上的空间入口
    kQQAPICtrlFlagQQShare                   = 0x04,
    kQQAPICtrlFlagQQShareFavorites          = 0x08, //收藏
    kQQAPICtrlFlagQQShareDataline           = 0x10, //数据线
    kQQAPICtrlFlagQQShareEnableArk          = 0x20, //支持ARK
    kQQAPICtrlFlagQQShareEnableMiniProgram  = 0x40, //支持小程序
};
// åˆ†äº«åˆ°QQ或TIM
typedef NS_ENUM(NSUInteger, ShareDestType) {
    ShareDestTypeQQ = 0,
    ShareDestTypeTIM,
};
//小程序的类型
typedef NS_ENUM(NSUInteger, MiniProgramType) {
    MiniProgramType_Develop = 0,    // å¼€å‘版
    MiniProgramType_Test    = 1,    // æµ‹è¯•版
    MiniProgramType_Online  = 3,    // æ­£å¼ç‰ˆ,默认
    MiniProgramType_Preview = 4,    // é¢„览版
};
/// æ‰“印回调的block
typedef void(^QQApiLogBolock)(NSString *logStr);
// QQApiObject
/** \brief æ‰€æœ‰åœ¨QQ及插件间发送的数据对象的根类。
 */
__attribute__((visibility("default"))) @interface QQApiObject : NSObject
@property (nonatomic, copy) NSString *title; ///< æ ‡é¢˜ï¼Œæœ€é•¿128个字符
@property (nonatomic, copy) NSString *description; ///<简要描述,最长512个字符
@property (nonatomic, copy) NSString *universalLink; ///(>=3.3.7)支持第三方传入在互联开放平台注册的universallink
@property (nonatomic, assign) uint64_t cflag;
//353新增两个字断给游戏侧使用,对齐微信sdk
@property (nonatomic, copy) NSString *tagName;
@property (nonatomic, copy) NSString *messageExt;
/*
 * åˆ†äº«åˆ°QQ/TIM
 * SDK根据是否安装对应客户端进行判断,判断顺序:QQ > TIM
 * é»˜è®¤åˆ†äº«åˆ°QQ,如果QQ未安装检测TIM是否安装
 */
@property (nonatomic, assign) ShareDestType shareDestType;
@end
// ArkObject
/** \brief æ”¯æŒArk的根类。
 */
__attribute__((visibility("default"))) @interface ArkObject : NSObject
@property (nonatomic, copy) NSString *arkData; ///< æ˜¾ç¤ºArk所需的数据,json串,长度暂不限制
@property (nonatomic,assign) QQApiObject* qqApiObject; ///<原有老版本的QQApiObject
- (id)initWithData:(NSString *)arkData qqApiObject:(QQApiObject*)qqApiObject;
+ (id)objectWithData:(NSString *)arkData qqApiObject:(QQApiObject*)qqApiObject;
@end
#pragma mark QQ小程序
//分享小程序消息 - QQ 8.0.8
__attribute__((visibility("default"))) @interface QQApiMiniProgramObject : NSObject
@property (nonatomic, strong) QQApiObject* qqApiObject; //原有老版本的QQApiObject
@property (nonatomic, copy) NSString *miniAppID; //必填,小程序的AppId(注:必须在QQ互联平台中,将该小程序与分享的App绑定)
@property (nonatomic, copy) NSString *miniPath; //必填,小程序的展示路径
@property (nonatomic, copy) NSString *webpageUrl; //必填,兼容低版本的网页链接
@property (nonatomic,assign) MiniProgramType miniprogramType; //非必填,小程序的类型,默认正式版(3),可选测试版(1)、预览版(4)
@end
//唤起小程序 - QQ 8.1.8
__attribute__((visibility("default"))) @interface QQApiLaunchMiniProgramObject : QQApiObject
@property (nonatomic, copy) NSString *miniAppID; //必填,小程序的AppId(注:必须在QQ互联平台中,将该小程序与分享的App绑定)
@property (nonatomic, copy) NSString *miniPath; //小程序的展示路径,不填展示默认小程序首页
@property (nonatomic,assign) MiniProgramType miniprogramType; //非必填,小程序的类型,默认正式版(3),可选测试版(1)、开发版(0)
@end
//小程序唤起第三方 - SDK 3.3.9
__attribute__((visibility("default"))) @interface QQApiMiniProgramLaunchObject : QQApiObject
@property (nonatomic, copy) NSString *appParameter; //小程序带来的数据,透传
+ (instancetype)newWithAppParameter:(NSString *)parameter;
@end
// QQApiResultObject
/** \brief ç”¨äºŽè¯·æ±‚回应的数据类型。
 <h3>可能错误码及描述如下:</h3>
 <TABLE>
 <TR><TD>error</TD><TD>errorDescription</TD><TD>注释</TD></TR>
 <TR><TD>0</TD><TD>nil</TD><TD>成功</TD></TR>
 <TR><TD>-1</TD><TD>param error</TD><TD>参数错误</TD></TR>
 <TR><TD>-2</TD><TD>group code is invalid</TD><TD>该群不在自己的群列表里面</TD></TR>
 <TR><TD>-3</TD><TD>upload photo failed</TD><TD>上传图片失败</TD></TR>
 <TR><TD>-4</TD><TD>user give up the current operation</TD><TD>用户放弃当前操作</TD></TR>
 <TR><TD>-5</TD><TD>client internal error</TD><TD>客户端内部处理错误</TD></TR>
 </TABLE>
 */
__attribute__((visibility("default"))) @interface QQApiResultObject : QQApiObject
@property (nonatomic, copy) NSString *error; ///<错误
@property (nonatomic, copy) NSString *errorDescription; ///<错误描述
@property (nonatomic, copy) NSString *extendInfo; ///<扩展信息
@property (nonatomic, copy) NSDictionary *otherInfo; ///<其他扩展信息
@end
// QQApiTextObject
/** \brief æ–‡æœ¬å¯¹è±¡
 */
@interface QQApiTextObject : QQApiObject
@property (nonatomic, copy)NSString *text; ///<文本内容,必填,最长1536个字符
- (id)initWithText:(NSString *)text; ///<初始化方法
+ (id)objectWithText:(NSString *)text;///<工厂方法,获取一个QQApiTextObject对象.
@end
// QQApiURLObject
typedef NS_ENUM(NSUInteger, QQApiURLTargetType) {
    QQApiURLTargetTypeNotSpecified = 0x00,
    QQApiURLTargetTypeAudio   = 0x01,
    QQApiURLTargetTypeVideo   = 0x02,
    QQApiURLTargetTypeNews    = 0x03
};
/** @brief URL对象类型。
 åŒ…括URL地址,URL地址所指向的目标类型及预览图像。
 */
__attribute__((visibility("default"))) @interface QQApiURLObject : QQApiObject
/**
 URL地址所指向的目标类型.
 @note å‚见QQApi.h ä¸­çš„ QQApiURLTargetType å®šä¹‰.
 */
@property (nonatomic)QQApiURLTargetType targetContentType;
@property (nonatomic, strong) NSURL *url; ///<URL地址,必填,最长512个字符
@property (nonatomic, copy) NSData *previewImageData;///<预览图像数据,最大1M字节
@property (nonatomic, strong) NSURL *previewImageURL;    ///<预览图像URL **预览图像数据与预览图像URL可二选一
/**
 åˆå§‹åŒ–方法
 */
- (id)initWithURL:(NSURL *)url title:(NSString *)title description:(NSString *)description previewImageData:(NSData *)data targetContentType:(QQApiURLTargetType)targetContentType;
- (id)initWithURL:(NSURL *)url title:(NSString *)title description:(NSString *)description previewImageURL:(NSURL *)previewURL targetContentType:(QQApiURLTargetType)targetContentType;
/**
 å·¥åŽ‚æ–¹æ³•,获取一个QQApiURLObject对象
 */
+ (id)objectWithURL:(NSURL *)url title:(NSString *)title description:(NSString *)description previewImageData:(NSData *)data targetContentType:(QQApiURLTargetType)targetContentType;
+ (id)objectWithURL:(NSURL *)url title:(NSString *)title description:(NSString *)description previewImageURL:(NSURL *)previewURL targetContentType:(QQApiURLTargetType)targetContentType;
@end
// QQApiExtendObject
/** @brief æ‰©å±•数据类型
 */
@interface QQApiExtendObject : QQApiObject
@property (nonatomic, copy) NSData *data;///<具体数据内容,必填,最大5M字节
@property (nonatomic, copy) NSData *previewImageData;///<预览图像,最大1M字节
@property (nonatomic, copy) NSArray *imageDataArray;///图片数组(多图暂只支持分享到手机QQ收藏功能)
/**
 åˆå§‹åŒ–方法
 @param data æ•°æ®å†…容
 @param previewImageData ç”¨äºŽé¢„览的图片
 @param title æ ‡é¢˜
 @param description æ­¤å¯¹è±¡ï¼Œåˆ†äº«çš„æè¿°
 */
- (id)initWithData:(NSData *)data previewImageData:(NSData *)previewImageData title:(NSString *)title description:(NSString *)description;
/**
 åˆå§‹åŒ–方法
 @param data æ•°æ®å†…容
 @param title æ ‡é¢˜
 @param description æ­¤å¯¹è±¡ï¼Œåˆ†äº«çš„æè¿°
 @param imageDataArray å‘送的多张图片队列
 */
- (id)initWithData:(NSData *)data previewImageData:(NSData *)previewImageData title:(NSString *)title description:(NSString *)description imageDataArray:(NSArray *)imageDataArray;
/**
 helper方法获取一个autorelease的<code>QQApiExtendObject</code>对象
 @param data æ•°æ®å†…容
 @param previewImageData ç”¨äºŽé¢„览的图片
 @param title æ ‡é¢˜
 @param description æ­¤å¯¹è±¡ï¼Œåˆ†äº«çš„æè¿°
 @return
 ä¸€ä¸ªè‡ªåŠ¨é‡Šæ”¾çš„<code>QQApiExtendObject</code>实例
 */
+ (id)objectWithData:(NSData *)data previewImageData:(NSData *)previewImageData title:(NSString *)title description:(NSString *)description;
/**
 helper方法获取一个autorelease的<code>QQApiExtendObject</code>对象
 @param data æ•°æ®å†…容
 @param previewImageData ç”¨äºŽé¢„览的图片
 @param title æ ‡é¢˜
 @param description æ­¤å¯¹è±¡ï¼Œåˆ†äº«çš„æè¿°
 @param imageDataArray å‘送的多张图片队列
 @return
 ä¸€ä¸ªè‡ªåŠ¨é‡Šæ”¾çš„<code>QQApiExtendObject</code>实例
 */
+ (id)objectWithData:(NSData *)data previewImageData:(NSData *)previewImageData title:(NSString *)title description:(NSString *)description imageDataArray:(NSArray *)imageDataArray;
@end
// QQApiImageObject
/** @brief å›¾ç‰‡å¯¹è±¡
 ç”¨äºŽåˆ†äº«å›¾ç‰‡å†…容的对象,是一个指定为图片类型的<code>QQApiExtendObject</code>
 */
@interface QQApiImageObject : QQApiExtendObject
@end
// QQApiImageForQQAvatarObject
/** @brief å›¾ç‰‡å¯¹è±¡
 ç”¨äºŽè®¾ç½®QQ头像内容的对象,是一个指定为图片类型的<code>QQApiExtendObject</code>
 */
@interface QQApiImageForQQAvatarObject : QQApiExtendObject
@end
/**
 * @brief è§†é¢‘对象
 * ç”¨äºŽè®¾ç½®åŠ¨æ€å¤´åƒ
 * assetURL可传ALAsset的ALAssetPropertyAssetURL,或者PHAsset的localIdentifier
 ä»Žæ‰‹Q返回的错误码:
 //第三方设置动态头像结果
 @"ret=0"//设置成功
 @"ret=-10&error_des=user cancel"//用户取消设置
 @"ret=-11&error_des=pasteboard have no video data"//剪切板没有数据
 @"ret=-12&error_des=export data failed"//从剪切板导出数据到本地失败
 @"ret=-13&error_des=url param invalid"//sdk传递过来的数据有误
 @"ret=-14&error_des=video param invalid"//视频的参数不符合要求(检测第三方视频源方案:1、分辨率跟480*480保持一致;2、视频长度0.5s~8s)
 @"ret=-15&error_des=app authorised failed"//应用鉴权失败
 @"ret=-16&error_des=upload video failed"//设置头像,上传到后台失败
 @"ret=-17&error_des=account diff"//账号不一致
 */
@interface QQApiVideoForQQAvatarObject : QQApiExtendObject
@property (nonatomic, copy) NSString *assetURL;
@end
//QQApiAuthObject ç”¨äºŽæ‹‰èµ·æ‰‹Q的授权详情页
@interface QQApiAuthObject : QQApiObject
@end
// QQApiImageArrayForFaceCollectionObject
/** @brief å›¾ç‰‡æ•°ç»„对象
   ç”¨äºŽåˆ†äº«å›¾ç‰‡ç»„到表情收藏,是一个指定为图片类型的<code>QQApiObject</code>
 */
@interface QQApiImageArrayForFaceCollectionObject : QQApiObject
@property (nonatomic, copy) NSArray *imageDataArray;///图片数组
/**
 åˆå§‹åŒ–方法
 @param imageDataArray å›¾ç‰‡æ•°ç»„
 */
- (id)initWithImageArrayData:(NSArray *)imageDataArray;
/**
 helper方法获取一个autorelease的<code>QQApiObject</code>对象
 @param imageDataArray å‘送的多张图片队列
 @return
 ä¸€ä¸ªè‡ªåŠ¨é‡Šæ”¾çš„<code>QQApiObject</code>实例
 */
+ (id)objectWithimageDataArray:(NSArray *)imageDataArray;
@end
// QQApiImageArrayForQZoneObject
/** @brief å›¾ç‰‡å¯¹è±¡
 ç”¨äºŽåˆ†äº«å›¾ç‰‡åˆ°ç©ºé—´ï¼Œèµ°å†™è¯´è¯´è·¯å¾„,是一个指定为图片类型的,当图片数组为空时,默认走文本写说说<code>QQApiObject</code>
 */
@interface QQApiImageArrayForQZoneObject : QQApiObject
@property (nonatomic, copy) NSArray *imageDataArray;///图片数组
@property (nonatomic, copy) NSDictionary *extMap; // æ‰©å±•字段
/**
 åˆå§‹åŒ–方法
 @param imageDataArray å›¾ç‰‡æ•°ç»„
 @param title å†™è¯´è¯´çš„内容,可以为空
 @param extMap æ‰©å±•字段
 */
- (id)initWithImageArrayData:(NSArray *)imageDataArray title:(NSString *)title extMap:(NSDictionary *)extMap;
/**
 helper方法获取一个autorelease的<code>QQApiExtendObject</code>对象
 @param title å†™è¯´è¯´çš„内容,可以为空
 @param imageDataArray å‘送的多张图片队列
 @param extMap æ‰©å±•字段
 @return
 ä¸€ä¸ªè‡ªåŠ¨é‡Šæ”¾çš„<code>QQApiExtendObject</code>实例
 */
+ (id)objectWithimageDataArray:(NSArray *)imageDataArray title:(NSString *)title extMap:(NSDictionary *)extMap;
@end
// QQApiVideoForQZoneObject
/** @brief è§†é¢‘对象
 ç”¨äºŽåˆ†äº«è§†é¢‘到空间,走写说说路径<code>QQApiObject</code>,assetURL和videoData两个参数必须设置至少一个参数,如果assetURL设置了忽略videoData参数
 @param assetURL可传ALAsset的ALAssetPropertyAssetURL,或者PHAsset的localIdentifier
 @param extMap æ‰©å±•字段
 @param videoData è§†é¢‘数据,大小不超过50M
 */
@interface QQApiVideoForQZoneObject : QQApiObject
@property (nonatomic, copy) NSString *assetURL;
@property (nonatomic, copy) NSDictionary *extMap; // æ‰©å±•字段
@property (nonatomic, copy) NSData *videoData;
- (id)initWithAssetURL:(NSString *)assetURL title:(NSString *)title extMap:(NSDictionary *)extMap;
+ (id)objectWithAssetURL:(NSString *)assetURL title:(NSString *)title extMap:(NSDictionary *)extMap;
- (id)initWithVideoData:(NSData *)videoData title:(NSString *)title extMap:(NSDictionary *)extMap;
+ (id)objectWithVideoData:(NSData *)videoData title:(NSString *)title extMap:(NSDictionary *)extMap;
@end
// QQApiWebImageObject
/** @brief å›¾ç‰‡å¯¹è±¡
 ç”¨äºŽåˆ†äº«ç½‘络图片内容的对象,是一个指定网络图片url的: è¯¥ç±»åž‹åªåœ¨2.9.0的h5分享中才支持,
 åŽŸæœ‰çš„æ‰‹q分享是不支持该类型的。
 */
@interface QQApiWebImageObject : QQApiObject
@property (nonatomic, strong) NSURL *previewImageURL;    ///<预览图像URL
/**
 åˆå§‹åŒ–方法
 @param previewImageURL ç”¨äºŽé¢„览的图片
 @param title æ ‡é¢˜
 @param description æ­¤å¯¹è±¡ï¼Œåˆ†äº«çš„æè¿°
 */
- (id)initWithPreviewImageURL:(NSURL *)previewImageURL title:(NSString *)title description:(NSString *)description;
/**
 helper方法获取一个autorelease的<code>QQApiWebImageObject</code>对象
 @param previewImageURL ç”¨äºŽé¢„览的图片
 @param title æ ‡é¢˜
 @param description æ­¤å¯¹è±¡ï¼Œåˆ†äº«çš„æè¿°
 */
+ (id)objectWithPreviewImageURL:(NSURL *)previewImageURL title:(NSString *)title description:(NSString *)description;
@end
//QQApiFileObject
/** @brief æœ¬åœ°æ–‡ä»¶å¯¹è±¡(暂只支持分享到手机QQ数据线功能)
 ç”¨äºŽåˆ†äº«æ–‡ä»¶å†…容的对象,是一个指定为文件类型的<code>QQApiExtendObject</code>
 */
@interface QQApiFileObject : QQApiExtendObject {
    NSString *_fileName;
}
@property (nonatomic, copy)NSString *fileName;
@end
// QQApiAudioObject
/** @brief éŸ³é¢‘URL对象
 ç”¨äºŽåˆ†äº«ç›®æ ‡å†…容为音频的URL的对象
 */
@interface QQApiAudioObject : QQApiURLObject
@property (nonatomic, strong) NSURL *flashURL;      ///<音频URL地址,最长512个字符
/**
 èŽ·å–ä¸€ä¸ªautorelease的<code>QQApiAudioObject</code>
 @param url éŸ³é¢‘内容的目标URL
 @param title åˆ†äº«å†…容的标题
 @param description åˆ†äº«å†…容的描述
 @param data åˆ†äº«å†…容的预览图像
 @note å¦‚æžœurl为空,调用<code>QQApi#sendMessage:</code>时将返回FALSE
 */
+ (id)objectWithURL:(NSURL *)url title:(NSString *)title description:(NSString *)description previewImageData:(NSData *)data;
/**
 èŽ·å–ä¸€ä¸ªautorelease的<code>QQApiAudioObject</code>
 @param url éŸ³é¢‘内容的目标URL
 @param title åˆ†äº«å†…容的标题
 @param description åˆ†äº«å†…容的描述
 @param previewURL åˆ†äº«å†…容的预览图像URL
 @note å¦‚æžœurl为空,调用<code>QQApi#sendMessage:</code>时将返回FALSE
 */
+ (id)objectWithURL:(NSURL *)url title:(NSString *)title description:(NSString *)description previewImageURL:(NSURL *)previewURL;
@end
// QQApiVideoObject
/** @brief è§†é¢‘URL对象
 ç”¨äºŽåˆ†äº«ç›®æ ‡å†…容为视频的URL的对象
 QQApiVideoObject类型的分享,目前在Android和PC QQ上接收消息时,展现有待完善,待手机QQ版本以后更新支持
 ç›®å‰å¦‚果要分享视频,推荐使用 QQApiNewsObject ç±»åž‹
 */
@interface QQApiVideoObject : QQApiURLObject
@property (nonatomic, strong) NSURL *flashURL;      ///<视频URL地址,最长512个字符
/**
 èŽ·å–ä¸€ä¸ªautorelease的<code>QQApiVideoObject</code>
 @param url è§†é¢‘内容的目标URL
 @param title åˆ†äº«å†…容的标题
 @param description åˆ†äº«å†…容的描述
 @param data åˆ†äº«å†…容的预览图像
 @note å¦‚æžœurl为空,调用<code>QQApi#sendMessage:</code>时将返回FALSE
 */
+ (id)objectWithURL:(NSURL *)url title:(NSString *)title description:(NSString *)description previewImageData:(NSData *)data;
/**
 èŽ·å–ä¸€ä¸ªautorelease的<code>QQApiVideoObject</code>
 @param url è§†é¢‘内容的目标URL
 @param title åˆ†äº«å†…容的标题
 @param description åˆ†äº«å†…容的描述
 @param previewURL åˆ†äº«å†…容的预览图像URL
 @note å¦‚æžœurl为空,调用<code>QQApi#sendMessage:</code>时将返回FALSE
 */
+ (id)objectWithURL:(NSURL *)url title:(NSString *)title description:(NSString *)description previewImageURL:(NSURL *)previewURL;
@end
// QQApiNewsObject
/** @brief æ–°é—»URL对象
 ç”¨äºŽåˆ†äº«ç›®æ ‡å†…容为新闻的URL的对象
 */
@interface QQApiNewsObject : QQApiURLObject
/**
 èŽ·å–ä¸€ä¸ªautorelease的<code>QQApiNewsObject</code>
 @param url è§†é¢‘内容的目标URL
 @param title åˆ†äº«å†…容的标题
 @param description åˆ†äº«å†…容的描述
 @param data åˆ†äº«å†…容的预览图像
 @note å¦‚æžœurl为空,调用<code>QQApi#sendMessage:</code>时将返回FALSE
 */
+ (id)objectWithURL:(NSURL *)url title:(NSString *)title description:(NSString *)description previewImageData:(NSData *)data;
/**
 èŽ·å–ä¸€ä¸ªautorelease的<code>QQApiNewsObject</code>
 @param url è§†é¢‘内容的目标URL
 @param title åˆ†äº«å†…容的标题
 @param description åˆ†äº«å†…容的描述
 @param previewURL åˆ†äº«å†…容的预览图像URL
 @note å¦‚æžœurl为空,调用<code>QQApi#sendMessage:</code>时将返回FALSE
 */
+ (id)objectWithURL:(NSURL *)url title:(NSString *)title description:(NSString *)description previewImageURL:(NSURL *)previewURL;
@end
// QQApiCommonContentObject;
/** @brief é€šç”¨æ¨¡æ¿ç±»åž‹å¯¹è±¡
 ç”¨äºŽåˆ†äº«ä¸€ä¸ªå›ºå®šæ˜¾ç¤ºæ¨¡æ¿çš„图文混排对象
 @note å›¾ç‰‡åˆ—表和文本列表不能同时为空
 */
@interface QQApiCommonContentObject : QQApiObject
/**
 é¢„定义的界面布局类型
 */
@property (nonatomic,assign) unsigned int layoutType;
@property (nonatomic, copy) NSData *previewImageData;///<预览图
@property (nonatomic, copy) NSArray *textArray;///<文本列表
@property (nonatomic, copy) NSArray *pictureDataArray;///<图片列表
+ (id)objectWithLayoutType:(int)layoutType textArray:(NSArray *)textArray pictureArray:(NSArray *)pictureArray previewImageData:(NSData *)data;
/**
 å°†ä¸€ä¸ªNSDictionary对象转化为QQApiCommomContentObject,如果无法转换,则返回空
 */
+ (id)objectWithDictionary:(NSDictionary *)dic;
- (NSDictionary *)toDictionary;
@end
// QQApiExtraServiceObject; é€šç”¨ä¸šåŠ¡æ¶ˆæ¯å¤„ç†ç±»ï¼ˆæ—§ç‰ˆï¼ŒåŽç»­ä½¿ç”¨QQApiCommonServiceObject)
/**
 @brief OpenSDK扩展支持的服务,通用接口,后续会扩充能力
 @param serviceID [必选] æ‰©å±•支持的服务类型ID,参考官方文档说明
 @param openID    [必选] æŽˆæƒç™»å½•后对该用户的唯一标识
 @param toUin     [可选] å¯¹æ–¹çš„QQ号码
 @param extraInfo [可选] æ‰©å±•字段
 @note è¯¥æŽ¥å£çš„使用须先登录
 */
@interface QQApiExtraServiceObject : QQApiObject
@property (nonatomic, copy) NSString *serviceID;
@property (nonatomic, copy) NSString *openID;
@property (nonatomic, copy) NSString *toUin;
@property (nonatomic, copy) NSDictionary *extraInfo;
- (id)initWithOpenID:(NSString *)openID serviceID:(NSString *)serviceID;
+ (id)objecWithOpenID:(NSString *)openID serviceID:(NSString *)serviceID;
@end
/**
 * QQApiCommonServiceObject; é€šç”¨ä¸šåŠ¡æ¶ˆæ¯å¤„ç†ç±»ï¼ˆæ–°ï¼‰ï¼Œå¯ä»¥é€‚ç”¨æ‰€æœ‰çš„éœ€è¦é€šè¿‡äº’è”SDK发消息给手Q的业务去处理。
 * ä½¿ç”¨å‰éœ€è¦ç”³è¯·serviceID,每个业务功能有个对应的serviceID
 */
@interface QQApiCommonServiceObject : QQApiObject
// [必选] æŽˆæƒç™»å½•后对该用户的唯一标识
@property (nonatomic, copy) NSString *openID;
// [必选] æ‰©å±•支持的服务类型ID,参考官方文档说明
@property (nonatomic, copy) NSString *serviceID;
// [可选] æ‰©å±•字段,由调用方跟具体的业务方协定具体的字段
@property (nonatomic, copy) NSDictionary *extendInfo;
- (instancetype)initWithOpenID:(NSString *)openID
                     serviceID:(NSString *)serviceID
                    extendInfo:(NSDictionary *)extendInfo;
+ (instancetype)objecWithOpenID:(NSString *)openID
                      serviceID:(NSString *)serviceID
                     extendInfo:(NSDictionary *)extendInfo;
@end
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Ad item object definition
////////////////////////////////////////////////////////////////////////////////////////////////////////////
/** @brief å¹¿å‘Šæ•°æ®å¯¹è±¡
 */
@interface QQApiAdItem : NSObject
@property (nonatomic, copy) NSString *title; ///<名称
@property (nonatomic, copy) NSString *description;///<描述
@property (nonatomic, copy) NSData *imageData;///<广告图片
@property (nonatomic, strong) NSURL *target;///<广告目标链接
@end
#pragma mark - QQApi请求消息类型
/**
 QQApi请求消息类型
 */
typedef NS_ENUM(NSUInteger, QQApiInterfaceReqType) {
    EGETMESSAGEFROMQQREQTYPE      = 0,  /// < æ‰‹Q -> ç¬¬ä¸‰æ–¹åº”用,请求第三方应用向手Q发送消息
    ESENDMESSAGETOQQREQTYPE       = 1,  /// < ç¬¬ä¸‰æ–¹åº”用 -> æ‰‹Q,第三方应用向手Q分享消息
    ESHOWMESSAGEFROMQQREQTYPE     = 2,  /// < æ‰‹Q -> ç¬¬ä¸‰æ–¹åº”用,请求第三方应用展现消息中的数据
    ESENDMESSAGEARKTOQQREQTYPE    = 3,  /// < ç¬¬ä¸‰æ–¹åº”用 -> æ‰‹Q,第三方应用向手Q分享Ark消息
    ESENDMESSAGE_MINI_TOQQREQTYPE = 4   /// < ç¬¬ä¸‰æ–¹åº”用 -> æ‰‹Q,第三方应用向手Q分享小程序消息
};
/**
 QQApi应答消息类型
 */
typedef NS_ENUM(NSUInteger, QQApiInterfaceRespType) {
    ESHOWMESSAGEFROMQQRESPTYPE  = 0,    /// < ç¬¬ä¸‰æ–¹åº”用 -> æ‰‹Q,第三方应用应答消息展现结果
    EGETMESSAGEFROMQQRESPTYPE   = 1,    /// < ç¬¬ä¸‰æ–¹åº”用 -> æ‰‹Q,第三方应用回应发往手Q的消息
    ESENDMESSAGETOQQRESPTYPE    = 2     /// < æ‰‹Q -> ç¬¬ä¸‰æ–¹åº”用,手Q应答处理分享消息的结果
};
/**
 QQApi请求消息基类
 */
@interface QQBaseReq : NSObject
/** è¯·æ±‚消息类型,参见\ref QQApiInterfaceReqType */
@property (nonatomic, assign) int type;
@end
/**
 QQApi应答消息基类
 */
@interface QQBaseResp : NSObject
/** è¯·æ±‚处理结果 */
@property (nonatomic, copy) NSString *result;
/** å…·ä½“错误描述信息 */
@property (nonatomic, copy) NSString *errorDescription;
/** åº”答消息类型,参见\ref QQApiInterfaceRespType */
@property (nonatomic, assign) int type;
/** æ‰©å±•信息 */
@property (nonatomic, copy) NSString *extendInfo;
@end
/**
 GetMessageFromQQReq请求帮助类
 */
@interface GetMessageFromQQReq : QQBaseReq
/**
 åˆ›å»ºä¸€ä¸ªGetMessageFromQQReq请求实例
 */
+ (GetMessageFromQQReq *)req;
@end
@interface SendMessageToQQReq : QQBaseReq
/**
 åˆ›å»ºä¸€ä¸ªSendMessageToQQReq请求实例
 \param message å…·ä½“分享消息实例
 \return æ–°åˆ›å»ºçš„SendMessageToQQReq请求实例
 */
+ (SendMessageToQQReq *)reqWithContent:(QQApiObject *)message;
/**
 åˆ›å»ºä¸€ä¸ªæ”¯æŒArk的SendMessageToQQReq请求实例
 \param message å…·ä½“分享消息实例
 \return æ–°åˆ›å»ºçš„SendMessageToQQReq请求实例
 */
+ (SendMessageToQQReq *)reqWithArkContent:(ArkObject *)message;
/**
 * åˆ›å»ºä¸€ä¸ªæ”¯æŒå°ç¨‹åºçš„æ¶ˆæ¯è¯·æ±‚实例
 * @param miniMessage å°ç¨‹åºå®žä¾‹å¯¹è±¡
 * @return æ¶ˆæ¯è¯·æ±‚实例
 */
+ (SendMessageToQQReq *)reqWithMiniContent:(QQApiMiniProgramObject *)miniMessage;
/** å…·ä½“分享消息 */
@property (nonatomic, strong) QQApiObject *apiObject;
/** æ”¯æŒArk的具体分享消息 */
@property (nonatomic, strong) ArkObject *arkObject;
/** æ”¯æŒå°ç¨‹åºçš„具体分享消息 */
@property (nonatomic, strong) QQApiMiniProgramObject *miniProgramObject;
@end
/**
 SendMessageToQQResp应答帮助类
 */
@interface SendMessageToQQResp : QQBaseResp
/** å…¶ä»–扩展信息 */
@property (nonatomic, copy) NSDictionary *otherInfo;
/**
 åˆ›å»ºä¸€ä¸ªSendMessageToQQResp应答实例
 \param result è¯·æ±‚处理结果
 \param errDesp å…·ä½“错误描述信息
 \param extendInfo æ‰©å±•信息
 \return æ–°åˆ›å»ºçš„SendMessageToQQResp应答实例
 */
+ (SendMessageToQQResp *)respWithResult:(NSString *)result errorDescription:(NSString *)errDesp extendInfo:(NSString *)extendInfo;
+ (SendMessageToQQResp *) respWithResult:(NSString *)result errorDescription:(NSString *)errDesp extendInfo:(NSString *)extendInfo otherInfo:(NSDictionary *)otherInfo;
@end
/**
 ShowMessageFromQQReq请求帮助类
 */
@interface ShowMessageFromQQReq : QQBaseReq
/**
 åˆ›å»ºä¸€ä¸ªShowMessageFromQQReq请求实例
 \param message å…·ä½“待展现消息实例
 \return æ–°åˆ›å»ºçš„ShowMessageFromQQReq请求实例
 */
+ (ShowMessageFromQQReq *)reqWithContent:(QQApiObject *)message;
/** å…·ä½“待展现消息 */
@property (nonatomic, strong) QQApiObject *message;
@end
#pragma mark --一键加群&建群&解绑群
// QQApiThirdAppBindGroupObject
/** \brief ç¬¬ä¸‰æ–¹app绑定群
 */
@interface QQApiThirdAppBindGroupObject : QQApiObject
@property (nonatomic, copy) NSString *accessToken;
@property (nonatomic, copy) NSString *payToken;
@property (nonatomic, copy) NSString *pfkey;
@property (nonatomic, copy) NSString *unionID;
@property (nonatomic, copy) NSString *appDisplayName;
- (id)initWithAccessToken:(NSString *)accessToken payToken:(NSString *)payToken pfkey:(NSString *)pfkey unionID:(NSString *)unionID appDisplayName:(NSString *)appDisplayName; ///<初始化方法
+ (id)objectWithAccessToken:(NSString *)accessToken payToken:(NSString *)payToken pfkey:(NSString *)pfkey unionID:(NSString *)unionID appDisplayName:(NSString *)appDisplayName; ///<工厂方法,获取一个QQApiThirdAppBindGroupObject对象.
@end
// QQApiThirdAppJoinGroupObject
/** \brief ç¬¬ä¸‰æ–¹app加入群
 */
@interface QQApiThirdAppJoinGroupObject : QQApiObject
@property (nonatomic, copy) NSString *accessToken;
@property (nonatomic, copy) NSString *payToken;
@property (nonatomic, copy) NSString *pfkey;
@property (nonatomic, copy) NSString *unionID;
- (id)initWithAccessToken:(NSString *)accessToken payToken:(NSString *)payToken pfkey:(NSString *)pfkey unionID:(NSString *)unionID; ///<初始化方法
+ (id)objectWithAccessToken:(NSString *)accessToken payToken:(NSString *)payToken pfkey:(NSString *)pfkey unionID:(NSString *)unionID; ///<工厂方法,获取一个QQApiThirdAppJoinGroupObject对象.
@end
// QQApiThirdAppUnBindGroupObject
/** \brief ç¬¬ä¸‰æ–¹app解绑群
 */
@interface QQApiThirdAppUnBindGroupObject : QQApiObject
@property (nonatomic, copy) NSString *accessToken;
@property (nonatomic, copy) NSString *openId;
@property (nonatomic, copy) NSString *payToken;
@property (nonatomic, copy) NSString *pfkey;
@property (nonatomic, copy) NSString *unionID;
- (id)initWithAccessToken:(NSString *)accessToken payToken:(NSString *)payToken pfkey:(NSString *)pfkey unionID:(NSString *)unionID openId:(NSString *)openId appId:(NSString *)appId; ///<初始化方法
+ (id)objectWithAccessToken:(NSString *)accessToken payToken:(NSString *)payToken pfkey:(NSString *)pfkey unionID:(NSString *)unionID openId:(NSString *)openId appId:(NSString *)appId; ///<工厂方法,获取一个QQApiThirdAppBindGroupObject对象.
@end
#endif
lib/TencentOpenAPI.framework/Headers/TencentOAuth.h
New file
@@ -0,0 +1,516 @@
///
/// \file TencentOAuth.h
/// \brief QQ互联开放平台授权登录及相关开放接口实现类
///
/// Created by Tencent on 12-12-21.
/// Copyright (c) 2012å¹´ Tencent. All rights reserved.
///
#import <UIKit/UIKit.h>
#import "SDKDef.h"
@protocol TencentSessionDelegate;
@protocol TencentLoginDelegate;
@protocol TencentApiInterfaceDelegate;
@protocol TencentWebViewDelegate;
@class TencentApiReq;
@class TencentApiResp;
typedef NS_ENUM(NSUInteger, TencentAuthorizeState) {
    kTencentNotAuthorizeState,
    kTencentSSOAuthorizeState,
    kTencentWebviewAuthorzieState,
};
typedef NS_ENUM(NSUInteger, TencentAuthMode) {
    kAuthModeClientSideToken,
    kAuthModeServerSideCode,
};
#pragma mark - TencentOAuth(授权登录及相关开放接口调用)
/**
 * \brief TencentOpenAPI授权登录及相关开放接口调用
 *
 * TencentOAuth实现授权登录逻辑以及相关开放接口的请求调用
 */
@interface TencentOAuth : NSObject
{
    NSMutableDictionary *_apiRequests;
    NSString *_accessToken;
    NSDate *_expirationDate;
    id<TencentSessionDelegate> _sessionDelegate;
    NSString *_localAppId;
    NSString *_openId;
    NSString *_redirectURI;
    NSArray *_permissions;
}
/** Access Token凭证,用于后续访问各开放接口 */
@property(nonatomic, copy) NSString *accessToken;
/** Access Token的失效期 */
@property(nonatomic, copy) NSDate *expirationDate;
/** å·²å®žçŽ°çš„å¼€æ”¾æŽ¥å£çš„å›žè°ƒå§”æ‰˜å¯¹è±¡ */
@property(nonatomic, weak) id<TencentSessionDelegate> sessionDelegate;
/** ç¬¬ä¸‰æ–¹åº”用在开发过程中设置的URLSchema,用于浏览器登录后后跳到第三方应用 */
@property(nonatomic, copy) NSString *localAppId;
/** ç”¨æˆ·æŽˆæƒç™»å½•后对该用户的唯一标识 */
@property(nonatomic, copy) NSString *openId;
/** ç”¨æˆ·ç™»å½•成功过后的跳转页面地址 */
@property(nonatomic, copy) NSString *redirectURI;
/** ç¬¬ä¸‰æ–¹åº”用在互联开放平台申请的appID */
@property(nonatomic, retain) NSString *appId;
/** ç¬¬ä¸‰æ–¹åº”用在互联开放平台注册的UniversalLink */
@property(nonatomic, retain) NSString *universalLink;
/** ä¸»è¦æ˜¯äº’娱的游戏设置uin */
@property(nonatomic, retain) NSString *uin;
/** ä¸»è¦æ˜¯äº’娱的游戏设置鉴定票据 */
@property(nonatomic, retain) NSString *skey;
/** ç™»é™†é€ä¼ çš„æ•°æ® */
@property(nonatomic, copy) NSDictionary *passData;
/** æŽˆæƒæ–¹å¼(Client Side Token或者Server Side Code) */
@property(nonatomic, assign) TencentAuthMode authMode;
/** union id */
@property(nonatomic, retain) NSString *unionid;
/** ç¬¬ä¸‰æ–¹åœ¨æŽˆæƒç™»å½•/分享 æ—¶é€‰æ‹© QQ,还是TIM ã€‚在授权前一定要指定其中一个类型*/
@property(nonatomic, assign) TencentAuthShareType authShareType;
/** SDK打开web登录页,支持自动填充账号  */
@property (nonatomic, copy) NSString *defaultUin;
/**
 * èŽ·å–ä¸Šæ¬¡ç™»å½•å¾—åˆ°çš„token
 *
 **/
- (NSString *)getCachedToken;
/**
 * èŽ·å–ä¸Šæ¬¡ç™»å½•å¾—åˆ°çš„openid
 *
 **/
- (NSString *)getCachedOpenID;
/**
 * èŽ·å–ä¸Šæ¬¡ç™»å½•çš„token过期日期
 *
 **/
- (NSDate *)getCachedExpirationDate;
/**
 * ä¸Šæ¬¡ç™»å½•çš„token是否过期(本地判断)
 **/
- (BOOL)isCachedTokenValid;
/**
 * åˆ é™¤ä¸Šæ¬¡ç™»å½•登录的token信息
 *
 **/
- (BOOL)deleteCachedToken;
/**
 * åˆ é™¤openid
 *
 **/
- (void)deleteOpenId;
/**
 * ç”¨æ¥èŽ·å¾—å½“å‰sdk的版本号
 * \return è¿”回sdk版本号
 **/
+ (NSString *)sdkVersion;
/**
 * ç”¨æ¥èŽ·å¾—å½“å‰sdk的小版本号
 * \return è¿”回sdk小版本号
 **/
+ (NSString *)sdkSubVersion;
/**
 * ç”¨æ¥èŽ·å¾—å½“å‰sdk的是否精简版
 * \return è¿”回YES表示精简版
 **/
+ (BOOL)isLiteSDK;
/**
 * ä¸»è¦æ˜¯ç”¨æ¥å¸®åŠ©åˆ¤æ–­æ˜¯å¦æœ‰ç™»é™†è¢«å‘èµ·ï¼Œä½†æ˜¯è¿˜æ²¡æœ‰è¿‡è¿”å›žç»“æžœ
 * \return
 *          kTencentNotAuthorizeState:无授权
 *          kTencentSSOAuthorizeState:有人发起了sso授权但无返回
 *          kTencentWebviewAuthorzieState:有人发起了webview授权还未返回
 **/
+ (TencentAuthorizeState *)authorizeState;
/**
 * åˆå§‹åŒ–TencentOAuth对象
 * \param appId ä¸å¯ä¸ºnil,第三方应用在互联开放平台申请的唯一标识
 * \param delegate ä¸å¯ä¸ºnil,第三方应用用于接收请求返回结果的委托对象
 * \return åˆå§‹åŒ–后的授权登录对象
 */
- (id)initWithAppId:(NSString *)appId
        andDelegate:(id<TencentSessionDelegate>)delegate;
/**
* åˆå§‹åŒ–TencentOAuth对象(>=3.3.7)
* \param appId ä¸å¯ä¸ºnil,第三方应用在互联开放平台申请的唯一标识
* \param universalLink å¯ä»¥ä¸ºnil,第三方应用在互联开放平台注册的UniversalLink,和bundleID一一对应(当为nil时,互联平台会按规则生成universallink,详见官网说明)
* \param delegate ä¸å¯ä¸ºnil,第三方应用用于接收请求返回结果的委托对象
* \return åˆå§‹åŒ–后的授权登录对象
*
****【使用说明】*****
* 1、支持BundleId与UniversalLink的一一对应,主要目的“是为了解决应用的iPhone版本和iPad HD版本共用同一个AppId,导致同时安装情况下的跳转问题"。
* 2 ã€ç”±äºŽæ‰‹Q版本在 >=8.1.8 åŽæ‰æ”¯æŒäº†è¿™ç§å¯¹åº”方式,所以一旦使用,“务必做到”及时知会用户升级手Q版本。
****
*/
- (id)initWithAppId:(NSString *)appId
   andUniversalLink:(NSString *)universalLink
        andDelegate:(id<TencentSessionDelegate>)delegate;
/**
* åˆå§‹åŒ–TencentOAuth对象(>=3.3.8)
* \param appId ä¸å¯ä¸ºnil,第三方应用在互联开放平台申请的唯一标识
* \param enabled  é»˜è®¤ä¸ºNO,第三方应用是否将sdk和手机QQ的交互方式切换为UniversalLink方式,启用后则在iOS9及以上的系统都会生效UniversalLink方式;否则,默认仅在iOS13及以上的系统生效UniversalLink方式。
* \param universalLink å¯ä»¥ä¸ºnil,第三方应用在互联开放平台注册的UniversalLink,和bundleID一一对应(当为nil时,互联平台会按规则生成UniversalLink,详见官网说明)
* \param delegate ä¸å¯ä¸ºnil,第三方应用用于接收请求返回结果的委托对象
* \return åˆå§‹åŒ–后的授权登录对象
*
*****【使用说明】*****
*  1、支持sdk与手Q的交互切换为UniversalLink模式,主要目的"是为了避免手Q的UrlScheme被其他应用抢注后,导致sdk接口功能受到影响"。
*  2 ã€ç”±äºŽæ‰‹Q版本在 >=8.1.3 åŽæ‰é€‚配了UniversalLink,所以一旦开启了enabled开关,“务必做到”及时知会用户升级手Q版本。
*****
*/
- (id)initWithAppId:(NSString *)appId
 enableUniveralLink:(BOOL)enabled
      universalLink:(NSString *)universalLink
           delegate:(id<TencentSessionDelegate>)delegate;
/**
 * è®¾ç½®ç”¨æˆ·æ˜¯å¦å·²ç»æŽˆæƒåŒæ„æŽˆæƒéšç§åè®®ï¼Œåœ¨ä¸»ä½“应用中,用户同意授权隐私协议后再初始化互联SDK,默认未同意授权
 * æ³¨æ„ï¼šå¦‚未同意授权隐私协议,则互联SDK的所有功能都无法使用,包括初始化!!!
 * ä»Ž3.5.7版本开始支持该方法
 *
 * @param isAgreedAuthorization æ˜¯å¦å·²ç»æŽˆæƒï¼ŒisAgreedAuthorization=YES, è¡¨ç¤ºå·²ç»åŒæ„æŽˆæƒï¼›isAgreedAuthorization=NO,表示未同意授权,互联SDK的所有功能都无法使用
 */
+ (void)setIsUserAgreedAuthorization:(BOOL)isUserAgreedAuthorization;
/**
 * èŽ·å–å½“å‰ç”¨æˆ·æ˜¯å¦å·²ç»åŒæ„æŽˆæƒéšç§åè®®
 * ä»Ž3.5.7版本开始支持该方法
 */
+ (BOOL)isUserAgreedAuthorization;
/**
 * åˆ¤æ–­ç”¨æˆ·æ‰‹æœºä¸Šæ˜¯å¦å®‰è£…手机QQ
 * \return YES:安装 NO:没安装
 *
 * \note SDK目前已经支持QQ、TIM授权登录及分享功能, ä¼šæŒ‰ç…§QQ>TIM的顺序进行调用。
 * åªè¦ç”¨æˆ·å®‰è£…了QQ、TIM中任意一个应用,都可为第三方应用进行授权登录、分享功能。
 * ç¬¬ä¸‰æ–¹åº”用在接入SDK时不需要判断是否安装QQ、TIM。若有判断安装QQ、TIM的逻辑建议移除。
 */
+ (BOOL)iphoneQQInstalled;
/**
 * åˆ¤æ–­ç”¨æˆ·æ‰‹æœºä¸Šæ˜¯å¦å®‰è£…手机TIM
 * \return YES:安装 NO:没安装
 *
 * \note SDK目前已经支持QQ、TIM授权登录及分享功能, ä¼šæŒ‰ç…§QQ>TIM的顺序进行调用。
 * åªè¦ç”¨æˆ·å®‰è£…了QQ、TIM中任意一个应用,都可为第三方应用进行授权登录、分享功能。
 * ç¬¬ä¸‰æ–¹åº”用在接入SDK时不需要判断是否安装QQ、TIM。若有判断安装QQ、TIM的逻辑建议移除。
 */
+ (BOOL)iphoneTIMInstalled;
/**
 * ç™»å½•授权
 *
 * \param permissions æŽˆæƒä¿¡æ¯åˆ—
 */
- (BOOL)authorize:(NSArray *)permissions;
/**
 * ç™»å½•授权
 * \param permissions æŽˆæƒä¿¡æ¯åˆ—表
 * \param localAppId åº”用APPID
 */
- (BOOL)authorize:(NSArray *)permissions
       localAppId:(NSString *)localAppId;
/**
 * ç™»å½•授权<web为二维码扫码方式>
 *
 * \param permissions æŽˆæƒä¿¡æ¯åˆ—
 */
- (BOOL)authorizeWithQRlogin:(NSArray *)permissions;
/**
 * å¢žé‡æŽˆæƒï¼Œå› ç”¨æˆ·æ²¡æœ‰æŽˆäºˆç›¸åº”接口调用的权限,需要用户确认是否授权
 * \param permissions éœ€å¢žé‡æŽˆæƒçš„信息列表
 * \return å¢žé‡æŽˆæƒè°ƒç”¨æ˜¯å¦æˆåŠŸ
 */
- (BOOL)incrAuthWithPermissions:(NSArray *)permissions;
/**
 * é‡æ–°æŽˆæƒï¼Œå› token废除或失效导致接口调用失败,需用户重新授权
 * \param permissions æŽˆæƒä¿¡æ¯åˆ—表,同登录授权
 * \return æŽˆæƒè°ƒç”¨æ˜¯å¦æˆåŠŸ
 */
- (BOOL)reauthorizeWithPermissions:(NSArray *)permissions;
/**
 * èŽ·å–UnindID,可以根据UnindID的比较来确定OpenID是否属于同一个用户
 * \return NO未登录,信息不足;YES条件满足,发送请求成功,请等待回调
 */
- (BOOL)RequestUnionId;
/**
 * (静态方法)处理应用拉起协议
 * \param url å¤„理被其他应用呼起时的逻辑
 * \return å¤„理结果,YES表示成功,NO表示失败
 */
+ (BOOL)HandleOpenURL:(NSURL *)url;
/**
 * (静态方法)sdk是否可以处理应用拉起协议
 * \param url å¤„理被其他应用呼起时的逻辑
 * \return å¤„理结果,YES表示可以 NO表示不行
 */
+ (BOOL)CanHandleOpenURL:(NSURL *)url;
/**
 * (静态方法)处理应用的UniversalLink拉起协议
 * \param url å¤„理被其他应用呼起时的逻辑
 * \return å¤„理结果,YES表示成功,NO表示失败
 */
+ (BOOL)HandleUniversalLink:(NSURL *)url;
/**
 * (静态方法)sdk是否可以处理应用的Universallink拉起协议
 * \param url å¤„理被其他应用呼起时的逻辑(应用的Universallink链接须满足官网注册时的格式要求)
 * \return å¤„理结果,YES表示可以 NO表示不行
 * æ³¨ï¼šåœ¨è°ƒç”¨å…¶ä»–Universallink相关处理接口之前,均需进行此项判断
 */
+ (BOOL)CanHandleUniversalLink:(NSURL *)url;
/**
 * (静态方法)获取TencentOAuth调用的上一次错误信息
 */
+ (NSString *)getLastErrorMsg;
/**
 * ä»¥Server Side Code模式授权登录时,通过此接口获取返回的code值;
 * ä»¥Client Side Token模式授权登录时,忽略此接口。
 */
- (NSString *)getServerSideCode;
/**
 * é€€å‡ºç™»å½•(退出登录后,TecentOAuth失效,需要重新初始化)
 * \param delegate ç¬¬ä¸‰æ–¹åº”用用于接收请求返回结果的委托对象
 */
- (void)logout:(id<TencentSessionDelegate>)delegate;
/**
 * åˆ¤æ–­ç™»å½•态是否有效
 * \return å¤„理结果,YES表示有效,NO表示无效,请用户重新登录授权
 */
- (BOOL)isSessionValid;
/**
 * èŽ·å–ç”¨æˆ·ä¸ªäººä¿¡æ¯
 * \return å¤„理结果,YES表示API调用成功,NO表示API调用失败,登录态失败,重新登录
 */
- (BOOL)getUserInfo;
/**
 * é€€å‡ºæŒ‡å®šAPI调用
 * \param userData ç”¨æˆ·è°ƒç”¨æŸæ¡API的时候传入的保留参数
 * \return å¤„理结果,YES表示成功 NO表示失败
 */
- (BOOL)cancel:(id)userData;
/**
 * CGI类任务创建接口
 * \param apiURL CGI请求的URL地址
 * \param method CGI请求方式:"GET","POST"
 * \param params CGI请求参数字典
 * \param callback CGI请求结果的回调接口对象
 * \return CGI请求任务实例,用于取消任务,返回nil代表任务创建失败
 */
- (TCAPIRequest *)cgiRequestWithURL:(NSURL *)apiURL method:(NSString *)method params:(NSDictionary *)params callback:(id<TCAPIRequestDelegate>)callback;
/**
 * TencentOpenApi发送任务统一接口
 * \param request è¯·æ±‚发送的任务
 * \param callback ä»»åŠ¡å‘é€åŽçš„å›žè°ƒåœ°å€
 */
- (BOOL)sendAPIRequest:(TCAPIRequest *)request callback:(id<TCAPIRequestDelegate>)callback;
- (NSString *)getUserOpenID;
/* èŽ·å–appSignToken */
+ (NSString *)getAppSignToken;
/* è®¾ç½®appSignToken,跨进程的应用可以通过该方法手动设置appSignToken */
+ (void)setupAppSignToken:(NSString *)appSignToken;
@end
#pragma mark - TencentLoginDelegate(授权登录回调协议)
/**
 * \brief TencentLoginDelegate iOS Open SDK 1.3 API回调协议
 *
 * ç¬¬ä¸‰æ–¹åº”用实现登录的回调协议
 */
@protocol TencentLoginDelegate <NSObject>
@required
/**
 * ç™»å½•成功后的回调
 */
- (void)tencentDidLogin;
/**
 * ç™»å½•失败后的回调
 * \param cancelled ä»£è¡¨ç”¨æˆ·æ˜¯å¦ä¸»åŠ¨é€€å‡ºç™»å½•
 */
- (void)tencentDidNotLogin:(BOOL)cancelled;
/**
 * ç™»å½•时网络有问题的回调
 */
- (void)tencentDidNotNetWork;
@optional
/**
 * ç™»å½•时权限信息的获得
 */
- (NSArray *)getAuthorizedPermissions:(NSArray *)permissions withExtraParams:(NSDictionary *)extraParams __attribute__((deprecated("该接口已过期, å»ºè®®åˆ é™¤è°ƒç”¨")));
/**
 * unionID获得
 */
- (void)didGetUnionID;
/**
 * å¼ºåˆ¶ç½‘页登录,包括账号密码登录和二维码登录
 * return YES时,就算本地有手Q也会打开web界面
 */
- (BOOL)forceWebLogin;
/* èŽ·å¾—appSignToken回调 */
- (void)tencentDidGetAppSignToken:(NSString *)appSignToken;
@end
#pragma mark - TencentSessionDelegate(开放接口回调协议)
/**
 * \brief TencentSessionDelegate iOS Open SDK 1.3 API回调协议
 *
 * ç¬¬ä¸‰æ–¹åº”用需要实现每条需要调用的API的回调协议
 */
@protocol TencentSessionDelegate<NSObject, TencentLoginDelegate,
                                TencentWebViewDelegate>
@optional
/**
 * é€€å‡ºç™»å½•的回调
 */
- (void)tencentDidLogout;
/**
 * å› ç”¨æˆ·æœªæŽˆäºˆç›¸åº”权限而需要执行增量授权。在用户调用某个api接口时,如果服务器返回操作未被授权,则触发该回调协议接口,由第三方决定是否跳转到增量授权页面,让用户重新授权。
 * \param tencentOAuth ç™»å½•授权对象。
 * \param permissions éœ€å¢žé‡æŽˆæƒçš„æƒé™åˆ—表。
 * \return æ˜¯å¦ä»ç„¶å›žè°ƒè¿”回原始的api请求结果。
 * \note ä¸å®žçŽ°è¯¥åè®®æŽ¥å£åˆ™é»˜è®¤ä¸ºä¸å¼€å¯å¢žé‡æŽˆæƒæµç¨‹ã€‚è‹¥éœ€è¦å¢žé‡æŽˆæƒè¯·è°ƒç”¨\ref TencentOAuth#incrAuthWithPermissions: \n注意:增量授权时用户可能会修改登录的帐号
 */
- (BOOL)tencentNeedPerformIncrAuth:(TencentOAuth *)tencentOAuth withPermissions:(NSArray *)permissions;
/**
 * [该逻辑未实现]因token失效而需要执行重新登录授权。在用户调用某个api接口时,如果服务器返回token失效,则触发该回调协议接口,由第三方决定是否跳转到登录授权页面,让用户重新授权。
 * \param tencentOAuth ç™»å½•授权对象。
 * \return æ˜¯å¦ä»ç„¶å›žè°ƒè¿”回原始的api请求结果。
 * \note ä¸å®žçŽ°è¯¥åè®®æŽ¥å£åˆ™é»˜è®¤ä¸ºä¸å¼€å¯é‡æ–°ç™»å½•æŽˆæƒæµç¨‹ã€‚è‹¥éœ€è¦é‡æ–°ç™»å½•æŽˆæƒè¯·è°ƒç”¨\ref TencentOAuth#reauthorizeWithPermissions: \n注意:重新登录授权时用户可能会修改登录的帐号
 */
- (BOOL)tencentNeedPerformReAuth:(TencentOAuth *)tencentOAuth;
/**
 * ç”¨æˆ·é€šè¿‡å¢žé‡æŽˆæƒæµç¨‹é‡æ–°æŽˆæƒç™»å½•,token及有效期限等信息已被更新。
 * \param tencentOAuth token及有效期限等信息更新后的授权实例对象
 * \note ç¬¬ä¸‰æ–¹åº”用需更新已保存的token及有效期限等信息。
 */
- (void)tencentDidUpdate:(TencentOAuth *)tencentOAuth;
/**
 * ç”¨æˆ·å¢žé‡æŽˆæƒè¿‡ç¨‹ä¸­å› å–消或网络问题导致授权失败
 * \param reason æŽˆæƒå¤±è´¥åŽŸå› ï¼Œå…·ä½“å¤±è´¥åŽŸå› å‚è§sdkdef.h文件中\ref UpdateFailType
 */
- (void)tencentFailedUpdate:(UpdateFailType)reason;
/**
 * èŽ·å–ç”¨æˆ·ä¸ªäººä¿¡æ¯å›žè°ƒ
 * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse
 * \remarks æ­£ç¡®è¿”回示例: \snippet example/getUserInfoResponse.exp success
 *          é”™è¯¯è¿”回示例: \snippet example/getUserInfoResponse.exp fail
 */
- (void)getUserInfoResponse:(APIResponse*) response;
/**
 * ç¤¾äº¤API统一回调接口
 * \param response API返回结果,具体定义参见sdkdef.h文件中\ref APIResponse
 * \param message å“åº”的消息,目前支持‘SendStory’,‘AppInvitation’,‘AppChallenge’,‘AppGiftRequest’
 */
- (void)responseDidReceived:(APIResponse*)response forMessage:(NSString *)message;
/**
 * post请求的上传进度
 * \param tencentOAuth è¿”回回调的tencentOAuth对象
 * \param bytesWritten æœ¬æ¬¡å›žè°ƒä¸Šä¼ çš„æ•°æ®å­—节数
 * \param totalBytesWritten æ€»å…±å·²ç»ä¸Šä¼ çš„字节数
 * \param totalBytesExpectedToWrite æ€»å…±éœ€è¦ä¸Šä¼ çš„字节数
 * \param userData ç”¨æˆ·è‡ªå®šä¹‰æ•°æ®
 */
- (void)tencentOAuth:(TencentOAuth *)tencentOAuth didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite userData:(id)userData;
/**
 * é€šçŸ¥ç¬¬ä¸‰æ–¹ç•Œé¢éœ€è¦è¢«å…³é—­
 * \param tencentOAuth è¿”回回调的tencentOAuth对象
 * \param viewController éœ€è¦å…³é—­çš„viewController
 */
- (void)tencentOAuth:(TencentOAuth *)tencentOAuth doCloseViewController:(UIViewController *)viewController;
@end
#pragma mark - TencentWebViewDelegate(H5登录webview旋转方向回调)
/**
 * \brief TencentWebViewDelegate: H5登录webview旋转方向回调协议
 *
 * ç¬¬ä¸‰æ–¹åº”用可以根据自己APP的旋转方向限制,通过此协议设置
 */
@protocol TencentWebViewDelegate <NSObject>
@optional
- (BOOL) tencentWebViewShouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation;
- (NSUInteger) tencentWebViewSupportedInterfaceOrientationsWithWebkit;
- (BOOL) tencentWebViewShouldAutorotateWithWebkit;
@end
lib/TencentOpenAPI.framework/Headers/TencentOpenApiUmbrellaHeader.h
New file
@@ -0,0 +1,24 @@
//
//  TencentOpenApiUmbrellaHeader.h
//  TencentOpenApi_IOS
//
//  Created by jyukeizhang(张储祺) on 2020/7/27.
//  Copyright Â© 2020 Tencent. All rights reserved.
//
#ifndef TencentOpenApiUmbrellaHeader_h
#define TencentOpenApiUmbrellaHeader_h
#import <Foundation/Foundation.h>
FOUNDATION_EXPORT double StaticLibraryModuleVersionNumber;
FOUNDATION_EXPORT const unsigned char StaticLibraryModuleVersionString[];
#import "QQApiInterface.h"
#import "QQApiInterfaceObject.h"
#import "SDKDef.h"
#import "TencentOAuth.h"
#endif /* TencentOpenApiUmbrellaHeader_h */
lib/TencentOpenAPI.framework/Headers/module.modulemap
New file
@@ -0,0 +1,4 @@
module TencentOpenApi{
    umbrella header "TencentOpenApiUmbrellaHeader.h"
    export *
}
lib/TencentOpenAPI.framework/Headers/sdkdef.h
New file
@@ -0,0 +1,420 @@
///
/// \file sdkdef.h
/// \brief SDK中相关常量定义
///
/// Created by Tencent on 12-12-25.
/// Copyright (c) 2012å¹´ Tencent. All rights reserved.
///
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
/**
 * \brief è®¾ç½®sdk的log等级
 */
typedef enum {
    TCOLogLevel_Disabled = -1,   // å…³é—­æ‰€æœ‰log
    TCOLogLevel_Error = 0,
    TCOLogLevel_Warning,
    TCOLogLevel_Info,
    TCOLogLevel_Debug,
} TCOLogLevel;
/**
 * \breif æŽˆæƒ/分享 æ–¹å¼
 */
typedef enum TencentAuthShareType {
    AuthShareType_QQ,
    AuthShareType_TIM,
}TencentAuthShareType;
/**
 * \brief APIResponse.retCode可能的枚举常量
 */
typedef enum
{
    URLREQUEST_SUCCEED = 0, /**< ç½‘络请求成功发送至服务器,并且服务器返回数据格式正确
                             * \note è¿™é‡ŒåŒ…括所请求业务操作失败的情况,例如没有授权等原因导致
                             */
    URLREQUEST_FAILED = 1,  /**< ç½‘络异常,或服务器返回的数据格式不正确导致无法解析 */
} REPONSE_RESULT;
/**
 * \brief å¢žé‡æŽˆæƒå¤±è´¥åŽŸå› 
 *
 * \note å¢žé‡æŽˆæƒå¤±è´¥ä¸å½±å“åŽŸtoken的有效性(原token已失效的情况除外)
 */
typedef enum
{
    kUpdateFailUnknown = 1,  ///< æœªçŸ¥åŽŸå› 
    kUpdateFailUserCancel,   ///< ç”¨æˆ·å–消
    kUpdateFailNetwork,      ///< ç½‘络问题
} UpdateFailType;
/**
 * \brief å°è£…服务器返回的结果
 *
 * APIResponse用于封装所有请求的返回结果,包括错误码、错误信息、原始返回数据以及返回数据的json格式字典
 */
@interface APIResponse : NSObject<NSSecureCoding> {
    int      _detailRetCode;
    int         _retCode;
    int         _seq;
    NSString *_errorMsg;
    NSDictionary *_jsonResponse;
    NSString *_message;
    id       _userData;
}
/**
 * æ–°å¢žçš„详细错误码\n
 * detailRetCode主要用于区分不同的错误情况,参见\ref OpenSDKError
 */
@property (nonatomic, assign) int detailRetCode;
/**
 * ç½‘络请求是否成功送达服务器,以及服务器返回的数据格式是否正确\n
 * retCode具体取值可参考\ref REPONSE_RESULT
 */
@property (nonatomic, assign) int retCode;
/**
 * ç½‘络请求对应的递增序列号,方便内部管理
 */
@property (nonatomic, assign) int seq;
/**
 * é”™è¯¯æç¤ºè¯­
 */
@property (nonatomic, retain) NSString *errorMsg;
/**
 * æœåŠ¡å™¨è¿”å›žæ•°æ®çš„json格式字典\n
 * å­—典内具体参数的命名和含义请参考\ref api_spec
 */
@property (nonatomic, retain) NSDictionary *jsonResponse;
/**
 * æœåŠ¡å™¨è¿”å›žçš„åŽŸå§‹æ•°æ®å­—ç¬¦ä¸²
 */
@property (nonatomic, retain) NSString *message;
/**
 * ç”¨æˆ·ä¿ç•™æ•°æ®
 */
@property (nonatomic, retain) id userData;
@end
/**
 * ç”¨æˆ·è‡ªå®šä¹‰çš„保留字段
 */
FOUNDATION_EXTERN NSString * const PARAM_USER_DATA;
/**
 * \name åº”用邀请参数字段定义
 */
///@{
/** åº”用邀请展示图片url的key */
FOUNDATION_EXTERN NSString * const PARAM_APP_ICON;
/** åº”用邀请描述文本的key */
FOUNDATION_EXTERN NSString * const PARAM_APP_DESC;
/** åº”用邀请好友列表的key */
FOUNDATION_EXTERN NSString * const PARAM_APP_INVITED_OPENIDS;
///@}
/**
 * \name sendStory新分享参数字段定义
 */
///@{
/** é¢„填入接受人列表的key */
FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_RECEIVER;
/** åˆ†äº«feeds标题的key */
FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_TITLE;
/** åˆ†äº«feeds评论内容的key */
FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_COMMENT;
/** åˆ†äº«feeds摘要的key */
FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_SUMMARY;
/** åˆ†äº«feeds展示图片url的key */
FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_IMAGE;
/** åˆ†äº«feeds跳转链接url的key */
FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_URL;
/** åˆ†äº«feeds点击操作默认行为的key */
FOUNDATION_EXTERN NSString * const PARAM_SENDSTORY_ACT;
///@}
/**
 * \name è®¾ç½®å¤´åƒå‚数字段定义
 */
///@{
/** å¤´åƒå›¾ç‰‡æ•°æ®çš„key */
FOUNDATION_EXTERN NSString * const PARAM_SETUSERHEAD_PIC;
/** å¤´åƒå›¾ç‰‡æ–‡ä»¶åçš„key */
FOUNDATION_EXTERN NSString * const PARAM_SETUSERHEAD_FILENAME;
///@}
/**
 * \name æœåŠ¡å™¨è¿”å›žæ•°æ®çš„å‚æ•°å­—æ®µå®šä¹‰
 */
///@{
/** æœåŠ¡å™¨è¿”å›žç çš„key */
FOUNDATION_EXTERN NSString * const PARAM_RETCODE;
/** æœåŠ¡å™¨è¿”å›žé”™è¯¯ä¿¡æ¯çš„key */
FOUNDATION_EXTERN NSString * const PARAM_MESSAGE;
/** æœåŠ¡å™¨è¿”å›žé¢å¤–æ•°æ®çš„key */
FOUNDATION_EXTERN NSString * const PARAM_DATA;
///@}
/**
 * \name é”™è¯¯ä¿¡æ¯ç›¸å…³å¸¸é‡å®šä¹‰
 */
///@{
/** è¯¦ç»†é”™è¯¯ä¿¡æ¯å­—典中额外信息的key */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorKeyExtraInfo;
/** è¯¦ç»†é”™è¯¯ä¿¡æ¯å­—典中返回码的key */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorKeyRetCode;
/** è¯¦ç»†é”™è¯¯ä¿¡æ¯å­—典中错误语句的key */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorKeyMsg;
/** ä¸æ”¯æŒçš„æŽ¥å£ */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUnsupportedAPI;
/** æ“ä½œæˆåŠŸ */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgSuccess;
/** æœªçŸ¥é”™è¯¯ */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUnknown;
/** ç”¨æˆ·å–消 */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUserCancel;
/** è¯·é‡æ–°ç™»å½• */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgReLogin;
/** åº”用没有操作权限 */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgOperationDeny;
/** ç½‘络异常或没有网络 */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgNetwork;
/** URL格式或协议错误 */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgURL;
/** è§£æžæ•°æ®å‡ºé”™ */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgDataParse;
/** ä¼ å…¥å‚数有误 */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgParam;
/** è¿žæŽ¥è¶…æ—¶ */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgTimeout;
/** å®‰å…¨é—®é¢˜ */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgSecurity;
/** æ–‡ä»¶è¯»å†™é”™è¯¯ */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgIO;
/** æœåŠ¡å™¨ç«¯é”™è¯¯ */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgServer;
/** é¡µé¢é”™è¯¯ */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgWebPage;
/** è®¾ç½®å¤´åƒå›¾ç‰‡è¿‡å¤§ */
FOUNDATION_EXTERN NSString * const TCOpenSDKErrorMsgUserHeadPicLarge;
/** ç”¨æˆ·æœªåŒæ„æŽˆæƒéšç§åè®® */
FOUNDATION_EXPORT NSString * const TCOpenSDKErrorMsgUserNotAgreedAuthorization;
///@}
/**
 * \brief SDK新增详细错误常量
 */
typedef enum
{
    kOpenSDKInvalid = -1,                       ///< æ— æ•ˆçš„错误码
    kOpenSDKErrorUnsupportedAPI = -2,                ///< ä¸æ”¯æŒçš„æŽ¥å£
    /**
     * \name CommonErrorCode
     * å…¬å…±é”™è¯¯ç 
     */
    ///@{
    kOpenSDKErrorSuccess = 0,                   ///< æˆåŠŸ
    kOpenSDKErrorUnknown,                       ///< æœªçŸ¥é”™è¯¯
    kOpenSDKErrorUserCancel,                    ///< ç”¨æˆ·å–消
    kOpenSDKErrorReLogin,                       ///< token无效或用户未授权相应权限需要重新登录
    kOpenSDKErrorOperationDeny,                 ///< ç¬¬ä¸‰æ–¹åº”用没有该api操作的权限
    ///@}
    /**
     * \name NetworkRelatedErrorCode
     * ç½‘络相关错误码
     */
    ///@{
    kOpenSDKErrorNetwork,                       ///< ç½‘络错误,网络不通或连接不到服务器
    kOpenSDKErrorURL,                           ///< URL格式或协议错误
    kOpenSDKErrorDataParse,                     ///< æ•°æ®è§£æžé”™è¯¯ï¼ŒæœåŠ¡å™¨è¿”å›žçš„æ•°æ®è§£æžå‡ºé”™
    kOpenSDKErrorParam,                         ///< ä¼ å…¥å‚数错误
    kOpenSDKErrorConnTimeout,                   ///< http连接超时
    kOpenSDKErrorSecurity,                      ///< å®‰å…¨é—®é¢˜
    kOpenSDKErrorIO,                            ///< ä¸‹è½½å’Œæ–‡ä»¶IO错误
    kOpenSDKErrorServer,                        ///< æœåŠ¡å™¨ç«¯é”™è¯¯
    ///@}
    /**
     * \name WebViewRelatedError
     * webview特有错误
     */
    ///@{
    kOpenSDKErrorWebPage,                       ///< é¡µé¢é”™è¯¯
    ///@}
    /**
     * \name SetUserHeadRelatedErrorCode
     * è®¾ç½®å¤´åƒè‡ªå®šä¹‰é”™è¯¯ç æ®µ
     */
    ///@{
    kOpenSDKErrorUserHeadPicLarge = 0x010000,   ///< å›¾ç‰‡è¿‡å¤§ è®¾ç½®å¤´åƒè‡ªå®šä¹‰é”™è¯¯ç 
    ///@}
} OpenSDKError;
/**
 * \name SDK版本(v1.3)支持的授权列表常量
 */
///@{
/** å‘表一条说说到QQ空间(<b>需要申请权限</b>) */
FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_TOPIC;
/** åˆ›å»ºä¸€ä¸ªQQ空间相册(<b>需要申请权限</b>) */
FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ADD_ALBUM;
/** ä¸Šä¼ ä¸€å¼ ç…§ç‰‡åˆ°QQ空间相册(<b>需要申请权限</b>) */
FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_UPLOAD_PIC;
/** èŽ·å–ç”¨æˆ·QQ空间相册列表(<b>需要申请权限</b>) */
FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_LIST_ALBUM;
/** éªŒè¯æ˜¯å¦è®¤è¯ç©ºé—´ç²‰ä¸ */
FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_CHECK_PAGE_FANS;
/** èŽ·å–ç™»å½•ç”¨æˆ·è‡ªå·±çš„è¯¦ç»†ä¿¡æ¯ */
FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_INFO;
/** èŽ·å–å…¶ä»–ç”¨æˆ·çš„è¯¦ç»†ä¿¡æ¯ */
FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_OTHER_INFO;
/** èŽ·å–ä¼šå‘˜ç”¨æˆ·åŸºæœ¬ä¿¡æ¯ */
FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_VIP_INFO;
/** èŽ·å–ä¼šå‘˜ç”¨æˆ·è¯¦ç»†ä¿¡æ¯ */
FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_VIP_RICH_INFO;
/** èŽ·å–ç”¨æˆ·ä¿¡æ¯ */
FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_USER_INFO;
/** ç§»åŠ¨ç«¯èŽ·å–ç”¨æˆ·ä¿¡æ¯ */
FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_GET_SIMPLE_USER_INFO;
/** ç§»åŠ¨ç«¯èŽ·å–ç”¨æˆ·ä¿¡æ¯ */
FOUNDATION_EXTERN NSString *const kOPEN_PERMISSION_ALL;
///@}
/**
 * \name CGI接口相关参数类型定义
 */
/** å¿…填的字符串类型参数 */
typedef NSString *TCRequiredStr;
/** å¿…å¡«çš„UIImage类型参数 */
typedef UIImage *TCRequiredImage;
/** å¿…填的整型参数 */
typedef NSInteger TCRequiredInt;
/** å¿…填的数字类型 */
typedef NSNumber *TCRequiredNumber;
/** å¿…å¡«çš„NSData参数 */
typedef NSData *TCRequiredData;
/** å¯é€‰çš„字符串类型参数 */
typedef NSString *TCOptionalStr;
/** å¯é€‰çš„UIImage类型参数 */
typedef UIImage *TCOptionalImage;
/** å¯é€‰çš„æ•´åž‹å‚æ•° */
typedef NSInteger TCOptionalInt;
/** å¯é€‰çš„æ•°å­—类型 */
typedef NSNumber *TCOptionalNumber;
/** å¯é€‰çš„不定类型参数 */
typedef id TCRequiredId;
///@}
/**
 * \brief CGI请求的参数字典封装辅助基类
 *
 * å°†ç›¸åº”属性的值以key-value的形式保存到参数字典中
 */
@interface TCAPIRequest : NSMutableDictionary
/** CGI请求的URL地址 */
@property (nonatomic, readonly) NSURL *apiURL;
/** CGI请求方式:"GET","POST" */
@property (nonatomic, readonly) NSString *method;
/**
 * API参数中的保留字段,可以塞入任意字典支持的类型,再调用完成后会带回给调用方
 */
@property (nonatomic, retain) TCRequiredId paramUserData;
/**
 * APIResponse,API的返回结果
 */
@property (nonatomic, readonly) APIResponse *response;
/** å–消相应的CGI请求任务 */
- (void)cancel;
@end
@protocol TCAPIRequestDelegate <NSObject>
@optional
- (void)cgiRequest:(TCAPIRequest *)request didResponse:(APIResponse *)response;
@end
lib/TencentOpenAPI.framework/TencentOpenAPI
Binary files differ