LoginSignup
5
4

More than 5 years have passed since last update.

MonacaでgoogleMap設定 (iOSビルド版)

Posted at

問題

Monacamobile backendでアプリ開発中、地図を表示するためにGoogle MapのAPIを利用していますが、DebugアプリやAndroidでは問題なく表示していますが、なぜかiOSでビルドすると上手く表示しません。

原因

原因は設定ではgoogle mapのドメインが許可されていないことです。
monacaが採用したPhoneGap/Cordova の仕様により、セキュリティを守るため、外のドメインアクセスはホワイトリスト登録必要があります。

解決

  • 登録方法:

Monaca開発環境でのios/MonacaApp-Info.plistファイルを開き、以下追加
※一番上にあるの直後に追加することをお勧めします。

<key>ExternalHosts</key>           
<string>*.googleapis.com</string>

参考

Phonegapの仕様について
http://docs.phonegap.com/en/1.9.0/guide_whitelist_index.md.html

monacaでのiOS設定について
http://docs.monaca.mobi/cur/ja/reference/config/ios_configuration/

5
4
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
5
4