Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zoontek committed Sep 27, 2022
1 parent 0ff933c commit 494bcdb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -981,14 +981,16 @@ Since iOS 15.0, it's impossible to request this this permission if the app isn't

```js
useEffect(() => {
const listener = AppState.addEventListener('change', (status) => {
if (Platform.OS === 'ios' && status === 'active') {
const callback = (status: AppStateStatus) => {
if (status === "active") {
request(PERMISSIONS.IOS.APP_TRACKING_TRANSPARENCY)
.then((result) => console.log(result))
.catch((error) => console.log(error));
}
});
};

callback(AppState.currentState); // initial call
const listener = AppState.addEventListener("change", callback);
return listener.remove;
}, []);
```
Expand Down

0 comments on commit 494bcdb

Please sign in to comment.