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

Feature Request: Clarify Expo Support #48

Closed
brookemitchell opened this issue May 3, 2021 · 8 comments
Closed

Feature Request: Clarify Expo Support #48

brookemitchell opened this issue May 3, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@brookemitchell
Copy link

Our company currently uses the Expo managed workflow, it looks as though dd-sdk-react-native requires access to react-native 'Native Modules' which is fair enough 😆 I'm expecting the sdk requires me to eject to the Expo 'bare' workflow.

In the Expo managed workflow I get this error when trying to initialise.

[Unhandled promise rejection: TypeError: null is not an object (evaluating '_foundation.DdSdk.initialize')]
at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:516237:27 in <unknown>
at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:516229:26 in initialize
at http://127.0.0.1:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&minify=false:515922:53 in <unknown>
at [native code]:null in callFunctionReturnFlushedQueue

It would be useful to us if in the docs you stated whether the 'Expo Managed Workflow' is supported.

It seems reasonable if it's not. Later in the year Expo is planning to add native module support with EAS build https://blog.expo.io/expo-managed-workflow-in-2021-d1c9b68aa10

Describe the solution you'd like
An update to the docs stating expo support. Or an option to use dd-sdk with the Expo Managed workflow

Describe alternatives you've considered
Eject expo, or wait for runtime customisation in expo to give native module support

@brookemitchell brookemitchell added the enhancement New feature or request label May 3, 2021
@chunkzer
Copy link

chunkzer commented May 3, 2021

For what is worth @brookemitchell I also ran into this issue and continue to receive the same error when running the app on an ejected workflow or even on a "vanilla" react-native application.

I'm still waiting to hear back from DD live support to figure out how to initialize the SDK for a react-native application of any stripe.

@0xnm
Copy link
Member

0xnm commented May 4, 2021

Hello @brookemitchell and @chunkzer! Thanks for submitting the issue. We didn't look yet at the Expo compatibility, but will definitely check it out.

@chunkzer Can you please give us more details regarding you issue with "vanilla" application. Do you mean the app which is made without Expo (pure React Native app)? If so, can you please share what Datadog React Native SDK version you are using, does it happen only for iOS, or for Android as well? If it is iOS app, then does it have pure Objective-C codebase (no Swift files included) or not, what is the version of XCode, etc.

@lassmann
Copy link

lassmann commented May 4, 2021

Same issue here...

@chunkzer
Copy link

chunkzer commented May 4, 2021

Hello @0xnm

An update on my current status with this. I've managed to get the library running as part of an expo bare-workflow (that would be with access to the iOS side of the project with Xcode, etc...) as well as with a vanilla react-native app.
At least to the point where I'm running the dd-sdk initialization function with no error being returned. (I'm still getting 0 visible activity in DD)

Here's my step by step process to get to this point (Relevant point is that this is react-native 0.63):

  • Follow the initial new RUM application flow (snippet + install sdk)
  • Modify your Podfile in the "Flipper" block
  if !ENV['CI']
    use_flipper!('Flipper' => '0.75.1', 'Flipper-Folly' => '2.5.3', 'Flipper-RSocket' => '~> 1.3')
    post_install do |installer|
      flipper_post_install(installer)
    end
  end

Relevant issues:
facebook/react-native#31179 (comment)

Run pod install

Now you’ll need to follow the instructions detailed on: (I realized the issue is pinned but is there a way for it to have more visibility until fixed?)

#41

At this point I'm able to build my application and execute a block like this one:

const config = new DdSdkReactNativeConfiguration(
   ...creds,
    true, // track User interactions (e.g.: Tap on buttons)
    true, // track XHR Resources
    true // track Errors
)

DdSdkReactNative.initialize(config).then((conf) => {
  console.log('initialize then promise', conf);
  DdLogs.warn('The RN Sdk was properly initialized', {
      foo: 42,
      bar: 'xyz',
  }).then((r) => {
    console.log('after info log: ', r);
  })

  DdSdkReactNative.setUser({id: "1337", name: "Xavier", email: "xg@example.com", type: "premium"})

  DdSdkReactNative.setAttributes({campaign: "react-native-bs"})
})

Still I'm not seeing any activity on the relevant dashboard.

@astriskit
Copy link

astriskit commented Jan 24, 2022

Hi @brookemitchell;

This is a relevant issue. Wondering, why was this closed without much conclusion - any redirection or follow-ups?! Especially with relevance to the expo-managed workflow?!

Thanks.

Update - found that there are open threads here -

@brookemitchell
Copy link
Author

@astriskit sorry way later, indeed this is working excellently for us with an expo eas build, see: #47 (comment)

@priyanshi-gupta
Copy link
Contributor

Hey folks, I'm the PM for RUM at Datadog, thank you for the feature request. We're investigating integration with Expo managed workflow and we would love to get insights on your experience. If you're open to a quick chat, please reach out support@datadoghq.com and mention this issue.

@priyanshi-gupta
Copy link
Contributor

Hi all,
We now support Expo managed workflow, you can learn about how to enable our SDK with Expo here: https://github.com/DataDog/dd-sdk-reactnative/blob/develop/docs/expo_development.md
If you are using Expo Go, you'll find instructions on how to move to development builds or to prevent your app from crashing with the SDK while using Expo Go.

For now, there is no need to add plugins ;)
cc @louiszawadzki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants