「InStream iOS Developer Guide」修訂間的差異
跳至導覽
跳至搜尋
imported>Wikiuser (→下載) |
imported>Wikiuser (→注意事項) |
||
(未顯示同一使用者於中間所作的 3 次修訂) | |||
行 29: | 行 29: | ||
userContext:nil]; | userContext:nil]; | ||
[self.adsLoader requestAdsWithRequest:request]; | [self.adsLoader requestAdsWithRequest:request]; | ||
== 注意事項 == | |||
:1.IMA iOS SDK限制行動網路最高使用300kbit/s若是要改變bitrate可在IMAAdsRenderingSettings物件設定 (參考:https://developers.google.com/interactive-media-ads/docs/sdks/ios/bitrates-formats) | |||
IMAAdsRenderingSettings *settings = [[IMAAdsRenderingSettings alloc] init]; | |||
settings.bitrate = 1024; // kbits | |||
settings.mimeTypes = @[ @"video/mp4", @"application/x-mpegURL"]; | |||
[self.adsManager initializeWithContentPlayhead:nil adsRenderingSettings:settings]; | |||
:2.IMA iOS SDK提供兩種方式開啟廣告:in-app browser或外開safari,可在IMAAdsRenderingSettings物件設定(若是使用in-app browser需在plist內增加NSAppTransportSecurity設定,將NSAllowsArbitraryLoads設為YES) | |||
IMAAdsRenderingSettings *settings = [[IMAAdsRenderingSettings alloc] init]; | |||
settings.webOpenerPresentingController = self; //增加此設定後廣告將使用in-app browser開啟 | |||
== 下載 == | == 下載 == | ||
{| class="wikitable" | {| class="wikitable" | ||
行 36: | 行 46: | ||
|1.0.0 || [[媒體:TADVastAdUtil.framework.zip | TADVastAdUtil.framework.zip ]] || 121 KB ||1.0.0 | |1.0.0 || [[媒體:TADVastAdUtil.framework.zip | TADVastAdUtil.framework.zip ]] || 121 KB ||1.0.0 | ||
|- | |- | ||
|Demo || [[媒體:VastAdDemo.zip | VastAdDemo.zip ]] || | |Demo || [[媒體:VastAdDemo.zip | VastAdDemo.zip ]] || 3.79 MB || 1.0.0版本Demo | ||
|} | |} | ||
[[InStream_Developer_Guide|回InStream首頁]] | [[InStream_Developer_Guide|回InStream首頁]] |
於 2018年10月31日 (三) 08:44 的最新修訂
功能說明
InStream套件是提供回傳VAST格式(Digital Video Ad Serving Template)URL的套件。可配合Google IMA SDK或其他支援VAST格式的Library展示InStream Video廣告。
系統需求
- iOS 8.0或以上的版本
- Xcode 7或以上的版本
整合至應用程式
開始使用
- 以Google IMA SDK為例 (IMA sample download link:https://developers.google.com/interactive-media-ads/docs/sdks/ios/download)
- 加入@import TADVastAdUtil;
- 在IMA SDK請求廣告的地方加入以下代碼,將TADVastURLCreator產生出來的URL帶入Google request AdTagUrl內
/******* TAMedia Begin 只產生VAST URL 其餘是由IMA完成 *******/ NSString *vastUrl = [TADVastURLCreator createTADVastURLWithOriginalUrl:<TAMedia提供的原始URL> testMode:<是否使用測試廣告>]; NSLog(@"Vast URL:%@",vastUrl); /******* TAMedia End *******/ /******* 以下為Google IMA *******/ // Create an ad display container for ad rendering. IMAAdDisplayContainer *adDisplayContainer = [[IMAAdDisplayContainer alloc] initWithAdContainer:self.videoView companionSlots:nil]; // Create an ad request with our ad tag, display container, and optional user context. IMAAdsRequest *request = [[IMAAdsRequest alloc] initWithAdTagUrl:vastUrl adDisplayContainer:adDisplayContainer contentPlayhead:self.contentPlayhead userContext:nil]; [self.adsLoader requestAdsWithRequest:request];
注意事項
- 1.IMA iOS SDK限制行動網路最高使用300kbit/s若是要改變bitrate可在IMAAdsRenderingSettings物件設定 (參考:https://developers.google.com/interactive-media-ads/docs/sdks/ios/bitrates-formats)
IMAAdsRenderingSettings *settings = [[IMAAdsRenderingSettings alloc] init]; settings.bitrate = 1024; // kbits settings.mimeTypes = @[ @"video/mp4", @"application/x-mpegURL"]; [self.adsManager initializeWithContentPlayhead:nil adsRenderingSettings:settings];
- 2.IMA iOS SDK提供兩種方式開啟廣告:in-app browser或外開safari,可在IMAAdsRenderingSettings物件設定(若是使用in-app browser需在plist內增加NSAppTransportSecurity設定,將NSAllowsArbitraryLoads設為YES)
IMAAdsRenderingSettings *settings = [[IMAAdsRenderingSettings alloc] init]; settings.webOpenerPresentingController = self; //增加此設定後廣告將使用in-app browser開啟
下載
Version | Package | Size | Notes |
---|---|---|---|
1.0.0 | TADVastAdUtil.framework.zip | 121 KB | 1.0.0 |
Demo | VastAdDemo.zip | 3.79 MB | 1.0.0版本Demo |