Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
rdlabo committed Oct 11, 2023
1 parent eaba3fc commit 1896034
Showing 1 changed file with 29 additions and 22 deletions.
51 changes: 29 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,25 +118,30 @@ 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 [consentInfo, trackingInfo] = await Promise.all([AdMob.requestConsentInfo(), AdMob.trackingAuthorizationStatus()]);

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.
* ex)
* const modal = await this.modalCtrl.create({
* component: RequestTrackingPage,
* });
* await modal.present();
* await modal.onDidDismiss(); // Wait for close modal
**/

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

const [trackingInfo, consentInfo] = await Promise.all([
AdMob.trackingAuthorizationStatus(),
AdMob.requestConsentInfo(),
]);

if (trackingInfo.status === 'notDetermined') {
/**
* If you want to explain TrackingAuthorization before showing the iOS dialog,
* you can show the modal here.
* ex)
* const modal = await this.modalCtrl.create({
* component: RequestTrackingPage,
* });
* await modal.present();
* await modal.onDidDismiss(); // Wait for close modal
**/

await AdMob.requestTrackingAuthorization();
}

if (consentInfo.isConsentFormAvailable && consentInfo.status === AdmobConsentStatus.REQUIRED) {
await AdMob.showConsentForm();
}
}
```
Expand Down Expand Up @@ -901,7 +906,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 @@ -953,7 +958,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 @@ -974,7 +979,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

0 comments on commit 1896034

Please sign in to comment.