Difference between revisions of "IOS Video 4.1.0"
From AdLocus
Line 11: | Line 11: | ||
在您想啟用影音版位的流程中, 加入下列程式碼 | 在您想啟用影音版位的流程中, 加入下列程式碼 | ||
<syntaxhighlight lang="objc"> | <syntaxhighlight lang="objc"> | ||
− | self.video = [[ALVideo alloc] initWithViewController:self delegate:self]; | + | ALTargeting *targeting = [ALTargeting new]; |
+ | self.video = [[ALVideo alloc] initWithViewController:self | ||
+ | key:@"請填入APP KEY" | ||
+ | targeting:targeting | ||
+ | delegate:self]; | ||
[video load]; | [video load]; | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 15:01, 2 June 2016
Contents
前言
影音版位將以曝光次數高分潤,是您提高收益的最好單元之一。
實作
- @interface ViewController : UIViewController <ALVideoDelegate>
- @property (nonatomic, strong) ALVideo *video;
- - (void) videoDidReceive:(ALVideo *)video
啟用插頁式版位
在您想啟用影音版位的流程中, 加入下列程式碼
ALTargeting *targeting = [ALTargeting new]; self.video = [[ALVideo alloc] initWithViewController:self key:@"請填入APP KEY" targeting:targeting delegate:self]; [video load];
並透過監聽結果啟用影音插屏
- (void) videoDidReceive:(ALVideo *)video { NSLog(@"Receive AdLocus Video Ad."); [video show]; }
若您需要監聽廣告互動結果
透過實作 ALVideoDelegate 監測廣告運行結果
- videoDidReceive
- videoDidEnd
- (void) videoDidReceive:(ALVideo *)video { NSLog(@"Receive AdLocus Video Ad."); [video show]; } - (void) videoDidEnd:(ALVideo *)video { NSLog(@"End AdLocus Video Ad."); }