Skip to content

Commit

Permalink
v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DullFox committed May 12, 2017
1 parent 254d5e0 commit bcb9c02
Show file tree
Hide file tree
Showing 11 changed files with 313 additions and 59 deletions.
72 changes: 58 additions & 14 deletions Docs/Getting_Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
|-📄 SMANativeAd.h
|-📄 SMANativeAdView.h
|-📄 SMANativeAdImage.h
|-📃 libSuntengMobileAds.a
|-📄 SMAPreMovieAd.h
|-📦 libSuntengMobileAds.a
```

#### 2.2、添加需要的 Framework:
Expand Down Expand Up @@ -340,46 +341,89 @@ if (self.modalVideoAd.isReady) {

### 3.6、窗口视频广告

#### 3.5.1、创建窗口视频广告
#### 3.6.1、创建窗口视频广告

```objc
self.windowVideoAd = [[SMAWindowVideoAd alloc] initWithAdUnitID:@"2-36-41"];
```
#### 3.5.2、请求窗口视频广告
#### 3.6.2、请求窗口视频广告
```objc
[self.windowVideoAd loadAd];
```

#### 3.5.3、展示窗口视频广告
#### 3.6.3、展示窗口视频广告

当您需要展示窗口视频广告时,请在尝试展示之前检查它是否已准备就绪
当您需要展示窗口视频广告时**请提前获取广告,并在广告资源下载成功后再展示**),请在展示之前检查它是否已准备就绪

```objc
if (self.windowVideoAd.isReady) {
[self.windowVideoAd disposeInView:containerView presentFromViewController:rootViewController];
}
```

#### 3.5.4、控制窗口视频广告播放、暂停
#### 3.6.4、跟踪窗口视频广告生命周期

当将广告添加在 UIScrollView、UITableView 等可滚动的控件上时,请自行在视频滚出屏幕时,使用 - (void)playVideo; 和 - (void)pauseVideo; 方法控制视频的暂停和继续播放。
```objc
- (void)windowVideoAdDidLoad:(SMAWindowVideoAd *)windowVideoAd;

- (void)windowVideoAd:(SMAWindowVideoAd *)windowVideoAd didFailToLoadWithError:(NSError *)error;

- (void)windowVideoAdDidTap:(SMAWindowVideoAd *)windowVideoAd;

- (void)windowVideoAdDidPlayFinished:(SMAWindowVideoAd *)windowVideoAd;
```

### 3.7、贴片视频广告

#### 3.7.1、创建贴片视频广告

```objc
[self.windowVideoAd playVideo];
self.preMovieAd = [[SMAPreMovieAd alloc] initWithAdUnitID:@"2-36-143"];
```
[self.windowVideoAd pauseVideo];
#### 3.7.2、请求贴片视频广告
```objc
[self.preMovieAd loadAd];
```

#### 3.5.5、跟踪窗口视频广告生命周期
#### 3.7.3、展示贴片视频广告

当您需要展示贴片视频广告时(**请提前获取广告,并在广告资源下载成功后再展示**),请在展示之前检查它是否已准备就绪。

```objc
- (void)windowVideoAdDidLoad:(SMAWindowVideoAd *)windowVideoAd;
if (self.preMovieAd.isReady) {
[self.preMovieAd disposeInView:self.preMovieAdContainerView presentFromViewController:rootViewController];
}
```

- (void)windowVideoAd:(SMAWindowVideoAd *)windowVideoAd didFailToLoadWithError:(NSError *)error;
#### 3.7.4、跟踪贴片视频广告生命周期

- (void)windowVideoAdDidTap:(SMAWindowVideoAd *)windowVideoAd;
```objc
- (void)preMovieAdDidLoad:(SMAPreMovieAd *)preMovieAd;

- (void)windowVideoAdDidPlayFinished:(SMAWindowVideoAd *)windowVideoAd;
- (void)preMovieAd:(SMAPreMovieAd *)preMovieAd didFailToLoadWithError:(NSError *)error;

- (void)preMovieAdDidTap:(SMAPreMovieAd *)preMovieAd;

- (void)preMovieAdDidPlayFinished:(SMAPreMovieAd *)preMovieAd;

- (void)updatePreMovieAdPlayCurrentTime:(NSTimeInterval)time duration:(NSTimeInterval)duration;
```

#### 3.7.5、贴片视频其它 API

```objc
// 是否展示贴片广告进度倒计时
@property(nonatomic, assign, getter=isTimeCounterHidden) BOOL timeCounterHidden;

// 是否展示“查看详情”按钮
@property(nonatomic, assign, getter=isCheckDetailButtonHidden) BOOL checkDetailButtonHidden;

// 设置贴片广告支持的网络环境,默认支持 2G、3G、4G、Wi-Fi 网络环境下下载广告资源。
@property (nonatomic, assign) SMASupportedNetworkOptions supportedNetwork;

