Skip to content

Commit

Permalink
docs: improve att advice when using expo
Browse files Browse the repository at this point in the history
  • Loading branch information
dylancom committed Dec 12, 2024
1 parent 6a688d6 commit b63f2af
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,10 @@ Within your projects configuration file, you have to provide a user tracking usa

#### Requesting App Tracking Transparency authorization

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).
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).

<Tabs groupId="framework" values={[{label: 'React Native', value: 'bare'}, {label: 'Expo', value: 'expo'}]}>
<TabItem value="bare">

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

</TabItem>
<TabItem value="expo">

```js
import {
getTrackingPermissionsAsync,
PermissionStatus,
requestTrackingPermissionsAsync,
} from 'expo-tracking-transparency';

const { status } = await getTrackingPermissionsAsync();
if (status === PermissionStatus.UNDETERMINED) {
await requestTrackingPermissionsAsync();
}

const adapterStatuses = await mobileAds().initialize();

// Now ads can be loaded.
```

</TabItem>
</Tabs>

### European User Consent

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

0 comments on commit b63f2af

Please sign in to comment.