[MOD-2582] Android: "ti.admob" Example needs updating
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Done |
| Resolution Date | 2021-02-02T09:47:31.000+0000 |
| Affected Version/s | Release 9.0.0 |
| Fix Version/s | n/a |
| Components | Admob |
| Labels | 2020-Q3, admob, android, firebase, module |
| Reporter | Samir Mohammed |
| Assignee | Satinder Pal Singh |
| Created | 2020-02-11T11:06:37.000+0000 |
| Updated | 2021-02-03T13:45:37.000+0000 |
Description
When running the example in
ti.admob the application crashes. (No error is shown in console).
*+Test Steps:+*
Download module from (https://jenkins.appcelerator.org/job/modules/job/ti.admob/job/PR-94/7/artifact/ti.admob-android-5.0.1.zip)
Copy the the code from the example
Paste the code into a Titanium application
Run Titanium application
*Expected result* Application should not crash and run without issues. *Actual result* Application crashes.Attachments
| File | Date | Size |
|---|---|---|
| IMG_4626.JPG | 2021-02-02T09:44:31.000+0000 | 2732154 |
I think this issue is happening because the newest AdMob uses Firebase and it wants a
google-services.jsonwhich defines thegoogle_app_id. That is, both a Google App ID and an AdMob App ID are needed. Thegoogle-services.jsoncan be downloaded from the Firebase website once you've configured your app there. Unfortunately, Titanium apps do not currently support agoogle-services.jsonfile yet. The plan is to add support to Titanium 9.0.1. See: [TIMOB-27745] In the meantime, I think the only solution is to add the below to the app project. We need to verify that the below will work. If so, then update module's "example" project and "README.md"../platform/android/res/values/values.xmlI suspect the iOS example project might have the same problem too. We need to double check.<?xml version="1.0" encoding="utf-8"?> <resources> <!-- Replace with App ID found in Firebase Console website under Project Settings. --> <string name="google_app_id" translatable="false">MY_APP_ID</string> </resources>After TIMOB-27745 get resolved, I'm able to run the sample app & load an Interstitial Ad as well. !IMG_4626.JPG|thumbnail! [INFO] ad received [INFO] DynamiteModule: Considering local module com.google.android.gms.ads.dynamite:0 and remote module com.google.android.gms.ads.dynamite:204204100 [INFO] DynamiteModule: Selected remote version of com.google.android.gms.ads.dynamite, version >= 204204100 [WARN] AdEventListener: (main) [0,10313] "ad_received" is deprecated. Use "load" instead. [INFO] Interstitial Ad loaded! [~smohammed], can we close this defect now.