- (void)setMuteEnable:(BOOL)muteEnable;
```
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@

## Change Log

05/12/2017 - v3.1.0

* Add in-stream video ad.
* Bugs fixes.

03/27/2017 - v3.0.0

* Add modal video ad.
Expand Down
26 changes: 19 additions & 7 deletions STMobSDKSample/STMobSDKSample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
C59E8F7B1CCA1A4900E4F152 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C59E8F7A1CCA1A4900E4F152 /* Foundation.framework */; };
C59E8F7D1CCA1A4F00E4F152 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C59E8F7C1CCA1A4F00E4F152 /* SystemConfiguration.framework */; };
C59E8F7F1CCA1A5500E4F152 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C59E8F7E1CCA1A5500E4F152 /* UIKit.framework */; };
D802464A1EC5BFEE00679906 /* SMADemoPreMovieViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D80246491EC5BFEE00679906 /* SMADemoPreMovieViewController.m */; };
D86FAF5C1D17F379003432D8 /* LaunchImage.png in Resources */ = {isa = PBXBuildFile; fileRef = D86FAF531D17F379003432D8 /* LaunchImage.png */; };
D86FAF5D1D17F379003432D8 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = D86FAF541D17F379003432D8 /* [email protected] */; };
D86FAF5E1D17F379003432D8 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = D86FAF551D17F379003432D8 /* [email protected] */; };
Expand Down Expand Up @@ -75,6 +76,9 @@
C59E8F7A1CCA1A4900E4F152 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
C59E8F7C1CCA1A4F00E4F152 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
C59E8F7E1CCA1A5500E4F152 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
D80246471EC5BF8F00679906 /* SMAPreMovieAd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMAPreMovieAd.h; sourceTree = "<group>"; };
D80246481EC5BFEE00679906 /* SMADemoPreMovieViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SMADemoPreMovieViewController.h; sourceTree = "<group>"; };
D80246491EC5BFEE00679906 /* SMADemoPreMovieViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SMADemoPreMovieViewController.m; sourceTree = "<group>"; };
D86FAF531D17F379003432D8 /* LaunchImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = LaunchImage.png; sourceTree = "<group>"; };
D86FAF541D17F379003432D8 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
D86FAF551D17F379003432D8 /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -161,6 +165,8 @@
330EC12F1E83C6C6007F4F8B /* SMADemoModalVideoViewController.m */,
330EC1311E83C6E0007F4F8B /* SMADemoWindowVideoViewController.h */,
330EC1321E83C6E0007F4F8B /* SMADemoWindowVideoViewController.m */,
D80246481EC5BFEE00679906 /* SMADemoPreMovieViewController.h */,
D80246491EC5BFEE00679906 /* SMADemoPreMovieViewController.m */,
C59E8F5C1CCA165300E4F152 /* Main.storyboard */,
C59E8F5F1CCA165300E4F152 /* Assets.xcassets */,
C59E8F641CCA165300E4F152 /* Info.plist */,
Expand Down Expand Up @@ -222,6 +228,7 @@
D8C106C81E88F68300FDC4D7 /* SMANativeAd.h */,
D8C106C91E88F68300FDC4D7 /* SMANativeAdImage.h */,
D8C106CA1E88F68300FDC4D7 /* SMANativeAdView.h */,
D80246471EC5BF8F00679906 /* SMAPreMovieAd.h */,
D8C106CB1E88F68300FDC4D7 /* SMASplashAd.h */,
D8C106CC1E88F68300FDC4D7 /* SMAWindowVideoAd.h */,
D8C106CD1E88F68300FDC4D7 /* SuntengMobileAds.h */,
Expand Down Expand Up @@ -256,12 +263,12 @@
C59E8F481CCA165200E4F152 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0720;
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = sunteng;
TargetAttributes = {
C59E8F4F1CCA165200E4F152 = {
CreatedOnToolsVersion = 7.2;
ProvisioningStyle = Manual;
ProvisioningStyle = Automatic;
SystemCapabilities = {
com.apple.InAppPurchase = {
enabled = 0;
Expand Down Expand Up @@ -325,6 +332,7 @@
C59E8F581CCA165200E4F152 /* AppDelegate.m in Sources */,
C59E8F551CCA165200E4F152 /* main.m in Sources */,
330EC1301E83C6C6007F4F8B /* SMADemoModalVideoViewController.m in Sources */,
D802464A1EC5BFEE00679906 /* SMADemoPreMovieViewController.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -355,8 +363,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand All @@ -380,7 +390,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -401,8 +411,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand All @@ -420,7 +432,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -441,7 +453,7 @@
INFOPLIST_FILE = STMobSDKSample/Info.plist;
INFOPLIST_PREFIX_HEADER = "";
INFOPLIST_PREPROCESS = NO;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
Expand All @@ -460,14 +472,14 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEVELOPMENT_TEAM = "";
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(SRCROOT)/STMobSDKSample/PrefixHeader.pch";
INFOPLIST_FILE = STMobSDKSample/Info.plist;
INFOPLIST_PREFIX_HEADER = "";
INFOPLIST_PREPROCESS = NO;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
Expand Down
Loading

0 comments on commit bcb9c02

Please sign in to comment.