Skip to content

rm3rdmodules/react-native-idfa

 
 

Repository files navigation

react-native-idfa

I have fixed main problem that IDFAPackage is not abstract and does not override abstract method createJSModules() in ReactPackage.

If you got a problem from original repository. You can use this.

This module supports both platforms android(gaid) and ios(idfa).

How to install

npm install https://github.com/rm3rdmodules/react-native-idfa.git --save
react-native link

Since this library is using the advertising identifier, you must remember to add AdSupport in your IOS project.

Add AdSupport.framework under "Link Binary With Libraries".

How to use!

import { IDFA } from '@rm3rdmodules/react-native-idfa';

class Basic extends Component {
  state = {
     IDFA: '',
  };

  componentDidMount() {
    IDFA.getIDFA().then((idfa) => {
      this.setState({ IDFA: idfa, });
    })
    .catch((e) => {
      console.error(e);
    });
  }

  render() {
    return (
      <View style={{ flex: 1 }}>
        <Text>Your IDFA is : {this.state.IDFA}</Text>
      </View>
    );
  }
}

How to run example

git clone [email protected]:rm3rdmodules/react-native-idfa.git
cd react-native-idfa/examples/Basic
npm install
npm run start

Open simulators and see your IDFA

About

React native module to get IDFA on IOS + Android

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 56.1%
  • Objective-C 21.3%
  • Ruby 16.0%
  • JavaScript 6.6%