「IOS注意事項」修訂間的差異
		
		
		
		
		
		跳至導覽
		跳至搜尋
		
				
		
		
	
| imported>Wikiuser  (新頁面: 回iOS首頁<br>  <!-- == 舊版SDK升版至SDK6 == #移除下列檔案: #* libTWMTAMediaAdsSDK.a #* TADAdSize.h #* TADBannerView.h #* TADBannerViewDeleg...) | imported>Wikiuser  | ||
| 行 1: | 行 1: | ||
| [[IOS SDK Developer Guide v2|回iOS首頁]]<br> | [[IOS SDK Developer Guide v2|回iOS首頁]]<br> | ||
| == 舊版SDK升版至SDK6 == | == 舊版SDK升版至SDK6 == | ||
| #移除下列檔案: | #移除下列檔案: | ||
| 行 20: | 行 19: | ||
| #專案加入TAMediaAdsFramework.framework | #專案加入TAMediaAdsFramework.framework | ||
| #將程式碼內有加入TAMedia標頭檔.h的地方皆改為#import <TAMediaAdsFramework/TAMediaAdsFramework.h> | #將程式碼內有加入TAMedia標頭檔.h的地方皆改為#import <TAMediaAdsFramework/TAMediaAdsFramework.h> | ||
| == 麥克風相關 ==    | == 麥克風相關 ==    | ||
| TADBannerView以及TADInterstitial新增turnOnMicrophone屬性,設為YES時會與使用者詢問是否開啟麥克風,故需於app info中要設定Privacy - Microphone Usage Description。 | TADBannerView以及TADInterstitial新增turnOnMicrophone屬性,設為YES時會與使用者詢問是否開啟麥克風,故需於app info中要設定Privacy - Microphone Usage Description。 | ||
於 2018年6月21日 (四) 03:45 的修訂
舊版SDK升版至SDK6
- 移除下列檔案:
- libTWMTAMediaAdsSDK.a
- TADAdSize.h
- TADBannerView.h
- TADBannerViewDelegate.h
- TADInterstitial.h
- TADInterstitialDelegate.h
- TADRequest.h
- TADRequestError.h
- TADVideoAdView.h
- TADVideoAdViewDelegate.h
- TAMClose.png
- facebook.png
- TAMTarget.png
- mute.caf
 
- 專案加入TAMediaAdsFramework.framework
- 將程式碼內有加入TAMedia標頭檔.h的地方皆改為#import <TAMediaAdsFramework/TAMediaAdsFramework.h>
麥克風相關
TADBannerView以及TADInterstitial新增turnOnMicrophone屬性,設為YES時會與使用者詢問是否開啟麥克風,故需於app info中要設定Privacy - Microphone Usage Description。 若是設為NO,將不提供有麥克風互動式廣告,default設為YES。
音樂類型app
因為SDK4支援麥克風互動式ad,若是ad開啟麥克風功能,會導致播放音樂時狀態被搶走,造成關閉ad後音樂無法持續播放。 已提供解決方案(參見下方說明),或是可以直接拒絕接收麥克風ad,將turnOnMicrophone設為NO。
解決中斷音樂回覆方法為監聽AVAudioSessionInterruptionNotification(若是有處理回復來電時中斷音樂的情況原本已經有監聽,只需新增標示處的code,於收到中斷時將music暫停,中斷結束時將music重新播放。 範例如下:
// 增加監聽 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(audioSessionInterrupted:) name:AVAudioSessionInterruptionNotification object:nil];
// 監聽Session被中斷時,先暫停音樂  
-  (void)audioSessionInterrupted:(NSNotification*)notification {
   NSNumber *interruptionType = [[notification userInfo] objectForKey:AVAudioSessionInterruptionTypeKey];
   NSNumber *interruptionOption = [[notification userInfo] objectForKey:AVAudioSessionInterruptionOptionKey];
   switch (interruptionType.unsignedIntegerValue) {
       case AVAudioSessionInterruptionTypeBegan:{
           // • Audio has stopped, already inactive
           // • Change state of UI, etc., to reflect non-playing state
           [_audioPlayer pause]; //若原本就有處理來電中斷音樂只需新增此段code
       } break;
       case AVAudioSessionInterruptionTypeEnded:{
           // • Make session active
           [[AVAudioSession sharedInstance] setActive:YES withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation error:nil];
           // • Update user interface
           // • AVAudioSessionInterruptionOptionShouldResume option
           if (interruptionOption.unsignedIntegerValue == AVAudioSessionInterruptionOptionShouldResume) {
               // Here you should continue playback.
               [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
               [_audioPlayer play];
           }
       } break;
       default:
           break;
   }  
 }