NativeScript / NativeScript/plugins

admob and vanilla js for Android

Open
#631 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
206
Forks
123
Avg merge
2d 1h
Merged PRs (30d)
1

Description

I've been trying to add ADMOB to a test app for several days without success. Steps I've taken:

  1. Add "@nativescript/google-mobile-ads": "^5.0.3"

  2. In AndroidManifest.xml (./App_Resources/Android/src/main) add

<application..> ...
<meta-data  
android:name="com.google.android.gms.ads.APPLICATION_ID"   
android:value="ca-app-pub-3940256099942544~3347511713" />
...
</application>
  1. in the app.js add
import { Application } from '@nativescript/core';
import { MobileAds } from '@nativescript/google-mobile-ads';

console.log("🔥 Inicializando Google Mobile Ads...");
MobileAds.init();

Application.run({ moduleName: 'main-page' });

Then "ns run android"

So far, I haven't been able to get it working.

Other data:
ns --version 8.9.2
windows 10 and vscode
Mi repo https://github.com/germandeburzaco/testMonetizarApp

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the setup with ns run android, using app.js, the AndroidManifest.xml path, and the @nativescript/google-mobile-ads package version shown in the issue. Capture the missing build or runtime error and compare the test app configuration with the plugin's documented Android setup. Done means the test app initializes MobileAds successfully and displays the expected AdMob behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript, typescript
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.