roam-ai / roam-reactnative

React Native Location SDK. High accuracy and battery efficient location SDK for iOS and Android by Roam.ai
https://roam.ai
MIT License
28 stars 6 forks source link

NativeModules.RNRoam is undefined #19

Open cNille opened 2 years ago

cNille commented 2 years ago

Hi! 👋

We're eager to try out roam for our app. We followed the instructions for installing with autolinking. Importing roam-reactnative' works fine, but as soon as we try to use call a method onRoam we get:NativeModules.RNRoam is undefined`. We've tried both on simulator and device.

One theory could be that we had the bundle-id for production, but when we run debug we have another bundle-id. Couldn't get it to work anyway though.

We are using:

React-native: 0.66.3
React: 17.0.2
iOS device & simulator
2022-06-21 11:38:05.167630+0200 Vembla[43965:3377170] [javascript] 'Error: Requiring module "../hooks/useRoam.ts", which threw an exception: Error: NativeModules.RNRoam is undefined',
jothipriyadharshanr commented 2 years ago

Hi! 👋

We're eager to try out roam for our app. We followed the instructions for installing with autolinking. Importing roam-reactnative' works fine, but as soon as we try to use call a method onRoamwe get:NativeModules.RNRoam is undefined`. We've tried both on simulator and device.

One theory could be that we had the bundle-id for production, but when we run debug we have another bundle-id. Couldn't get it to work anyway though.

We are using:

React-native: 0.66.3
React: 17.0.2
iOS device & simulator
2022-06-21 11:38:05.167630+0200 Vembla[43965:3377170] [javascript] 'Error: Requiring module "../hooks/useRoam.ts", which threw an exception: Error: NativeModules.RNRoam is undefined',

Hey @cNille ,

It seems like the auto linking did not work. Can you try the manual linking as per the steps below.

Manual Linking

Let us know if that solved the issue.

Thanks.

cNille commented 2 years ago

Hi @jothipriyadharshanr ,

Thanks for the quick reply! The steps you described worked, thanks! 🙏

Though we now would need a script to do this manually on installation as our ios-folder is gitignored as it's auto generated by react-native. Will this be fixed with upcoming release?

jothipriyadharshanr commented 2 years ago

Hi @jothipriyadharshanr ,

Thanks for the quick reply! The steps you described worked, thanks! 🙏

Though we now would need a script to do this manually on installation as our ios-folder is gitignored as it's auto generated by react-native. Will this be fixed with upcoming release?

Our team is looking into this behaviour and this will be addressed in the upcoming release. We will keep this issue open and update link this to our respective release.

manasgond commented 2 years ago

Hey @cNille ,

It seems like the auto linking did not work. Can you try the manual linking as per the steps below.

Manual Linking

  • Open the iOS module files, located inside node_modules/roam-reactnative/ios/.
  • Open the app workspace file (AppName.xcworkspace) in Xcode.
  • Move the RNRoam.h and RNRoam.m files to your project. When shown a popup window, select Create groups.

Let us know if that solved the issue.

Thanks.

The same issue is coming on android. Can you please reply ASAP. Stuck