「Monaca/admob/admob-free」の版間の差分
ナビゲーションに移動
検索に移動
編集の要約なし |
|||
| 31行目: | 31行目: | ||
== | ==Security Policyエラーが発生== | ||
Refused to load the script 'https://debug.monaca.mobi/target/target-script-min.js' because it violates the following Content Security Policy directive: "default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'default-src' is used as a fallback. | Refused to load the script 'https://debug.monaca.mobi/target/target-script-min.js' because it violates the following Content Security Policy directive: "default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'default-src' is used as a fallback. | ||
==json404のエラーが発生== | |||
{"status": "fail", "code": 404," message": "Not found"} | |||
==参考== | ==参考== | ||
https://itkdev.hatenablog.com/entry/2018/08/14/145552 | https://itkdev.hatenablog.com/entry/2018/08/14/145552 | ||
2020年5月19日 (火) 09:53時点における版
ダウンロード&インストール
https://github.com/ratson/cordova-plugin-admob-free
どちらか行う
- githubでforkしてmonacaへインポート
- zipでDLしてmonacaへインポート
- インポートするとアップデートするボタンが出るので押す。
- www/admob.jsができてるので確認
- www/index.htmlなどがざっくりなくなるのでexamples/basic/からwwwをコピーしてプロジェクト直下にペーストする
確認
package.jsonに以下が記載されてることを確認
"cordova": {
"id": "cordova-plugin-admob-free",
"platforms": [
"android",
"ios"
]
},
失敗したら・・
ターミナルから
npm install npm run build
Security Policyエラーが発生
Refused to load the script 'https://debug.monaca.mobi/target/target-script-min.js' because it violates the following Content Security Policy directive: "default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'default-src' is used as a fallback.
json404のエラーが発生
{"status": "fail", "code": 404," message": "Not found"}