achorein / expo-share-intent

🚀 Simple share intent in an Expo Native Module
MIT License
119 stars 10 forks source link

No data in share intent when eas-updates is enabled (iOS) #46

Closed felixaa closed 2 months ago

felixaa commented 3 months ago

Describe the bug When eas updates is enabled the share intent returns null on production configuration builds on iOS. Setting eas-updates enabled to false. Everything works fine

I've set up expo-share-intent to handle sharing files from the Files app, and images from the Photos app

updates: {
    enabled: true,
    url: 'https://u.expo.dev/update-key....'
}

To Reproduce

Environment

System:
  OS: macOS 14.4
  CPU: (12) arm64 Apple M3 Pro
  Memory: 117.64 MB / 36.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.11.0
    path: ~/.nvm/versions/node/v20.11.0/bin/node
  Yarn:
    version: 1.22.21
    path: ~/.nvm/versions/node/v20.11.0/bin/yarn
  npm:
    version: 10.2.4
    path: ~/.nvm/versions/node/v20.11.0/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10811636
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.9
    path: /opt/homebrew/opt/openjdk@17/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.5
    wanted: 0.73.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Additional context

        [
            'expo-share-intent',
            {
                iosActivationRules: {
                    NSExtensionActivationSupportsImageWithMaxCount: 1,
                    NSExtensionActivationSupportsFileWithMaxCount: 1,
                }
            },
        ],
achorein commented 3 months ago

Thank you for your feedback. I was able to reproduce the issue on the basic example using yarn ios --configuration release 🔥

On app launch we got some expoUpdate error :

[ExpoShareIntentExample] 🟡 {"timestamp":1712601269000,"message":"EXUpdates: Could not emit event: name = Expo.nativeUpdatesStateChangeEvent,
type = check. Event will be emitted when the bridge is available","code":"JSRuntimeError","level":"warn"}
[ExpoShareIntentExample] 🟠 {"level":"error","timestamp":1712601269000,"stacktrace":["ExpoShareIntentExample              0x000000010bfa678b
$s9EXUpdates14FileDownloaderC12downloadData33_75774A0A231786B0DCB0D3DA50F03832LL11withRequest12successBlock05errorP0y10Foundation10URLRequestV_yAI0E0VSg_So13NSURLResponseCtcys5Error_pctFyAN_APSgsAQ_pSgtYbcfU_
+ 875","ExpoShareIntentExample              0x000000010bfa8297
$s9EXUpdates14FileDownloaderC12downloadData33_75774A0A231786B0DCB0D3DA50F03832LL11withRequest12successBlock05errorP0y10Foundation10URLRequestV_yAI0E0VSg_So13NSURLResponseCtcys5Error_pctFyAN_APSgsAQ_pSgtYbcfU_TATm
+ 39","ExpoShareIntentExample              0x000000010bfa6916
$s10Foundation4DataVSgSo13NSURLResponseCSgs5Error_pSgIeghggg_So6NSDataCSgAGSo7NSErrorCSgIeyBhyyy_TR + 182","CFNetwork
0x00007ff8047b74d2 CFNetwork + 38098","CFNetwork                           0x00007ff8047d50b5 _CFHTTPMessageSetResponseProxyURL +
16955","libdispatch.dylib                   0x00007ff8001783ec _dispatch_cal<…>
[ExpoShareIntentExample] 🟠 {"stacktrace":["ExpoShareIntentExample              0x000000010bfc1a2f
$s9EXUpdates16StartupProcedureC13appLoaderTask_35didFinishBackgroundUpdateWithStatus6update5erroryAA03AppeF0C_AA0ijL0OAA0J0CSgs5Error_pSgtFTf4dnnnn_n
+ 1551","ExpoShareIntentExample              0x000000010bfbf528
$s9EXUpdates16StartupProcedureC13appLoaderTask_35didFinishBackgroundUpdateWithStatus6update5erroryAA03AppeF0C_AA0ijL0OAA0J0CSgs5Error_pSgtFTo +
88","ExpoShareIntentExample              0x000000010bf779ca
$s9EXUpdates13AppLoaderTaskC25didFinishBackgroundUpdate019_3339434A583F8B1F65J12D05F1E075305LL10withStatus6update5erroryAA0ghQ0O_AA0H0CSgs5Error_pSgtFytSgAA0bcD8Delegate_pXEfU_yyYbcfU_
+ 74","ExpoShareIntentExample              0x000000010bf63319 $sIegh_IeyBh_TR + 25","libdispatch.dylib                   0x00007ff8001783ec
_dispatch_call_block_and_release + 12","libdispatch.dylib                   0x00007ff8001796d8 _dispatch_client_callout + 8","libdispatch.dylib
0x00007ff80018127d _dispatch_lane_<…>

Will get a closer look on this.

achorein commented 3 months ago

It's seems that the problem comes from a missing expo config value at runtime : Constants.expoConfig?.scheme is empty ...

so we need to give it manually :

    useShareIntent({
      scheme: "exposhareintentexample", // needed only when using expo-updates
    });

PR is coming for next release

achorein commented 2 months ago

fixed in v1.4.0