Admob,FIrebaseに登録したあとの設定の仕方、アイフォンアプリ開発
単にライブラリやAPIをプロジェクトにドラッグする方法もあるらしいけど、pod installを使ったやり方
swift3.0 2017/09/14
XCODEの場合
OSXのシェルから該当のプロジェクトのディレクトリに移動して、
pod init
すると
PodFileができるので、それをテキストエディタで開いて
「pod ‘Firebase/Core’
source ‘https://github.com/CocoaPods/Specs.git’
pod ‘Firebase/Core’
pod ‘Firebase/AdMob’
」
以下は例です
# Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target 'HiyokoTwo' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! # Pods for HiyokoTwo pod 'Firebase/Core' source 'https://github.com/CocoaPods/Specs.git' pod 'Firebase/Core' pod 'Firebase/AdMob' target 'HiyokoTwoTests' do inherit! :search_paths # Pods for testing end target 'HiyokoTwoUITests' do inherit! :search_paths # Pods for testing end end
を書いて保存して
またシェルから
pod installとすると
別のプロジェクトファイルが作成されるので、その新しくできたプロジェクトファイルを使用します。
そして、所定の箇所にコードを記入するすれば
(場所とかはあとで)
広告が表示されます。
でもプロジェクトを実行すると色々とエラーや警告が表示されます。