LoginSignup
0
0

More than 5 years have passed since last update.

iOSアプリのAdMobを、6系から7系にアップデートした話

Posted at

久しぶりに、iOS版の詰め共円をアップデートしようとしたら、
いろんなライブラリがoutdatedだったので、ライブラリもアップデートしました。

実際のコードはこちら。 https://github.com/noboru-i/kyouen-ios/commit/d883d6e03a6a5dad1ee6e5edb366ac3c0abe6495

Podfileのアップデート

-pod 'Google-Mobile-Ads-SDK', '~> 6.8'
+pod 'Google-Mobile-Ads-SDK', '~> 7.1'

projectファイルの調整

Build Phasesの、Link Binary With Librariesにあった、libGoogleAdMobAds.aを削除する。

Build Settingsの、Apple LLVM 6.0 - Language - Modulesの、Enable Modules (C and Objective-C)をYESに変更する。

Build Settingsの、Search Pathsの、Library Search Pathsにあった"$(PROJECT_DIR)/Pods/Google-Mobile-Ads-SDK/GoogleMobileAdsSdkiOS-6.11.1"を削除する。

ソースコードの修正

importしていたヘッダファイルを削除し、GoogleMobileAdsモジュールを読み込む。
@import GoogleMobileAds;

GADRequestのtestDevicesに、GAD_SIMULATOR_IDを設定していたのを削除する。
(何も設定しなくても、シミュレータではテスト用配信がされる模様)

感想

全体的に、記述量が減っていい感じだと思う。
今更だと思うけど、@importって初めて見た。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0