Skip to content

Commit b63f2af

Browse files
committed
docs: improve att advice when using expo
1 parent 6a688d6 commit b63f2af

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

docs/index.mdx

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,10 @@ Within your projects configuration file, you have to provide a user tracking usa
401401

402402
#### Requesting App Tracking Transparency authorization
403403

404-
To request the App Tracking Transparency authorization we recommend using the [react-native-permissions](https://github.com/zoontek/react-native-permissions) library or making it part of the UMP consent flow [European User Consent page](/european-user-consent).
404+
To request the App Tracking Transparency authorization we recommend using a library or making it part of the UMP consent flow [European User Consent page](/european-user-consent).
405+
406+
<Tabs groupId="framework" values={[{label: 'React Native', value: 'bare'}, {label: 'Expo', value: 'expo'}]}>
407+
<TabItem value="bare">
405408

406409
```js
407410
import { check, request, PERMISSIONS, RESULTS } from 'react-native-permissions';
@@ -417,6 +420,29 @@ const adapterStatuses = await mobileAds().initialize();
417420
// Now ads can be loaded.
418421
```
419422

423+
</TabItem>
424+
<TabItem value="expo">
425+
426+
```js
427+
import {
428+
getTrackingPermissionsAsync,
429+
PermissionStatus,
430+
requestTrackingPermissionsAsync,
431+
} from 'expo-tracking-transparency';
432+
433+
const { status } = await getTrackingPermissionsAsync();
434+
if (status === PermissionStatus.UNDETERMINED) {
435+
await requestTrackingPermissionsAsync();
436+
}
437+
438+
const adapterStatuses = await mobileAds().initialize();
439+
440+
// Now ads can be loaded.
441+
```
442+
443+
</TabItem>
444+
</Tabs>
445+
420446
### European User Consent
421447

422448
Out of the box, AdMob does not handle any related regulations which you may need to enforce on your application.

0 commit comments

Comments
 (0)