-
Notifications
You must be signed in to change notification settings - Fork 0
Unity Setting Guide iOS
Unity에서 xcode 프로젝트 생성을 완료하고 난 이후, 위의 MoPub프레임워크 다운로드 경로를 통해서 다운받은 MoPub.framework 파일을 프로젝트 > Frameworks > Plugins > iOS > Bidmad 폴더에 복사 붙여 넣는다.
Xcode > General >Frameworks, Libraries and embedded Content 항목의 '+' 버튼을 클릭하여 'Add Others..' 셀렉트 버튼을 통해 1번에서 복사해둔 MoPub.framework 파일 경로로 들어가 추가해 준다.
BuildSettings > Bitcode = NO 설정할 것.
BuildSettings > other link flags 에 -ObjC 추가할 것.
BuildSettings > Allow Non-Modular Includes In Framework Modules > YES로 세팅합니다.
General에서 BidmadSDK.framework, MoPub.framework가 반드시, embedded & sign 으로 되어있는지 확인요.
Google Admob 계정을 통해서 해당하는 앱의 ApplicationIdentifier 값 정보를 확인한 후, info.plist에 아래와 같이 추가해준다.
<key>GADApplicationIdentifier</key> <string>ca-app-pub-3940256099942544~1458002511</string>
Reward 광고 사용시, AppLovin 계정을 통해서 API KEY 값을 확인 후, 아래와 같이 info.plist에 추가해준다.
<key>AppLovinSdkKey</key> <string>XdnXU3f54cTAyFTQyu2k6zU78GyvMWhDJF7BIlJ2Ms94r3CRiveA_ewD-2fGbkSHO5H0tTS_pfoo7XAMmfFNBK</string>
Frameworks and Libraries > libxml2.tbd 파일을 추가해준다.
FBAudienceNetwork.framework 파일이 혹시 Plugin>iOS>Bidmad 폴더안에 있을 경우, 반드시 삭제한다.
테스트 코드로 광고 테스트하기
iOS 14.0 배포시, plist 파일에 아래 내용 추가할 것
<key>NSUserTrackingUsageDescription</key> <string>This identifier will be used to deliver personalized ads to you.</string>
<key>SKAdNetworkItems</key>
<array>
<dict>
<!-- AdMob -->
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
<!-- IronSource -->
<key>SKAdNetworkIdentifier</key>
<string>SU67R6K2V3.skadnetwork</string>
<!-- AdColony -->
<key>SKAdNetworkIdentifier</key>
<string>4PFYVQ9L8R.skadnetwork</string>
<!-- UnityAds -->
<key>SKAdNetworkIdentifier</key>
<string>4DZT52R2T5.skadnetwork</string>
</dict>
</array>
예제): [banner setTestDevice:@"b763d82d5e9bed4d0d235b490e6b81e6"];
[interstitial setTestDevice:@"b763d82d5e9bed4d0d235b490e6b81e6"];
[rewardVideo1 setTestDevice:@"b763d82d5e9bed4d0d235b490e6b81e6"];
최초에 위의 함수를 부르지않은 상태에서 앱을 Running 시키게되면, Xcode 하단 로그창에 아래와 같은 메시지가 뜹니다. testDeviceIdentifiers 안에 있는 디바이스 아이디를 얻어 위의 각각의 함수(배너,전면,리워드 광고에 따라서) 에 세팅합니다.
To get test ads on this device, set: GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @[ @"b763d82d5e9bed4d0d235b490e6b81e6" ];
setTestDevice를 부르지 않고, AdMob 실 광고를 호출할 경우 계정이 중지될 수 있으니, 테스트 시 반드시 호출해 주시고, 실제 앱이 배포될 시 위의 코드를 삭제해주시기 바랍니다.
After completing the creation of the xcode project in Unity, copy and paste the MoPub.framework file downloaded through the MoPub framework download path above to the Project> Frameworks> Plugins> iOS> Bidmad folder.
Click the '+' button of Xcode> General> Frameworks, Libraries and embedded Content, and add it to the path of the MoPub.framework file copied in step 1 through the 'Add Others ..' select button.
Set BuildSettings> Bitcode = NO.
Add -ObjC to BuildSettings> other link flags.
BuildSettings > Allow Non-Modular Includes In Framework Modules > Set 'YES'
In General, check if BidmadSDK.framework and MoPub.framework are embedded & sign.
Check the ApplicationIdentifier value information of the corresponding app through the Google Admob account, and add it to info.plist as shown below.
<key>GADApplicationIdentifier</key> <string>ca-app-pub-3940256099942544~1458002511</string>
When using Reward Ad, check the API KEY value through AppLovin account and add it to info.plist as below.
<key>AppLovinSdkKey</key> <string>XdnXU3f54cTAyFTQyu2k6zU78GyvMWhDJF7BIlJ2Ms94r3CRiveA_ewD-2fGbkSHO5H0tTS_pfoo7XAMmfFNBK</string>
Frameworks and Libraries> Add libxml2.tbd file.
If the FBAudienceNetwork.framework file is in the Plugin> iOS> Bidmad folder, be sure to delete it.
Test your ad with test code
iOS 14.0 later, Please add contents below in plist file
<key>NSUserTrackingUsageDescription</key> <string>This identifier will be used to deliver personalized ads to you.</string>
<key>SKAdNetworkItems</key>
<array>
<dict>
<!-- AdMob -->
<key>SKAdNetworkIdentifier</key>
<string>cstr6suwn9.skadnetwork</string>
<!-- IronSource -->
<key>SKAdNetworkIdentifier</key>
<string>SU67R6K2V3.skadnetwork</string>
<!-- AdColony -->
<key>SKAdNetworkIdentifier</key>
<string>4PFYVQ9L8R.skadnetwork</string>
<!-- UnityAds -->
<key>SKAdNetworkIdentifier</key>
<string>4DZT52R2T5.skadnetwork</string>
</dict>
</array>
Example): [banner setTestDevice: @ "b763d82d5e9bed4d0d235b490e6b81e6"];
[interstitial setTestDevice: @ "b763d82d5e9bed4d0d235b490e6b81e6"];
[rewardVideo1 setTestDevice: @ "b763d82d5e9bed4d0d235b490e6b81e6"];
If you first run the app without calling the above function, the following message will appear in the Xcode bottom log window. Get the device ID in testDeviceIdentifiers and set it in each of the above functions (according to banner, front, and reward ads).
To get test ads on this device, set: GADMobileAds.sharedInstance.requestConfiguration.testDeviceIdentifiers = @ [@ "b763d82d5e9bed4d0d235b490e6b81e6"];
If you call AdMob real ads without calling setTestDevice, your account may be blocked, so be sure to call during testing, and delete the above code when the actual app is distributed.
- 해당하는 파일은 ADOP 비드매드(BidMad) SDK 구성을 위한 표준파일로 각 업체의 성격에 따라 일부 변경될 수 있습니다.