google-mapscordovagoogle-maps-api-3

Using domain protected Google Maps key with app:// scheme on iOS


I'm trying to protect a Google Maps key with domain/referrer.

When calling Google Maps JavaScript places API from Android webview, the scheme defaults to https:// and I can protect the key with the domain https://com.domain, it works.

When calling Google Maps JavaScript places API from iOS webview, the scheme defaults to app://. Google maps throws an error that the domain is not allowed, even if I added both app://com.domain and https://com.domain and to domain/referrer list in Google Maps.

Does Google Maps not support app:// scheme for referrers ?


Solution

  • I will answer my own question, it might help someone... It turns out I can specify a wildcard for the scheme and it will work with...

    Use
             *://com.domain/*
    
    instead of
    
             app://com.domain/*