"Experience needs permissions" popup using detox

I’m using detox and detox-expo-helpers to test my application. I used create-react-native-app as a base. Here is the output of exp diagnostics

  OS: macOS High Sierra 10.13.5
  Node: 8.11.1
  Yarn: 0.19.1
  npm: 5.6.0
  Watchman: 4.7.0
  Xcode: Xcode 9.4.1 Build version 9F2000
  Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
  expo: ^28.0.0 => 28.0.0
  react: 16.3.1 => 16.3.1
  react-native: https://github.com/expo/react-native/archive/sdk-28.0.0.tar.gz => 0.55.4

In my application I ask for location permission after logging into the application. In my detox tests I set the permissions when launch the application like so:

before(async () => {
    await reloadApp({
      permissions: {
        location: "always"

But after my tests get to the point where I ask for location permission, I get a pop saying “Experience needs permissions”.

The expected result is that since I have already granted permissions, I would not need to grant them again within the application, thus I should not see this additional popup.

Hey @runandrew – thanks for letting us know. Is this happening in the Expo client app, or are you seeing this popup in a standalone app?

I’d be interested to know if you are able to reproduce this without detox. I’m not familiar with the inner workings of detox, but I would expect only expect this to happen if the id field in app.json changes between runs of the app. It’s possible that detox does this behind the scenes, but I’m not sure.

Thanks for the reply! I am using the Expo Client App (2.6.7).

I tried looking for an id field in the app.json, but I couldnt’t find it. Could you point me in the right direction for that? I tried searching in https://docs.expo.io/versions/v28.0.0/workflow/configuration.

Hey @esamelson, just following up. From my reply on Jul 19, thanks!

Hi @runandrew - sorry, I think I might have misunderstood before. Is your detox testing app a different experience (e.g. has a different app.json and a different value for slug) than your actual app? If so, this is actually expected behavior – on the Expo client you must grant permission explicitly for each separate experience (determined by your username and the app’s slug).

If you are continually seeing this popup each time you run the detox testing experience (rather than just the first time you run it), my suspicion is that detox is modifying the “slug” value behind the scenes.

Great information, I’ll dig into their docs and source code to see what’s going on. It helps to know what invokes that message.

Thanks for the help!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.