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

[Question] Hybrid app setup #467

Closed
2 of 5 tasks
esam091 opened this issue Aug 21, 2018 · 3 comments
Closed
2 of 5 tasks

[Question] Hybrid app setup #467

esam091 opened this issue Aug 21, 2018 · 3 comments

Comments

@esam091
Copy link

esam091 commented Aug 21, 2018

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

After reading the source code, it seems that when you call the install method from js side, Sentry sets up a client to the native side. This makes sense for most React Native apps that makes setting up Sentry very easy.

My condition however is different since our app is a hybrid one. The js setup code won't be called unless you open up a view controller containing react codes, so we have to do setup in [AppDelegate application:didFinishLaunchingWithOptions:]. We also still need to do setup from js side to make sure React Native's crash tracking work properly.

The problem with this approach is once you do the setup from js side, the native setup(tags, users) will be removed and we need to do the same setup from js side. Is there any workaround in this? I can only think of modifying the code below to not recreate client when it already exists.

https://github.com/getsentry/react-native-sentry/blob/8b08b9c6e603ab1b9fd9eae9a50ae0ba5add95a6/ios/RNSentry.m#L134

@HazAT
Copy link
Member

HazAT commented Aug 27, 2018

Right now this would be the only solution I guess.
We will soon rewrite the SDK and I will think of a way to make this work.

@esam091
Copy link
Author

esam091 commented Sep 3, 2018

Do you mind if I create a PR or is it better to just do this in my own fork?

@HazAT
Copy link
Member

HazAT commented Sep 6, 2018

@esam091 A PR cannot harm since I am curious what the actual solution look like, thanks.
But just upfront, it could be that we don't merge it, since, like I said before, we will probably rewrite the SDK so this is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants