我的index.html中有我的webapp和cordova app:
代码可以完美地加载google api,在我的webapp中,以及用于ios和android应用程序的cordova。
对于webapp,我加载了要授权的各种url:
http://wevote.us/*
https://wevote.us/*
http://localhost:3000/*
https://localhost:3000/*
所有这些对webapp来说都是完美的。
然后我在Android(科尔多瓦)中运行相同的代码。控制台错误说要添加“
文件URL
//android_asset/www/index.html/ballot“在google云控制台上,我做到了,5分钟后,我的混合android应用程序工作得很好。
__file_url__//android_asset/www/index.html#/ballot
但是对于ios,类似的控制台错误显示
2018-05-23 13:59:22.344204-0700 WeVoteCordova[52841:2772856] ERROR: Google Maps JavaScript API error: RefererNotAllowedMapError https://developers.google.com/maps/documentation/javascript/error-messages#referer-not-allowed-map-error Your site URL to be authorized: __file_url__//Users/stevepodell/Library/Developer/CoreSimulator/Devices/D476226046...99AEE3DC/data/Containers/Bundle/Application/7A844..10D/WeVoteCordova.app/www/index.html#/ballot
显然,任何包含在我的Mac上的路径的URL都不起作用,但是作为实验,我只是添加了建议的URL(知道它只对一个构建工作,在一个模拟器上),并且谷歌云服务器API密钥页在保存时崩溃,并且没有保留数据。
有人把这个应用到iOS上了吗?
有个google错误
https://issuetracker.google.com/issues/35828931
但它是关闭的,看起来好像没有被看到。
2018年5月24日更新:
现在有一个打开的google错误
https://issuetracker.google.com/issues/80230742