Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Getting error while integrating this package. #26

Open
vivekshah-zymr opened this issue May 27, 2020 · 4 comments
Open

Getting error while integrating this package. #26

vivekshah-zymr opened this issue May 27, 2020 · 4 comments

Comments

@vivekshah-zymr
Copy link

vivekshah-zymr commented May 27, 2020

Hello, I want to integrate this package to leverage the proximity feature of the device.
I am checking this on iPhone 6s with 13.3.1, I haven't tried this on android.
Here's my
package.json

"dependencies": {
    "@grit96/react-native-proximity": "^3.0.1",
    "react": "16.11.0",
    "react-native": "0.62.2"
  },

Que-1: Should I use npm react-native-proximity or @grit96/react-native-proximity?

Now after installing I have properly linked this package by react-native link @grit96/react-native-proximity (Got the relevant message for the same on a console.)

App.js


import Proximity from '@grit96/react-native-proximity';

export default class App extends Component {
  componentDidMount() {
     Proximity.addListener(this._proximityListener);
  }
  _proximityListener(data) {
    console.log('In _proximityListener===', data);
  }
  componentWillUnmount() {
     Proximity.removeListener(this._proximityListener);
  }
Other stuff...

This gives me an error on console like,
TypeError: null is not an object (evaluating '_reactNative.NativeModules.RNProximity.proximityEnabled')

I thought it might be due to linking, so I have tried to link this library manually by adding RNProximity.xcodeproj under the Libraries folder in XCode. And added libRNProximity.a under BuildPhase >Link Binary With Libraries, but that gives me an error like 'React/RCTBridge.h' file not found in RNProximity.m file

One more thing, my pod file get updated with this,
pod 'react-native-proximity', :path => '../node_modules/@grit96/react-native-proximity'
But when I try to do pod install, it gives me an error like no .podspec file found at the location '../node_modules/@grit96/react-native-proximity'`. (Even if It's there.)

Can anyone please help me where I am going wrong?
@williambout

@vivekshah-zymr vivekshah-zymr changed the title Not able to integrate this npm properly. Getting error while integrating this package. May 27, 2020
@geraintwhite
Copy link

@grit96/react-native-proximity is my fork of the project that includes #13 and #20 to make the module work properly.

@vivekshah-zymr
Copy link
Author

Ok @grit96 . Do you have any idea why I am getting the above errors?

@geraintwhite
Copy link

I use the module with react-native 0.59.x but there are some other pull requests relating to 0.60+ support which you might need to implement.

@baselbj
Copy link

baselbj commented Sep 23, 2020

@grit96/react-native-proximity

I am using your fork but still facing the sam issue

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

No branches or pull requests

3 participants