Commit 711a0a2b by 刘卓鑫

提交3.9.2

parent f34a4a85
...@@ -79,6 +79,13 @@ ...@@ -79,6 +79,13 @@
ReferencedContainer = "container:ColorfulSchool.xcodeproj"> ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "DYLD_PRINT_STATISTICS"
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction> </LaunchAction>
<ProfileAction <ProfileAction
buildConfiguration = "Debug" buildConfiguration = "Debug"
......
<?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>SchemeUserState</key>
<dict>
<key>ColorfulSchool.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>9142D2B61F35C84E004F90CF</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9142D2D21F35C84E004F90CF</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9142D2DD1F35C84E004F90CF</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0920"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9142D2B61F35C84E004F90CF"
BuildableName = "ColorfulSchool.app"
BlueprintName = "ColorfulSchool"
ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9142D2D21F35C84E004F90CF"
BuildableName = "ColorfulSchoolTests.xctest"
BlueprintName = "ColorfulSchoolTests"
ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9142D2DD1F35C84E004F90CF"
BuildableName = "ColorfulSchoolUITests.xctest"
BlueprintName = "ColorfulSchoolUITests"
ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9142D2B61F35C84E004F90CF"
BuildableName = "ColorfulSchool.app"
BlueprintName = "ColorfulSchool"
ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9142D2B61F35C84E004F90CF"
BuildableName = "ColorfulSchool.app"
BlueprintName = "ColorfulSchool"
ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "DYLD_PRINT_STATISTICSvalue"
value = "1"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9142D2B61F35C84E004F90CF"
BuildableName = "ColorfulSchool.app"
BlueprintName = "ColorfulSchool"
ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?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>SchemeUserState</key>
<dict>
<key>ColorfulSchool.xcscheme</key>
<dict>
<key>isShown</key>
<true/>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>9142D2B61F35C84E004F90CF</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9142D2D21F35C84E004F90CF</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9142D2DD1F35C84E004F90CF</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>A70343162223C152009DFC82</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
<?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>SchemeUserState</key>
<dict>
<key>ColorfulSchool.xcscheme_^#shared#^_</key>
<dict>
<key>isShown</key>
<true/>
<key>orderHint</key>
<integer>3</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>9142D2B61F35C84E004F90CF</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9142D2D21F35C84E004F90CF</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9142D2DD1F35C84E004F90CF</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9142D2B61F35C84E004F90CF"
BuildableName = "ColorfulSchool.app"
BlueprintName = "ColorfulSchool"
ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9142D2D21F35C84E004F90CF"
BuildableName = "ColorfulSchoolTests.xctest"
BlueprintName = "ColorfulSchoolTests"
ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9142D2DD1F35C84E004F90CF"
BuildableName = "ColorfulSchoolUITests.xctest"
BlueprintName = "ColorfulSchoolUITests"
ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9142D2B61F35C84E004F90CF"
BuildableName = "ColorfulSchool.app"
BlueprintName = "ColorfulSchool"
ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9142D2B61F35C84E004F90CF"
BuildableName = "ColorfulSchool.app"
BlueprintName = "ColorfulSchool"
ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9142D2B61F35C84E004F90CF"
BuildableName = "ColorfulSchool.app"
BlueprintName = "ColorfulSchool"
ReferencedContainer = "container:ColorfulSchool.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?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>SchemeUserState</key>
<dict>
<key>ColorfulSchool.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>ColorfulSchool.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>9142D2B61F35C84E004F90CF</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9142D2D21F35C84E004F90CF</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>9142D2DD1F35C84E004F90CF</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "C4FA1D40-0820-4DB8-948B-CEB11FFE9947"
type = "0"
version = "2.0">
</Bucket>
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
//京东联盟sdk注册失败 //京东联盟sdk注册失败
NSLog(@"京东联盟sdk注册失败---%@", error); NSLog(@"京东联盟sdk注册失败---%@", error);
}]; }];
//网络监测 //网络监测
[self checkNetworkingStatus]; [self checkNetworkingStatus];
} }
......
...@@ -37,14 +37,15 @@ ...@@ -37,14 +37,15 @@
#import "YYFPSLabel.h" #import "YYFPSLabel.h"
#import "ZXAdTool.h" #import "ZXAdTool.h"
#import "ZXAdViewAdTool.h" #import "ZXAdViewAdTool.h"
#import <BUAdSDK/BUAdSDK.h>
#define TIME_ANIMATION 1.0 #define TIME_ANIMATION 1.0
#define PERSPECTIVE -1.0 / 200.0 #define PERSPECTIVE -1.0 / 200.0
#define ROTATION_ANGLE M_PI_2 #define ROTATION_ANGLE M_PI_2
#import "ZXAdViewAdTool.h" #import "ZXAdViewAdTool.h"
#import "BUADTool.h"
@interface AppDelegate ()<WXApiDelegate,UIAlertViewDelegate,UITabBarControllerDelegate,JPUSHRegisterDelegate, AVSpeechSynthesizerDelegate, BUSplashAdDelegate>
@interface AppDelegate ()<WXApiDelegate,UIAlertViewDelegate,UITabBarControllerDelegate,JPUSHRegisterDelegate, AVSpeechSynthesizerDelegate>
{ {
BOOL _isPlaying;//是否正在播放 BOOL _isPlaying;//是否正在播放
} }
...@@ -77,7 +78,7 @@ ...@@ -77,7 +78,7 @@
//开屏广告 //开屏广告
[ZXAdTool startLauchAd]; [ZXAdTool startLauchAd];
//版本检测 //版本检测
[self checkVersion]; [self checkVersion];
...@@ -93,6 +94,24 @@ ...@@ -93,6 +94,24 @@
[[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes]; [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
return YES; return YES;
} }
#pragma mark - 穿山甲广告Delegate
- (void)splashAdDidClose:(BUSplashAdView *)splashAd {
[splashAd removeFromSuperview];
}
/**
This method is called when splash ad material loaded successfully.
*/
- (void)splashAdDidLoad:(BUSplashAdView *)splashAd {
NSLog(@"穿山甲开屏广告加载成功");
}
/**
This method is called when splash ad material failed to load.
@param error : the reason of error
*/
- (void)splashAd:(BUSplashAdView *)splashAd didFailWithError:(NSError * _Nullable)error {
NSLog(@"穿山甲开屏广告加载失败");
}
- (void) ccc { - (void) ccc {
//CK900100 //CK900100
} }
......
// //
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// //
// Created by 刘卓鑫 on 2019/3/22. // Created by 刘卓鑫 on 2019/3/22.
// Copyright © 2019 Colorful Any Door. All rights reserved. // Copyright © 2019 Colorful Any Door. All rights reserved.
// // 穿山甲 5033112 开833112068 横933112579
#ifndef BDADHeader_h #ifndef BDADHeader_h
#define BDADHeader_h #define BDADHeader_h
...@@ -12,7 +12,9 @@ ...@@ -12,7 +12,9 @@
//#define kBaiduAdAppId @"f180f331" //#define kBaiduAdAppId @"f180f331"
//#define kBaiduAdAdPlacementId @"6102241" //#define kBaiduAdAdPlacementId @"6102241"
//百度 //百度
#define kBaiduAdAppId @"ccb60059" #define kBaiduAdAppId @"ed6b6847"
#define kBaiduAdAdPlacementId @"3722589" #define kBaiduAdAdPlacementId @"3722589"
#define kBaiduAdLauchId @"6592613" //q开屏
#define kBaiduAdHFId @"6592671" //q横幅
#endif /* BDADHeader_h */ #endif /* BDADHeader_h */
//
//
// BUADTool.h
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/10/28.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface BUADTool : NSObject
- (void)setupBUAdSDKAndLoadLauchAdByDelegate:(id) delegate;
- (void) loadBannerAdWithController:(UIViewController *) viewController;
@end
NS_ASSUME_NONNULL_END
//
//
// BUADTool.m
// ColorfulSchool
//
// Created by 刘卓鑫 on 2019/10/28.
// Copyright © 2019 Colorful Any Door. All rights reserved.
//
#import "BUADTool.h"
#import <BUAdSDK/BUAdSDK.h>
@interface BUADTool()
/** */
@property (nonatomic, strong) BUNativeExpressBannerView *bannerView;
@end
@implementation BUADTool
- (void)setupBUAdSDKAndLoadLauchAdByDelegate:(id) delegate {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
dispatch_async(dispatch_get_main_queue(), ^{
[BUAdSDKManager setAppID:@"5033112"];
[BUAdSDKManager setIsPaidApp:NO];
// splash AD demo
[self loadLauchAdByDelegate:delegate];
});
});
}
- (void) loadLauchAdByDelegate:(id) delagte {
BUSplashAdView *splashView = [[BUSplashAdView alloc] initWithSlotID:@"833112068" frame:[UIScreen mainScreen].bounds];
splashView.delegate = delagte;
splashView.tolerateTimeout = 3;
UIWindow *keyWindow = [UIApplication sharedApplication].windows.firstObject;
[splashView loadAdData];
[keyWindow.rootViewController.view addSubview:splashView];
splashView.rootViewController = keyWindow.rootViewController;
}
- (void)splashAdDidClose:(BUSplashAdView *)splashAd {
[splashAd removeFromSuperview];
}
/**
This method is called when splash ad material loaded successfully.
*/
- (void)splashAdDidLoad:(BUSplashAdView *)splashAd {
NSLog(@"穿山甲开屏广告加载成功");
}
/**
This method is called when splash ad material failed to load.
@param error : the reason of error
*/
- (void)splashAd:(BUSplashAdView *)splashAd didFailWithError:(NSError * _Nullable)error {
NSLog(@"穿山甲开屏广告加载失败");
}
- (void) loadBannerAdWithController:(UIViewController *) viewController {
[BUAdSDKManager setAppID:@"5033112"];
[BUAdSDKManager setIsPaidApp:NO];
// splash AD demo
BUSize *imgSize = [BUSize sizeBy:BUProposalSize_Banner600_90];
CGFloat bannerHeigh = kScreenWidth/600*90;
if (self.bannerView == nil) {
self.bannerView = [[BUNativeExpressBannerView alloc] initWithSlotID:@"933112579" rootViewController:viewController imgSize:imgSize adSize:CGSizeMake(kScreenWidth, bannerHeigh) IsSupportDeepLink:YES];
self.bannerView.frame = CGRectMake(0, kScreenHeight - bannerHeigh, kScreenWidth, bannerHeigh);
self.bannerView.delegate = (id)viewController;
[viewController.view addSubview:self.bannerView];
}
[self.bannerView loadAdData];
}
@end
// //
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#import <JDSDK/KeplerApiManager.h> #import <JDSDK/KeplerApiManager.h>
#import "ZXAdViewAdTool.h" #import "ZXAdViewAdTool.h"
#import "ZXBDTool.h" #import "ZXBDTool.h"
#import "BUADTool.h"
@implementation ZXAdTool @implementation ZXAdTool
...@@ -76,8 +77,8 @@ ...@@ -76,8 +77,8 @@
case 2: //adView case 2: //adView
[[[ZXAdViewAdTool alloc] init] startLauchAd]; [[[ZXAdViewAdTool alloc] init] startLauchAd];
break; break;
case 5: // case 5: //穿山甲
[[BUADTool new] setupBUAdSDKAndLoadLauchAdByDelegate:UIApplication.sharedApplication.delegate];
break; break;
default: default:
break; break;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#import "enlargeClickRegionBtn.h" #import "enlargeClickRegionBtn.h"
#import "HMSegmentedControl.h" #import "HMSegmentedControl.h"
#import "UIView+Frame.h" #import "UIView+Frame.h"
#import "ZXAliMaMaSerarchResultViewController.h" #import "ZXSearchViewController.h"
#import "PYSearchViewController.h" #import "PYSearchViewController.h"
#import "ZXAliMaMaViewController.h" #import "ZXAliMaMaViewController.h"
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
@weakify(self); @weakify(self);
PYSearchViewController *searchViewController = [PYSearchViewController searchViewControllerWithHotSearches:@[] searchBarPlaceholder:@"请输入要搜索的商品" didSearchBlock:^(PYSearchViewController *searchViewController, UISearchBar *searchBar, NSString *searchText) { PYSearchViewController *searchViewController = [PYSearchViewController searchViewControllerWithHotSearches:@[] searchBarPlaceholder:@"请输入要搜索的商品" didSearchBlock:^(PYSearchViewController *searchViewController, UISearchBar *searchBar, NSString *searchText) {
@strongify(self); @strongify(self);
ZXAliMaMaSerarchResultViewController *searchResultVc = [[ZXAliMaMaSerarchResultViewController alloc] init]; ZXSearchViewController *searchResultVc = [[ZXSearchViewController alloc] init];
searchResultVc.searchStr = searchText; searchResultVc.searchStr = searchText;
[self.navigationController pushViewController:searchResultVc animated:YES]; [self.navigationController pushViewController:searchResultVc animated:YES];
}]; }];
......
// //
// ZXAliMaMaSerarchResultViewController.h // ZXSearchViewController.h
// ColorfulSchool // ColorfulSchool
// //
// Created by 刘卓鑫 on 2019/10/23. // Created by 刘卓鑫 on 2019/10/25.
// Copyright © 2019 Colorful Any Door. All rights reserved. // Copyright © 2019 Colorful Any Door. All rights reserved.
// //
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface ZXAliMaMaSerarchResultViewController : UIViewController @interface ZXSearchViewController : UIViewController
/** */ /** */
@property (nonatomic, copy) NSString *searchStr; @property (nonatomic, copy) NSString *searchStr;
@end @end
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// Copyright © 2019 Colorful Any Door. All rights reserved. // Copyright © 2019 Colorful Any Door. All rights reserved.
// //
#import "ZXAliMaMaSerarchResultViewController.h" #import "ZXSearchViewController.h"
#import "ZXAdViewService.h" #import "ZXAdViewService.h"
#import "ZXAlimamaModel.h" #import "ZXAlimamaModel.h"
#import "LMHWaterFallLayout.h" #import "LMHWaterFallLayout.h"
...@@ -16,9 +16,8 @@ ...@@ -16,9 +16,8 @@
#import "PYSearchViewController.h" #import "PYSearchViewController.h"
#import "ZXFliterView.h" #import "ZXFliterView.h"
static NSString * const LMHShopId = @"shop";
@interface ZXAliMaMaSerarchResultViewController ()<UICollectionViewDataSource, LMHWaterFallLayoutDeleaget, UICollectionViewDelegate, ZXFliterDelegate> @interface ZXSearchViewController ()<UICollectionViewDataSource, LMHWaterFallLayoutDeleaget, UICollectionViewDelegate, ZXFliterDelegate>
/** 所有的商品数据 */ /** 所有的商品数据 */
@property (nonatomic, strong) NSMutableArray * shops; @property (nonatomic, strong) NSMutableArray * shops;
...@@ -39,7 +38,7 @@ static NSString * const LMHShopId = @"shop"; ...@@ -39,7 +38,7 @@ static NSString * const LMHShopId = @"shop";
@end @end
@implementation ZXAliMaMaSerarchResultViewController @implementation ZXSearchViewController
#pragma mark - 懒加载 #pragma mark - 懒加载
- (NSMutableArray *)shops{ - (NSMutableArray *)shops{
if (!_shops) { if (!_shops) {
...@@ -120,7 +119,7 @@ static NSString * const LMHShopId = @"shop"; ...@@ -120,7 +119,7 @@ static NSString * const LMHShopId = @"shop";
// 2. Create a search view controller // 2. Create a search view controller
PYSearchViewController *searchViewController = [PYSearchViewController searchViewControllerWithHotSearches:@[] searchBarPlaceholder:@"请输入要搜索的商品" didSearchBlock:^(PYSearchViewController *searchViewController, UISearchBar *searchBar, NSString *searchText) { PYSearchViewController *searchViewController = [PYSearchViewController searchViewControllerWithHotSearches:@[] searchBarPlaceholder:@"请输入要搜索的商品" didSearchBlock:^(PYSearchViewController *searchViewController, UISearchBar *searchBar, NSString *searchText) {
@strongify(self); @strongify(self);
ZXAliMaMaSerarchResultViewController *searchResultVc = [[ZXAliMaMaSerarchResultViewController alloc] init]; ZXSearchViewController *searchResultVc = [[ZXSearchViewController alloc] init];
searchResultVc.searchStr = searchText; searchResultVc.searchStr = searchText;
[self.navigationController pushViewController:searchResultVc animated:YES]; [self.navigationController pushViewController:searchResultVc animated:YES];
...@@ -178,7 +177,7 @@ static NSString * const LMHShopId = @"shop"; ...@@ -178,7 +177,7 @@ static NSString * const LMHShopId = @"shop";
[self.view addSubview:collectionView]; [self.view addSubview:collectionView];
// 注册 // 注册
[collectionView registerClass:[ZXAlimamaCollectionViewCell class] forCellWithReuseIdentifier:LMHShopId]; [collectionView registerClass:[ZXAlimamaCollectionViewCell class] forCellWithReuseIdentifier:@"ZXAlimamaCollectionViewCell"];
self.collectionView = collectionView; self.collectionView = collectionView;
} }
...@@ -248,7 +247,7 @@ static NSString * const LMHShopId = @"shop"; ...@@ -248,7 +247,7 @@ static NSString * const LMHShopId = @"shop";
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
ZXAlimamaCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:LMHShopId forIndexPath:indexPath]; ZXAlimamaCollectionViewCell * cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ZXAlimamaCollectionViewCell" forIndexPath:indexPath];
cell.model = self.shops[indexPath.item]; cell.model = self.shops[indexPath.item];
...@@ -296,7 +295,7 @@ static NSString * const LMHShopId = @"shop"; ...@@ -296,7 +295,7 @@ static NSString * const LMHShopId = @"shop";
} else if (status == 2) { } else if (status == 2) {
searchStr = @"2"; searchStr = @"2";
} }
self.url = [NSString stringWithFormat:@"%@/alimama/tbk/dg/material/optional?pageNo=%ld&pageNo=20&q=%@&deviceType=IMEI&deviceValue=02399123192391293123&cat=hot&priceSort=%d", [kUserDefaults objectForKey:@"HomePage"], (long)self.currentPage,[self.searchStr isEqualToString:@"全部"]?@"":self.searchStr, isUp?1:2; self.url = [NSString stringWithFormat:@"%@/alimama/tbk/dg/material/optional?pageNo=%ld&pageNo=20&q=%@&deviceType=IMEI&deviceValue=02399123192391293123&cat=hot&priceSort=%@", [kUserDefaults objectForKey:@"HomePage"], (long)self.currentPage,[self.searchStr isEqualToString:@"全部"]?@"":self.searchStr, searchStr];
[self loadNewShops]; [self loadNewShops];
} }
...@@ -307,22 +306,13 @@ static NSString * const LMHShopId = @"shop"; ...@@ -307,22 +306,13 @@ static NSString * const LMHShopId = @"shop";
} else if (status == 2) { } else if (status == 2) {
searchStr = @"2"; searchStr = @"2";
} }
self.url = @""; self.url = [NSString stringWithFormat:@"%@/alimama/tbk/dg/material/optional?pageNo=%ld&pageNo=20&q=%@&deviceType=IMEI&deviceValue=02399123192391293123&cat=hot&totalSalesSort=%@", [kUserDefaults objectForKey:@"HomePage"], (long)self.currentPage,[self.searchStr isEqualToString:@"全部"]?@"":self.searchStr, searchStr];;
[self loadNewShops]; [self loadNewShops];
} }
//选择了价格 isUp是否升序
//- (void) filterByPrices:(NSInteger)status {
// self.url = [NSString stringWithFormat:@"%@/alimama/tbk/dg/material/optional?pageNo=%ld&pageNo=20&q=%@&deviceType=IMEI&deviceValue=02399123192391293123&cat=hot&priceSort=%d", [kUserDefaults objectForKey:@"HomePage"], (long)self.currentPage,[self.searchStr isEqualToString:@"全部"]?@"":self.searchStr, isUp?1:2];
// [self loadNewShops];
//}
////选择了销量 isSelect
//- (void) filterBySales:(NSInteger)status {
// self.url = [NSString stringWithFormat:@"%@/alimama/tbk/dg/material/optional?pageNo=%ld&pageNo=20&q=%@&deviceType=IMEI&deviceValue=02399123192391293123&cat=hot&totalSalesSort=%d", [kUserDefaults objectForKey:@"HomePage"], (long)self.currentPage,[self.searchStr isEqualToString:@"全部"]?@"":self.searchStr, isSelect?2:1];
// [self loadNewShops];
//}
////选择了过滤条件 isBaoyou是否包邮 价格区间 ////选择了过滤条件 isBaoyou是否包邮 价格区间
//- (void) filterByBaoyou:(BOOL)isBaoyou { - (void) filterByBaoyou:(BOOL)isBaoyou {
// self.url = [NSString stringWithFormat:@"%@/alimama/tbk/dg/material/optional?pageNo=%ld&pageNo=20&q=%@&deviceType=IMEI&deviceValue=02399123192391293123&cat=hot&needFreeShipment=%ld", [kUserDefaults objectForKey:@"HomePage"], (long)self.currentPage,[self.searchStr isEqualToString:@"全部"]?@"":self.searchStr, isBaoyou?1:0]; self.url = [NSString stringWithFormat:@"%@/alimama/tbk/dg/material/optional?pageNo=%ld&pageNo=20&q=%@&deviceType=IMEI&deviceValue=02399123192391293123&cat=hot&needFreeShipment=%d", [kUserDefaults objectForKey:@"HomePage"], (long)self.currentPage,[self.searchStr isEqualToString:@"全部"]?@"":self.searchStr, isBaoyou?1:0];
// [self loadNewShops]; [self loadNewShops];
//} }
@end @end
// //
...@@ -12,12 +12,16 @@ ...@@ -12,12 +12,16 @@
#import "ZXDrinkViewController.h" #import "ZXDrinkViewController.h"
#import "SDCycleScrollView.h" #import "SDCycleScrollView.h"
#import "ZXAdViewAdTool.h" #import "ZXAdViewAdTool.h"
@interface ZXSelfHelpViewController () { #import "BUADTool.h"
#import <BUAdSDK/BUAdSDK.h>
@interface ZXSelfHelpViewController ()<BUNativeExpressBannerViewDelegate> {
enlargeClickRegionBtn *showCode; enlargeClickRegionBtn *showCode;
} }
/** banner广澳 */
@property (nonatomic, strong) BUNativeExpressBannerView *bannerView;
@property (nonatomic, strong) dispatch_source_t gcdTimer; @property (nonatomic, strong) dispatch_source_t gcdTimer;
/** /**
...@@ -79,7 +83,7 @@ ...@@ -79,7 +83,7 @@
[self createCodeView]; [self createCodeView];
if ([[kUserDefaults objectForKey:kAPP_SELP_ADVIEW_SHOW] isEqualToString:@"yes"]) { if ([[kUserDefaults objectForKey:kAPP_SELP_ADVIEW_SHOW] isEqualToString:@"yes"]) {
[[[ZXAdViewAdTool alloc] init] loadNativeAdBySuperView:self.view]; [[[BUADTool alloc] init] loadBannerAdWithController:self];
} }
...@@ -87,7 +91,7 @@ ...@@ -87,7 +91,7 @@
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:kSelf_help_start_timer object:nil] subscribeNext:^(id x) { [[[NSNotificationCenter defaultCenter] rac_addObserverForName:kSelf_help_start_timer object:nil] subscribeNext:^(id x) {
@strongify(self); @strongify(self);
[self createTimer]; [self createTimer];
}]; }];
[[[NSNotificationCenter defaultCenter] rac_addObserverForName:kSelf_help_destory_timer object:nil] subscribeNext:^(id x) { [[[NSNotificationCenter defaultCenter] rac_addObserverForName:kSelf_help_destory_timer object:nil] subscribeNext:^(id x) {
@strongify(self); @strongify(self);
...@@ -180,7 +184,7 @@ ...@@ -180,7 +184,7 @@
images = @[@"洗衣01", @"洗衣02"]; images = @[@"洗衣01", @"洗衣02"];
} }
self.cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero shouldInfiniteLoop:YES imageNamesGroup:images]; self.cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero shouldInfiniteLoop:YES imageNamesGroup:images];
// self.cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill; // self.cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
self.cycleScrollView.autoScrollTimeInterval = 3; self.cycleScrollView.autoScrollTimeInterval = 3;
self.cycleScrollView.pageControlStyle = SDCycleScrollViewPageContolStyleClassic; self.cycleScrollView.pageControlStyle = SDCycleScrollViewPageContolStyleClassic;
...@@ -203,7 +207,7 @@ ...@@ -203,7 +207,7 @@
[_barCodeModel addObserver:self forKeyPath:@"isLoaded" options:NSKeyValueObservingOptionNew context:nil]; [_barCodeModel addObserver:self forKeyPath:@"isLoaded" options:NSKeyValueObservingOptionNew context:nil];
[_barCodeModel addObserver:self forKeyPath:@"error" options:NSKeyValueObservingOptionNew context:nil]; [_barCodeModel addObserver:self forKeyPath:@"error" options:NSKeyValueObservingOptionNew context:nil];
} }
...@@ -226,7 +230,7 @@ ...@@ -226,7 +230,7 @@
} }
#pragma mark - ========== 创建导航栏 ========== #pragma mark - ========== 创建导航栏 ==========
- (void) createNabar { - (void) createNabar {
UIImage *image = kToppicBgImage; UIImage *image = kToppicBgImage;
UIImageView *nabar = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kTopHeight)]; UIImageView *nabar = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kTopHeight)];
nabar.userInteractionEnabled = YES; nabar.userInteractionEnabled = YES;
...@@ -261,7 +265,7 @@ ...@@ -261,7 +265,7 @@
[[back rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) { [[back rac_signalForControlEvents:UIControlEventTouchDown] subscribeNext:^(id x) {
@strongify(self); @strongify(self);
[[NSNotificationCenter defaultCenter] postNotificationName:kOrder_CheckNopPay_Pay object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:kOrder_CheckNopPay_Pay object:nil];
[self.navigationController popToRootViewControllerAnimated:YES]; [self.navigationController popToRootViewControllerAnimated:YES];
if (self.backAction) { if (self.backAction) {
self.backAction(); self.backAction();
...@@ -275,7 +279,7 @@ ...@@ -275,7 +279,7 @@
} }
#pragma mark - ========== 添加隐藏条码按钮 ========== #pragma mark - ========== 添加隐藏条码按钮 ==========
- (void) createCodeView { - (void) createCodeView {
if (self.model == 3) { if (self.model == 3) {
showCode = [[enlargeClickRegionBtn alloc] init]; showCode = [[enlargeClickRegionBtn alloc] init];
[self.view addSubview:showCode]; [self.view addSubview:showCode];
...@@ -323,7 +327,7 @@ ...@@ -323,7 +327,7 @@
*/ */
- (UIImage *)createBarCode:(NSString *)code width:(CGFloat)width height:(CGFloat)height - (UIImage *)createBarCode:(NSString *)code width:(CGFloat)width height:(CGFloat)height
{ {
if ([code isEqualToString:@"null"]) { if ([code isEqualToString:@"null"]) {
code=@""; code=@"";
return nil; return nil;
...@@ -376,4 +380,43 @@ ...@@ -376,4 +380,43 @@
#pragma BUNativeExpressBannerViewDelegate
- (void)nativeExpressBannerAdViewDidLoad:(BUNativeExpressBannerView *)bannerAdView {
NSLog(@"%s",__func__);
}
- (void)nativeExpressBannerAdView:(BUNativeExpressBannerView *)bannerAdView didLoadFailWithError:(NSError *)error {
NSLog(@"%s",__func__);
}
- (void)nativeExpressBannerAdViewRenderSuccess:(BUNativeExpressBannerView *)bannerAdView {
NSLog(@"%s",__func__);
}
- (void)nativeExpressBannerAdViewRenderFail:(BUNativeExpressBannerView *)bannerAdView error:(NSError *)error {
NSLog(@"%s",__func__);
}
- (void)nativeExpressBannerAdViewWillBecomVisible:(BUNativeExpressBannerView *)bannerAdView {
NSLog(@"%s",__func__);
}
- (void)nativeExpressBannerAdViewDidClick:(BUNativeExpressBannerView *)bannerAdView {
NSLog(@"%s",__func__);
}
- (void)nativeExpressBannerAdView:(BUNativeExpressBannerView *)bannerAdView dislikeWithReason:(NSArray<BUDislikeWords *> *)filterwords {
NSLog(@"%s",__func__);
[UIView animateWithDuration:0.25 animations:^{
bannerAdView.alpha = 0;
} completion:^(BOOL finished) {
[bannerAdView removeFromSuperview];
if (self.bannerView == bannerAdView) {
self.bannerView = nil;
}
}];
}
@end @end
...@@ -16,11 +16,11 @@ target 'ColorfulSchool' do ...@@ -16,11 +16,11 @@ target 'ColorfulSchool' do
pod 'FMDB' pod 'FMDB'
pod 'DTCoreText' pod 'DTCoreText'
pod 'JXCategoryView' pod 'JXCategoryView'
pod 'GDTMobSDK', '~> 4.10.5' pod 'GDTMobSDK'
pod 'JJException' pod 'JJException'
pod 'Bugly' pod 'Bugly'
pod 'UMCAnalytics' pod 'UMCAnalytics'
pod 'UMCCommon' pod 'UMCCommon'
pod 'UMCCommonLog' pod 'UMCCommonLog'
pod 'Bytedance-UnionAD'
end end
...@@ -21,6 +21,7 @@ PODS: ...@@ -21,6 +21,7 @@ PODS:
- AFNetworking/NSURLConnection - AFNetworking/NSURLConnection
- AFNetworking/NSURLSession - AFNetworking/NSURLSession
- Bugly (2.5.0) - Bugly (2.5.0)
- Bytedance-UnionAD (2.4.6.7)
- DTCoreText (1.6.22): - DTCoreText (1.6.22):
- DTCoreText/Core (= 1.6.22) - DTCoreText/Core (= 1.6.22)
- DTFoundation/Core (~> 1.7.5) - DTFoundation/Core (~> 1.7.5)
...@@ -41,9 +42,9 @@ PODS: ...@@ -41,9 +42,9 @@ PODS:
- FMDB (2.7.5): - FMDB (2.7.5):
- FMDB/standard (= 2.7.5) - FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5) - FMDB/standard (2.7.5)
- GDTMobSDK (4.10.8): - GDTMobSDK (4.10.10):
- GDTMobSDK/GDTMobSDK (= 4.10.8) - GDTMobSDK/GDTMobSDK (= 4.10.10)
- GDTMobSDK/GDTMobSDK (4.10.8) - GDTMobSDK/GDTMobSDK (4.10.10)
- HappyDNS (0.3.15) - HappyDNS (0.3.15)
- IQKeyboardManager (6.4.0) - IQKeyboardManager (6.4.0)
- JCore (2.1.1) - JCore (2.1.1)
...@@ -93,9 +94,10 @@ PODS: ...@@ -93,9 +94,10 @@ PODS:
DEPENDENCIES: DEPENDENCIES:
- AFNetworking (~> 2.6.3) - AFNetworking (~> 2.6.3)
- Bugly - Bugly
- Bytedance-UnionAD
- DTCoreText - DTCoreText
- FMDB - FMDB
- GDTMobSDK (~> 4.10.5) - GDTMobSDK
- IQKeyboardManager - IQKeyboardManager
- JJException - JJException
- JPush - JPush
...@@ -113,13 +115,12 @@ DEPENDENCIES: ...@@ -113,13 +115,12 @@ DEPENDENCIES:
- XRCarouselView - XRCarouselView
SPEC REPOS: SPEC REPOS:
https://github.com/cocoapods/specs.git: https://github.com/CocoaPods/Specs.git:
- AFNetworking - AFNetworking
- Bugly - Bugly
- DTCoreText - DTCoreText
- DTFoundation - DTFoundation
- FMDB - FMDB
- GDTMobSDK
- HappyDNS - HappyDNS
- IQKeyboardManager - IQKeyboardManager
- JCore - JCore
...@@ -136,6 +137,9 @@ SPEC REPOS: ...@@ -136,6 +137,9 @@ SPEC REPOS:
- UMCCommon - UMCCommon
- UMCCommonLog - UMCCommonLog
- XRCarouselView - XRCarouselView
trunk:
- Bytedance-UnionAD
- GDTMobSDK
EXTERNAL SOURCES: EXTERNAL SOURCES:
ReactiveCocoa: ReactiveCocoa:
...@@ -150,10 +154,11 @@ CHECKOUT OPTIONS: ...@@ -150,10 +154,11 @@ CHECKOUT OPTIONS:
SPEC CHECKSUMS: SPEC CHECKSUMS:
AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60 AFNetworking: cb8d14a848e831097108418f5d49217339d4eb60
Bugly: 3ca9f255c01025582df26f9222893b383c7e4b4e Bugly: 3ca9f255c01025582df26f9222893b383c7e4b4e
Bytedance-UnionAD: 794d75a1af5f3635e0c2ea9d6f74720b56dba43e
DTCoreText: ad5135357a0e792f735970ed67d3ecda8b602d3d DTCoreText: ad5135357a0e792f735970ed67d3ecda8b602d3d
DTFoundation: f03be9fd786f11e505bb8fc44e2a3732bf0917df DTFoundation: f03be9fd786f11e505bb8fc44e2a3732bf0917df
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
GDTMobSDK: c1b98ef9eb199cd14636f3b6a5fdb0d4251dd076 GDTMobSDK: 374d0d956687ed5e2eb96ff98d3b5d814074b255
HappyDNS: 00c15e651a347206e58a20503a32a5564589b56a HappyDNS: 00c15e651a347206e58a20503a32a5564589b56a
IQKeyboardManager: fcef267266379c003181fc3592f6bdb8bf4db839 IQKeyboardManager: fcef267266379c003181fc3592f6bdb8bf4db839
JCore: 4072327557f0b83cc22dd4041f2f839740c0077b JCore: 4072327557f0b83cc22dd4041f2f839740c0077b
...@@ -172,6 +177,6 @@ SPEC CHECKSUMS: ...@@ -172,6 +177,6 @@ SPEC CHECKSUMS:
UMCCommonLog: 05a2d5de21858e3d870551562cff405c1366d244 UMCCommonLog: 05a2d5de21858e3d870551562cff405c1366d244
XRCarouselView: d3f949d1601e7de51604cdabd6e2f35a770e0f99 XRCarouselView: d3f949d1601e7de51604cdabd6e2f35a770e0f99
PODFILE CHECKSUM: 527f66859bae02783d9a05af259e5ace5b8cf77b PODFILE CHECKSUM: 50a1f8f844761cf2c9876175f765334cd2b086ff
COCOAPODS: 1.7.5 COCOAPODS: 1.8.4
/*
BULanguage.strings
BUAdSDK
Created by 李盛 on 2019/1/7.
Copyright © 2019 bytedance. All rights reserved.
*/
// String
"Click" = "Click";
"AD" = "AD";
"PlayConsumed" = "%.2fMB traffic will be consumed if you play it";
"Evaluation" = "Evaluation";
"Score" = "%@ score";
"Select" = "Select";
"Back" = "Back";
"Replay" = "Click to replay";
"Continue" = "Continue to play";
"Skip" = "Skip";
"ViewNow" = "View now";
"Download" = "Download";
"LoadFailure" = "Failed to load, and click to try again";
"GetRewardAfterWatching" = "Get reward after watching the full video";
"GiveUpReward" = "Give up reward";
"ContinueWatching" = "Continue watching";
"CanbeTurnedOffAfter" = "can be turned off after %ds";
"Get" = "Get";
"View" = "View";
// Icon
/*
BULanguage.strings
BUAdSDK
Created by 李盛 on 2019/1/7.
Copyright © 2019 bytedance. All rights reserved.
*/
// String
"Click" = "クリック";
"AD" = "広告";
"PlayConsumed" = "再生すると%.2fMBの通信量が消費されます";
"Evaluation" = "評価";
"Score" = "評価数:%@";
"Select" = "選択";
"Back" = "戻る";
"Replay" = "リプレイ";
"Continue" = "再生し続ける";
"Skip" = "skip";
"ViewNow" = "詳細を見る";
"Download" = "download";
"LoadFailure" = "ロードに失敗しました。クリックして再度お試しください";
"GetRewardAfterWatching" = "動画を最後まで視聴いただけるとリワードを付与されます";
"GiveUpReward" = "リワード不要";
"ContinueWatching" = "視聴し続ける";
"CanbeTurnedOffAfter" = "%ds後に閉じられます";
"Get" = "Get";
"View" = "View";
// Icon
/*
BULanguage.strings
BUAdSDK
Created by 李盛 on 2019/1/7.
Copyright © 2019 bytedance. All rights reserved.
*/
// String
"Click" = "点击";
"AD" = "广告";
"PlayConsumed" = "播放将消耗%.2fMB流量";
"Evaluation" = "评价";
"Score" = "%@个评分";
"Select" = "选择";
"Back" = "返回";
"Replay" = "点击重播";
"Continue" = "继续播放";
"Skip" = "跳过";
"ViewNow" = "立即查看";
"Download" = "立即下载";
"LoadFailure" = "加载失败,点击重试";
"GetRewardAfterWatching" = "观看完整视频才能获得奖励";
"GiveUpReward" = "放弃奖励";
"ContinueWatching" = "继续观看";
"CanbeTurnedOffAfter" = "%ds后可关闭";
"Get" = "下载";
"View" = "查看";
// Icon
framework module BUAdSDK {
umbrella header "BUAdSDK.h"
export *
module * { export * }
}
//
// BUAdSDK.h
// BUAdSDK
//
// Copyright © 2017年 bytedance. All rights reserved.
//
#import <UIKit/UIKit.h>
// In this header, you should import all the public headers of your framework using statements like #import <BUAdSDK/PublicHeader.h>
#import <BUAdSDK/BUAdSDKDefines.h>
#import <BUAdSDK/BUAdSDKManager.h>
#import <BUAdSDK/BUAdSDKError.h>
#import <BUAdSDK/BUAdSlot.h>
#import <BUAdSDK/BUImage.h>
#import <BUAdSDK/BUSize.h>
#import <BUAdSDK/BUMaterialMeta.h>
#import <BUAdSDK/BUPlayerPublicDefine.h>
#import <BUAdSDK/BUVideoAdView.h>
///customize dislike style
#import <BUAdSDK/BUDislike.h>
#import <BUAdSDK/BUDislikeWords.h>
/// native ads
#import <BUAdSDK/BUNativeAd.h>
#import <BUAdSDK/BUNativeAdRelatedView.h>
#import <BUAdSDK/BUNativeAdsManager.h>
/// native express ads
#import <BUAdSDK/BUNativeExpressAdManager.h>
#import <BUAdSDK/BUNativeExpressAdView.h>
#import <BUAdSDK/BUNativeExpressBannerView.h>
#import <BUAdSDK/BUNativeExpressInterstitialAd.h>
#import <BUAdSDK/BUNativeExpressRewardedVideoAd.h>
#import <BUAdSDK/BUNativeExpressFullscreenVideoAd.h>
/// banner ads
#import <BUAdSDK/BUBannerAdView.h>
/// splash ads
#import <BUAdSDK/BUSplashAdView.h>
/// interstitial ads
#import <BUAdSDK/BUInterstitialAd.h>
/// rewarded video ads
#import <BUAdSDK/BURewardedVideoModel.h>
#import <BUAdSDK/BURewardedVideoAd.h>
/// full-screen video ads
#import <BUAdSDK/BUFullscreenVideoAd.h>
/// playable tool
#import <BUAdSDK/BUAdSDKPlayableToolManager.h>
//
// BUAdSDKDefines.h
// BUAdSDK
//
// Copyright © 2017年 bytedance. All rights reserved.
//
#ifndef BUAdSDK_DEFINES_h
#define BUAdSDK_DEFINES_h
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, BUUserGender) {
BUUserGenderUnknown,
BUUserGenderMan,
BUUserGenderWoman,
};
typedef NS_ENUM(NSInteger, BUAdSDKLogLevel) {
BUAdSDKLogLevelNone,
BUAdSDKLogLevelError,
BUAdSDKLogLevelDebug
};
typedef NS_ENUM(NSInteger, BURitSceneType) {
BURitSceneType_custom = 0,//custom
BURitSceneType_home_open_bonus = 1,//Login/open rewards (login, sign-in, offline rewards doubling, etc.)
BURitSceneType_home_svip_bonus = 2,//Special privileges (VIP privileges, daily rewards, etc.)
BURitSceneType_home_get_props = 3,//Watch rewarded video ad to gain skin, props, levels, skills, etc
BURitSceneType_home_try_props = 4,//Watch rewarded video ad to try out skins, props, levels, skills, etc
BURitSceneType_home_get_bonus = 5,//Watch rewarded video ad to get gold COINS, diamonds, etc
BURitSceneType_home_gift_bonus = 6,//Sweepstakes, turntables, gift boxes, etc
BURitSceneType_game_start_bonus = 7,//Before the opening to obtain physical strength, opening to strengthen, opening buff, task props
BURitSceneType_game_reduce_waiting = 8,//Reduce wait and cooldown on skill CD, building CD, quest CD, etc
BURitSceneType_game_more_opportunities = 9,//More chances (resurrect death, extra game time, decrypt tips, etc.)
BURitSceneType_game_finish_rewards = 10,//Settlement multiple times/extra bonus (completion of chapter, victory over boss, first place, etc.)
BURitSceneType_game_gift_bonus = 11//The game dropped treasure box, treasures and so on
};
@protocol BUToDictionary <NSObject>
- (NSDictionary *)dictionaryValue;
@end
#endif
//
// BUAdSDKError.h
// BUAdSDK
//
// Copyright © 2017年 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
extern NSErrorDomain BUErrorDomain ;
typedef NS_ENUM(NSInteger, BUErrorCode) {
BUErrorCodeTempError = -6, // native template is invalid
BUErrorCodeTempAddationError= -5, // native template addation is invalid
BUErrorCodeOpenAPPStoreFail = -4, // failed to open appstore
BUErrorCodeNOAdError = -3, // parsed data has no ads
BUErrorCodeNetError = -2, // network request failed
BUErrorCodeParseError = -1, // parsing failed
BUErrorCodePlayableError_ERR_HAS_CACHE = -702, // has cache
BUErrorCodePlayableError_ERR_UNZIP = -704, // unzip error
BUErrorCodeNERenderResultError= 101, // native Express ad, render result parse fail
BUErrorCodeNETempError = 102, // native Express ad, template is invalid
BUErrorCodeNETempPluginError = 103, // native Express ad, template plugin is invalid
BUErrorCodeNEDataError = 104, // native Express ad, data is invalid
BUErrorCodeNEParseError = 105, // native Express ad, parse fail
BUErrorCodeNERenderError = 106, // native Express ad, render fail
BUErrorCodeNERenderTimoutError= 107, // native Express ad, render timeout
BUErrorCodeSDKStop = 1000, // SDK stop forcely
BUErrorCodeParamError = 10001, // parameter error
BUErrorCodeTimeout = 10002,
BUErrorCodeSuccess = 20000,
BUErrorCodeNOAD = 20001, // no ads
BUErrorCodeContentType = 40000, // http conent_type error
BUErrorCodeRequestPBError = 40001, // http request pb error
BUErrorCodeAppEmpty = 40002, // request app can't be empty
BUErrorCodeWapEMpty = 40003, // request wap can't be empty
BUErrorCodeAdSlotEmpty = 40004, // missing ad slot description
BUErrorCodeAdSlotSizeEmpty = 40005, // the ad slot size is invalid
BUErrorCodeAdSlotIDError = 40006, // the ad slot ID is invalid
BUErrorCodeAdCountError = 40007, // request the wrong number of ads
BUUnionAdImageSizeError = 40008, // wrong image size
BUUnionAdSiteIdError = 40009, // Media ID is illegal
BUUnionAdSiteMeiaTypeError = 40010, // Media type is illegal
BUUnionAdSiteAdTypeError = 40011, // Ad type is illegal
BUUnionAdSiteAccessMethodError = 40012,// Media access type is illegal and has been deprecated
BUUnionSplashAdTypeError = 40013, // Code bit id is less than 900 million, but adType is not splash ad
BUUnionRedirectError = 40014, // The redirect parameter is incorrect
BUUnionRequestInvalidError = 40015, // Media rectification exceeds deadline, request illegal
BUUnionAppSiteRelError = 40016, // The relationship between slot_id and app_id is invalid.
BUUnionAccessMethodError = 40017, // Media access type is not legal API/SDK
BUUnionPackageNameError = 40018, // Media package name is inconsistent with entry
BUUnionConfigurationError = 40019, // Media configuration ad type is inconsistent with request
BUUnionRequestLimitError = 40020, // The ad space registered by developers exceeds daily request limit
BUUnionSignatureError = 40021, // Apk signature sha1 value is inconsistent with media platform entry
BUUnionIncompleteError = 40022, // Whether the media request material is inconsistent with the media platform entry
BUUnionOSError = 40023, // The OS field is incorrectly filled
BUUnionLowVersion = 40024, // The SDK version is too low to return ads
BUErrorCodeAdPackageIncomplete = 40025,// the SDK package is incomplete. It is recommended to verify the integrity of SDK package or contact technical support.
BUUnionMedialCheckError = 40026, // Non-international account request for overseas delivery system
BUErrorCodeSysError = 50001 // ad server error
};
//
// BUAdSDKManager.h
// BUAdSDK
//
// Copyright © 2017 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BUAdSDKDefines.h"
@interface BUAdSDKManager : NSObject
@property (nonatomic, copy, readonly, class) NSString *SDKVersion;
/**
Register the App key that’s already been applied before requesting an ad from TikTok Audience Network.
@param appID : the unique identifier of the App
*/
+ (void)setAppID:(NSString *)appID;
/**
Configure development mode.
@param level : default BUAdSDKLogLevelNone
*/
+ (void)setLoglevel:(BUAdSDKLogLevel)level;
/// Set the gender of the user.
+ (void)setUserGender:(BUUserGender)userGender;
/// Set the age of the user.
+ (void)setUserAge:(NSUInteger)userAge;
/// Set the user's keywords, such as interests and hobbies, etc.
+ (void)setUserKeywords:(NSString *)keywords;
/// set additional user information.
+ (void)setUserExtData:(NSString *)data;
/// Set whether the app is a paid app, the default is a non-paid app
+ (void)setIsPaidApp:(BOOL)isPaidApp;
+ (NSString *)appID;
+ (BOOL)isPaidApp;
@end
//
// BUAdSDKPlayableToolManager.h
// BUAdSDK
//
// Copyright © 2019 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BUAdSDKPlayableToolManager : NSObject
+ (instancetype)sharedInstance;
+ (void)setPlayableURL:(NSString *)url;
+ (void)setDownloadUrl:(NSString *)url;
+ (void)setIsLandScape:(BOOL)isLandScape;
+ (void)clearAll;
@end
//
// BUAdSlot.h
// BUAdSDK
//
// Copyright © 2017 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BUSize.h"
typedef NS_ENUM(NSInteger, BUAdSlotAdType) {
BUAdSlotAdTypeUnknown = 0,
BUAdSlotAdTypeBanner = 1, // banner ads
BUAdSlotAdTypeInterstitial = 2, // interstitial ads
BUAdSlotAdTypeSplash = 3, // splash ads
BUAdSlotAdTypeSplash_Cache = 4, // cache splash ads
BUAdSlotAdTypeFeed = 5, // feed ads
BUAdSlotAdTypePaster = 6, // paster ads
BUAdSlotAdTypeRewardVideo = 7, // rewarded video ads
BUAdSlotAdTypeFullscreenVideo = 8, // full-screen video ads
BUAdSlotAdTypeDrawVideo = 9, // vertical (immersive) video ads
};
typedef NS_ENUM(NSInteger, BUAdSlotPosition) {
BUAdSlotPositionTop = 1,
BUAdSlotPositionBottom = 2,
BUAdSlotPositionFeed = 3,
BUAdSlotPositionMiddle = 4, // for interstitial ad only
BUAdSlotPositionFullscreen = 5,
};
@interface BUAdSlot : NSObject
/// required. The unique identifier of a native ad.
@property (nonatomic, copy) NSString *ID;
/// required. Ad type.
@property (nonatomic, assign) BUAdSlotAdType AdType;
/// required. Ad display location.
@property (nonatomic, assign) BUAdSlotPosition position;
/// Accept a set of image sizes, please pass in the BUSize object.
@property (nonatomic, strong) NSMutableArray<BUSize *> *imgSizeArray;
/// required. Image size.
@property (nonatomic, strong) BUSize *imgSize;
/// Icon size.
@property (nonatomic, strong) BUSize *iconSize;
/// Maximum length of the title.
@property (nonatomic, assign) NSInteger titleLengthLimit;
/// Maximum length of description.
@property (nonatomic, assign) NSInteger descLengthLimit;
/// Whether to support deeplink.
@property (nonatomic, assign) BOOL isSupportDeepLink;
/// Native banner ads and native interstitial ads are set to 1, other ad types are 0, the default is 0.
@property (nonatomic, assign) BOOL isOriginAd;
- (NSDictionary *)dictionaryValue;
@end
//
// BUBannerAdView.h
// BUAdSDK
//
// Copyright © 2017年 bytedance. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "BUNativeAd.h"
@class BUDislikeWords, BUAdSlot;
@protocol BUBannerAdViewDelegate;
NS_ASSUME_NONNULL_BEGIN
@interface BUBannerAdView : UIView
@property (nonatomic, weak, nullable) id<BUBannerAdViewDelegate> delegate;
/**
The carousel interval, in seconds, is set in the range of 30~120s, and is passed during initialization. If it does not meet the requirements, it will not be in carousel ad.
*/
@property (nonatomic, assign, readonly) NSInteger interval;
/**
The dislikeButton has been added to the upper right corner of the BannerView by default, it will respond to dislike reasons.
*/
@property (nonatomic, strong, readonly, nonnull) UIButton *dislikeButton;
- (instancetype)initWithIdentifier:(NSString *)slotID
rootViewController:(UIViewController *)rootViewController
adSize:(CGSize)adSize
withShowPosition:(BUAdSlotPosition)showPosition
WithIsSupportDeepLink:(BOOL)isSupportDeepLink;
- (instancetype)initWithIdentifier:(NSString *)slotID
rootViewController:(UIViewController *)rootViewController
adSize:(CGSize)adSize
withShowPosition:(BUAdSlotPosition)showPosition
WithIsSupportDeepLink:(BOOL)isSupportDeepLink
interval:(NSInteger)interval;
- (instancetype)initWithSlotID:(NSString *)slotID
size:(BUSize *)adSize
rootViewController:(UIViewController *)rootViewController;
- (instancetype)initWithSlotID:(NSString *)slotID
size:(BUSize *)adSize
rootViewController:(UIViewController *)rootViewController
interval:(NSInteger)interval;
- (void)loadAdData;
- (IBAction)dislikeAction:(id)sender;
@end
@protocol BUBannerAdViewDelegate <NSObject>
@optional
/**
This method is called when bannerAdView ad slot loaded successfully.
@param bannerAdView : view for bannerAdView
@param nativeAd : nativeAd for bannerAdView
*/
- (void)bannerAdViewDidLoad:(BUBannerAdView *)bannerAdView WithAdmodel:(BUNativeAd *_Nullable)nativeAd;
/**
This method is called when bannerAdView ad slot failed to load.
@param error : the reason of error
*/
- (void)bannerAdView:(BUBannerAdView *)bannerAdView didLoadFailWithError:(NSError *_Nullable)error;
/**
This method is called when bannerAdView ad slot showed new ad.
*/
- (void)bannerAdViewDidBecomVisible:(BUBannerAdView *)bannerAdView WithAdmodel:(BUNativeAd *_Nullable)nativeAd;
/**
This method is called when bannerAdView is clicked.
*/
- (void)bannerAdViewDidClick:(BUBannerAdView *)bannerAdView WithAdmodel:(BUNativeAd *_Nullable)nativeAd;
/**
This method is called when the user clicked dislike button and chose dislike reasons.
@param filterwords : the array of reasons for dislike.
*/
- (void)bannerAdView:(BUBannerAdView *)bannerAdView dislikeWithReason:(NSArray<BUDislikeWords *> *_Nullable)filterwords;
/**
This method is called when another controller has been closed.
@param interactionType : open appstore in app or open the webpage or view video ad details page.
*/
- (void)bannerAdViewDidCloseOtherController:(BUBannerAdView *)bannerAdView interactionType:(BUInteractionType)interactionType;
@end
NS_ASSUME_NONNULL_END
//
// BUDislike.h
// BUAdSDK
//
// Copyright © 2018年 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
@class BUNativeAd;
@class BUDislikeWords;
/**
!!! important :
Please report to the sdk the user’s selection, inaccurate model will result in poor ad performance.
*/
@interface BUDislike : NSObject
/**
The array of BUDislikeWords which have reasons for dislike.
The application can show the secondary page for dislike if '[filterWords.options count] > 0'.
*/
@property (nonatomic, copy, readonly) NSArray<BUDislikeWords *> *filterWords;
/**
Initialize with nativeAd to get filterWords.
return BUDislike
*/
- (instancetype)initWithNativeAd:(BUNativeAd *)nativeAd;
/**
Call this method after the user chose dislike reasons.
(Only for object which uses 'BUDislike.filterWords')
@param filterWord : reasons for dislike
@note : don't need to call this method if '[filterWords.options count] > 0'.
@note :please dont't change 'BUDislike.filterWords'.
'filterWord' must be one of 'BUDislike.filterWords', otherwise it will be filtered.
*/
- (void)didSelectedFilterWordWithReason:(BUDislikeWords *)filterWord;
@end
//
// BUDislikeWords.h
// BUAdSDK
//
// Copyright © 2017年 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BUDislikeWords : NSObject <NSCoding>
@property (nonatomic, copy, readonly) NSString *dislikeID;
@property (nonatomic, copy, readonly) NSString *name;
@property (nonatomic, assign, readonly) BOOL isSelected;
@property (nonatomic, copy,readonly) NSArray<BUDislikeWords *> *options;
- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)error;
@end
//
// BUFullscreenVideoAd.h
// BUAdSDK
//
// Copyright © 2018年 bytedance. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "BUAdSlot.h"
NS_ASSUME_NONNULL_BEGIN
@class BUFullscreenVideoAd;
@protocol BUFullscreenVideoAdDelegate <NSObject>
@optional
/**
This method is called when video ad material loaded successfully.
*/
- (void)fullscreenVideoMaterialMetaAdDidLoad:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad materia failed to load.
@param error : the reason of error
*/
- (void)fullscreenVideoAd:(BUFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error;
/**
This method is called when video cached successfully.
*/
- (void)fullscreenVideoAdVideoDataDidLoad:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad slot will be showing.
*/
- (void)fullscreenVideoAdWillVisible:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad slot has been shown.
*/
- (void)fullscreenVideoAdDidVisible:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad is clicked.
*/
- (void)fullscreenVideoAdDidClick:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad is about to close.
*/
- (void)fullscreenVideoAdWillClose:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad is closed.
*/
- (void)fullscreenVideoAdDidClose:(BUFullscreenVideoAd *)fullscreenVideoAd;
/**
This method is called when video ad play completed or an error occurred.
@param error : the reason of error
*/
- (void)fullscreenVideoAdDidPlayFinish:(BUFullscreenVideoAd *)fullscreenVideoAd didFailWithError:(NSError *_Nullable)error;
/**
This method is called when the user clicked skip button.
*/
- (void)fullscreenVideoAdDidClickSkip:(BUFullscreenVideoAd *)fullscreenVideoAd;
@end
@interface BUFullscreenVideoAd : NSObject
@property (nonatomic, weak, nullable) id<BUFullscreenVideoAdDelegate> delegate;
@property (nonatomic, getter=isAdValid, readonly) BOOL adValid;
/**
Initializes video ad with slot id.
@param slotID : the unique identifier of video ad.
@return BUFullscreenVideoAd
*/
- (instancetype)initWithSlotID:(NSString *)slotID;
/**
Load video ad datas.
*/
- (void)loadAdData;
/**
Display video ad.
@param rootViewController : root view controller for displaying ad.
@return : whether it is successfully displayed.
*/
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController;
/**
Display video ad.
@param rootViewController : root view controller for displaying ad.
@param sceneDescirbe : optional. Identifies a custom description of the presentation scenario.
@return : whether it is successfully displayed.
*/
- (BOOL)showAdFromRootViewController:(UIViewController *)rootViewController ritSceneDescribe:(NSString *_Nullable)sceneDescirbe;
@end
NS_ASSUME_NONNULL_END
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment