Skip to content

Instantly share code, notes, and snippets.

@flurrydev
flurrydev / gist:113d7520b19260878109ce17ab941cb1
Last active March 18, 2019 21:00
Manually start Flurry session in UnityAppController.mm
#import "FlurryUnityPlugin.h"
.....
//in UnityAppController.mm
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
::printf("-> applicationDidFinishLaunching()\n");
FlurryUnityPlugin* sharedInstance = [FlurryUnityPlugin shared];
@flurrydev
flurrydev / gist:b39603e633a917130e43f808c8494c51
Last active May 22, 2019 22:49
Flurry Unity SDK initialization with Push enabled
new Flurry.Builder()
.WithCrashReporting(true)
.WithIncludeBackgroundSessionsInMetrics(true)
.WithContinueSessionMillis(6000)
.WithLogEnabled(true)
.WithLogLevel(Flurry.LogLevel.LogVERBOSE)
//add this method to the Builder to enable push
.WithMessaging(true)
// Methods to initialize Flurry
Flurry.Builder.withAppVersion(versionName = '1.0'); // iOS only. For Android, please use Flurry.setVersionName() instead.
Flurry.Builder.withContinueSessionMillis(sessionMillis = 10000);
Flurry.Builder.withCrashReporting(crashReporting = true);
Flurry.Builder.withDataSaleOptOut(isOptOut = false);
Flurry.Builder.withIAPReportingEnabled(enableIAP = true); // iOS only.
Flurry.Builder.withIncludeBackgroundSessionsInMetrics(includeBackgroundSessionsInMetrics = true);
Flurry.Builder.withLogEnabled(enableLog = true);
Flurry.Builder.withLogLevel(logLevel = Flurry.LogLevel.WARN); // LogLevel = { VERBOSE, DEBUG, INFO, WARN, ERROR, ASSERT }
Flurry.Builder.withPerformanceMetrics(performanceMetrics = Flurry.PerformanceMetrics.ALL)); // performanceMetrics = { NONE, COLD_START, SCREEN_TIME, ALL }
import Flurry from 'react-native-flurry-sdk';
// Init Flurry once as early as possible recommended in index.js.
// For each platfrom (Android, iOS) where the app runs you need to acquire a unique Flurry API Key.
// i.e., you need two API keys if you are going to release the app on both Android and iOS platforms.
// If you are building for TV platforms, you will need two API keys for Android TV and tvOS.
new Flurry.Builder()
.withCrashReporting(true)
.withLogEnabled(true)
.withLogLevel(Flurry.LogLevel.DEBUG)
@flurrydev
flurrydev / gist:19136bcac03b55106afd54afc6f7498e
Created December 12, 2018 20:50
Unity: Methods to enable IAP reporting (iOS)
void SetIAPReportingEnabled(bool enableIAP);
@flurrydev
flurrydev / gist:e911b67013cdb8397679d75d0f092d61
Created December 12, 2018 20:46
Flurry: Methods to log Flurry events
Flurry.EventRecordStatus LogEvent(string eventId);
Flurry.EventRecordStatus LogEvent(string eventId, bool timed);
Flurry.EventRecordStatus LogEvent(string eventId, Dictionary<string, string> parameters);
Flurry.EventRecordStatus LogEvent(string eventId, Dictionary<string, string> parameters, bool timed);
void EndTimedEvent(string eventId);
void EndTimedEvent(string eventId, Dictionary<string, string> parameters);
void OnPageView();
@flurrydev
flurrydev / gist:37cddc457e8d372932f46e4b0841670b
Created December 12, 2018 20:44
Unity: Methods to get Flurry versions
int GetAgentVersion();
//Android only
string GetReleaseVersion();
string GetSessionId();
@flurrydev
flurrydev / gist:c9e3743532992ebfeed20a44403f1b7f
Created December 12, 2018 20:33
Unity: Methods to set users preferences
void SetAge(int age);
void SetGender(Flurry.Gender gender);
void SetReportLocation(bool reportLocation);
void SetSessionOrigin(string originName, string deepLink);
void SetUserId(string userId);
//The SetVersionName method is called before the session is initialized. See the FlurryStart.cs example script for usage.
void SetVersionName(string versionName);
void AddOrigin(string originName, string originVersion);
void AddOrigin(string originName, string originVersion, Dictionary<string, string> originParameters);
@flurrydev
flurrydev / gist:9790433b6c32c1eed2f3c413066187e5
Created December 12, 2018 20:28
Unity: Methods in Flurry.builder
void Build(string apiKey);
Flurry.Builder WithCrashReporting(bool crashReporting);
Flurry.Builder WithContinueSessionMillis(long sessionMillis);
Flurry.Builder WithIncludeBackgroundSessionsInMetrics(bool includeBackgroundSessionsInMetrics);
Flurry.Builder WithLogEnabled(bool enableLog);
Flurry.Builder WithLogLevel(FlurrySDK.Flurry.LogLevel logLevel);
@flurrydev
flurrydev / gist:7f4777eb0cc48c226ef02de86a10a870
Last active February 7, 2021 13:32
initialize Flurry in Unity project
using FlurrySDK;
public class FlurryStart : MonoBehaviour
{
#if UNITY_ANDROID
private string FLURRY_API_KEY = "ANDROID_API_KEY";
#elif UNITY_IPHONE
private string FLURRY_API_KEY = "IOS_API_KEY";
#else