Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tracking-transparency][ios] Fix requestTrackingPermissionsAsync being resolved before user makes a choice #28751

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

behenate
Copy link
Member

Why

On iOS 17.4 requestTrackingPermissionsAsync will resolve instantly (even before the modal is shown) with status denied due to a known bug (in our case it was undetermined due to implementation differences).

How

Used a workaround which detects if the bug has appeared. In that case promise is stored until the app returns to foreground - that's when user has made a choice in the modal. After the app has returned to foreground we can call requestPermissions again to get the correct result.

Test Plan

Tested in iOS 17.4 simulator in BareExpo

@expo-bot
Copy link
Collaborator

Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines.

I've found some issues in your pull request that should be addressed (click on them for more details) 👇

⚠️ Suggestion: Missing links in changelog entries


I've added some suggestions below, you can just apply and commit them 😉


Generated by ExpoBot 🤖 against 36bfbaf

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label May 10, 2024
@@ -8,6 +8,8 @@

### 🐛 Bug fixes

- Fix `requestTrackingPermissionsAsync` being resolved instantly due to iOS 17.4 bug
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Fix `requestTrackingPermissionsAsync` being resolved instantly due to iOS 17.4 bug
- Fix `requestTrackingPermissionsAsync` being resolved instantly due to iOS 17.4 bug ([#28751](https://github.com/expo/expo/pull/28751) by [@behenate](https://github.com/behenate))

@expo-bot
Copy link
Collaborator

The Pull Request introduced fingerprint changes against the base commit: 060e01d

Fingerprint diff
[
  {
    "type": "dir",
    "filePath": "../../packages/expo-tracking-transparency/ios",
    "reasons": [
      "expoAutolinkingIos"
    ],
    "hash": "177aa100d9fd18cdf3c29b31dbd0bd94cb2b33e6"
  }
]

Generated by PR labeler 🤖

@behenate behenate marked this pull request as ready for review May 13, 2024 08:13
@behenate behenate requested a review from tsapeta as a code owner May 13, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants