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

How to setup the library when using Wix react-native-navigation? #90

Closed
predescu opened this issue May 2, 2024 · 3 comments · Fixed by #110
Closed

How to setup the library when using Wix react-native-navigation? #90

predescu opened this issue May 2, 2024 · 3 comments · Fixed by #110

Comments

@predescu
Copy link

predescu commented May 2, 2024

Describe the bug
I'm struggling to set up the library on my React Native App. I'm using Wix react-native-navigation, and it looks like there is a type mismatch.
It would be great if we have an example for this scenario.

In this case, the MainActivity extends NavigationActivity instead of ReactActivity

Screenshots
Screenshot 2024-05-02 at 14 46 32

Environment:

  • Health Connect Version: 2.0.1
  • React Native Version: 0.73.5
  • New architecture enabled: No
@predescu predescu changed the title Code example setting when How to setup the library when using Wix react-native-navigation? May 2, 2024
@matinzd
Copy link
Owner

matinzd commented May 3, 2024

Hey!

Thanks for noticing this. Can you please share a minimal reproducible so I can work on it? Thanks :)

@predescu
Copy link
Author

predescu commented May 4, 2024

Hey @matinzd
I've put together a minimal reproducible code (react-native + react-native-navigation + react-native-health-connect).
You can find it at this location:
https://github.com/predescu/rnn-health-connect

I've commented out the updates on the android/app/src/main/java/com/rnnhealthconnect/MainActivity.kt file so the app can start.

On the screen, there si a button to request the permissions. When you press the button, the app will crash because the HealthConnectPermissionDelegate.setPermissionDelegate(this) code line is missing from the MainActivity.kt

@matinzd matinzd self-assigned this May 6, 2024
@cribcutkiran
Copy link

cribcutkiran commented May 29, 2024

I've run into the same issue. RNN's NavigationActivity extends AppCompatActivity rather than ReactActivity. Anything that extends from ComponentActivity will have registerForActivityResult(), so could setPermissionDelegate() just accept a ComponentActivity?

matinzd added a commit that referenced this issue Jun 29, 2024
@matinzd matinzd linked a pull request Jun 29, 2024 that will close this issue
matinzd added a commit that referenced this issue Jun 30, 2024
* fix: update docs for the new expo adapter

* fix(#90): maximize lib compatibility

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

Successfully merging a pull request may close this issue.

3 participants