Pollfish support for Android and iOS
$ npm install react-native-pollfish-full --save
$ react-native link react-native-pollfish-full
Libraries
➜ Add Files to [your project's name]
node_modules
➜ react-native-pollfish-full
and add RNPollfish.xcodeproj
libRNPollfish.a
to your project's Build Phases
➜ Link Binary With Libraries
Podfile
and add "Pollfish", "~> 4.3.5"
Cmd+R
)<android/app/src/main/java/[...]/MainActivity.java
import me.jerson.mobile.ads.pollfish.RNPollfishPackage;
to the imports at the top of the filenew RNPollfishPackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
include ':react-native-pollfish-full'
project(':react-native-pollfish-full').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-pollfish-full/android')
android/app/build.gradle
:
compile project(':react-native-pollfish-full')
import Pollfish from 'react-native-pollfish-full';
eventHandlers = [
surveyReceived,
surveyCompleted,
userNotEligible,
surveyNotAvailable,
surveyOpened,
surveyClosed
];
Pollfish.initialize(key, releaseMode, customMode, format, userId);
Pollfish.show();
Pollfish.hide();
Pollfish.destroy();
Pollfish.addEventListener(type, handler);
Pollfish.removeEventListener(type, handler);
Pollfish.removeAllListeners();