Skip to content

Commit

Permalink
feat(): update readme for example
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlabo committed Oct 10, 2023
1 parent be9fe35 commit b784e1a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ Don't forget to replace `[APP_ID]` by your AdMob application Id.
import { AdMob } from '@capacitor-community/admob';

export async function initialize(): Promise<void> {
const { status } = await AdMob.trackingAuthorizationStatus();
const [consentInfo, trackingInfo] = await Promise.all([AdMob.requestConsentInfo(), AdMob.trackingAuthorizationStatus()]);

if (status === 'notDetermined') {
if (consentInfo.status === AdmobConsentStatus.REQUIRED && trackingInfo.status === 'notDetermined') {
/**
* If you want to explain TrackingAuthorization before showing the iOS dialog,
* you can show the modal here.
Expand All @@ -131,12 +131,13 @@ export async function initialize(): Promise<void> {
* await modal.present();
* await modal.onDidDismiss(); // Wait for close modal
**/

if (consentInfo.isConsentFormAvailable) {
await AdMob.showConsentForm();
} else {
await AdMob.requestTrackingAuthorization();
}
}

AdMob.initialize({
testingDevices: ['2077ef9a63d2b398840261c8221a0c9b'],
initializeForTesting: true,
});
}
```

Expand Down Expand Up @@ -900,7 +901,7 @@ When notice listener of OnAdLoaded, you can get banner size.

#### AdMobError

For more information
For more information
https://developers.google.com/android/reference/com/google/android/gms/ads/AdError

| Prop | Type | Description |
Expand Down Expand Up @@ -952,7 +953,7 @@ https://developers.google.com/android/reference/com/google/android/gms/ads/AdErr

#### AdMobRewardItem

For more information
For more information
https://developers.google.com/admob/android/rewarded-video-adapters?hl=en

| Prop | Type | Description |
Expand All @@ -973,7 +974,9 @@ https://developers.google.com/admob/android/rewarded-video-adapters?hl=en

From T, pick a set of properties whose keys are in the union K

<code>{ [P in K]: T[P]; }</code>
<code>{
[P in K]: T[P];
}</code>


### Enums
Expand Down
2 changes: 1 addition & 1 deletion src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface AdMobPlugin extends AdMobDefinitions {
* @param options AdMobInitializationOptions
* @since 1.1.2
*/
initialize(options: AdMobInitializationOptions): Promise<void>;
initialize(options?: AdMobInitializationOptions): Promise<void>;

/**
* Confirm requestTrackingAuthorization status (iOS >14)
Expand Down

0 comments on commit b784e1a

Please sign in to comment.