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

Getting error while integrating this package. #26

@vivekshah-zymr

Description

@vivekshah-zymr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions