react-native-party-track
v0.3.1
Published
React Native wrapper for [Party Track](http://partytrack.it/).
Downloads
26
Readme
React Native Party Track
React Native wrapper for Party Track.
Requirements
- Party Track SDK
- React Native
Installation
$ npm install react-native-party-track --save
■ iOS Setup
$ react-native link react-native-party-track
Troubleshooting
'Partytrack/Partytrack.h' file not found
Add path to Partytrack.framework
in RNPartyTrack.xcodeproj > Build Settings > FRAMEWORK_SEARCH_PATHS.
■ Android Setup
In android/app/build.gradle
dependencies {
...
+ compile project(':react-native-party-track')
}
In MainApplication.java
+ import com.yyoshiki41.RNPartyTrack.RNPartyTrack;
public class MainApplication extends Application implements ReactApplication {
...
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
...
+ new RNPartyTrack()
);
}
}
This package needs android/app/libs/partytrack.jar
in your project.
If there is not, fix a relative path in android/build.gradle
.
Troubleshooting
When your projects's android/app/build.gradle
includes *.jar
, fix like below.
dependencies {
...
- compile fileTree(include: ['*.jar'], dir: 'libs')
+ compile fileTree(include: ['*.jar'], dir: 'libs', exclude: 'partytrack.jar')
}
Usage
// Require the module
var PartyTrack = require('react-native-party-track').default;
// Send an event
PartyTrack.sendEventWithID(1);