React Native Flurry Analytics
React Native wrapper for flurry analytics.
Table of contents
Installation
Common
- Install package via npm:
npm install react-native-flurry-analytics --save
- Link native part
react-native link react-native-flurry-analytics
- Inside your code include JS part by adding
;
iOS
sudo gem install cocoapodscd iospod initopen Podfile
Add this line
pod 'Flurry-iOS-SDK/FlurrySDK'
Then run
pod install
Android
Add these lines in AndroidManifest.xml
<!-- Required permissions - Internet access --><!-- Recommended permission - External memory pre-caching -->
Configure Proguard (optional)
Add following to android/app/proguard-rules.pro
# Required to preserve the Flurry SDK
-keep class com.flurry.** { *; }
-dontwarn com.flurry.**
-keepattributes *Annotation*,EnclosingMethod,Signature
-keepclasseswithmembers class * {
public (android.content.Context, android.util.AttributeSet, int);
}
# Google Play Services library
-keep class * extends java.util.ListResourceBundle {
protected Object[ ][ ] getContents();
}
-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
public static final *** NULL;
}
-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
@com.google.android.gms.common.annotation.KeepName *;
}
-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}
Usage
startSession(string apiKey)
FlurryAnalytics;
setAppVersion(string version)
!!! method must be called prior to invoking startSession
FlurryAnalytics;
setDebugLogEnabled(bool enabled)
!!! method must be called prior to invoking startSession
FlurryAnalytics
setSessionContinueSeconds(int seconds)
!!! method must be called prior to invoking startSession
FlurryAnalytics;
setCrashReportingEnabled(bool enabled)
!!! method must be called prior to invoking startSession
FlurryAnalytics;
logEvent(string eventName, object params, bool timed)
FlurryAnalytics;FlurryAnalytics;FlurryAnalytics;FlurryAnalytics;
endTimedEvent(string eventName, object params)
FlurryAnalytics;FlurryAnalytics;
logPageView()
FlurryAnalytics;
setUserId(string userId)
FlurryAnalytics;
setUserAge(int age)
FlurryAnalytics;
setUserGender(string gender)
FlurryAnalytics;// orFlurryAnalytics;
iOS Android
For more information read official docsContributing
Just submit a pull request!
Copyright and license
Code and documentation copyright 2016 Dmitriy Kolesnikov. Code released under the MIT license.