Skip to content

Instantly share code, notes, and snippets.

import com.flurry.android.FlurryAgent;
public class MyApplication extends Application {
public void onCreate() {
super.onCreate();
new FlurryAgent.Builder()
.withLogLevel(Log.VERBOSE)
.withLogEnabled(true)
.build(this, FLURRY_APIKEY);
@flurrydev
flurrydev / flurry_sdk.gradle
Last active August 22, 2023 19:51
update for 13.0.0 release (flurry ads has been decoupled externally)
// In your main app's Gradle config file:
repositories {
mavenCentral()
}
dependencies {
// Recommended to add Google Play Services
implementation 'com.google.android.gms:play-services-ads-identifier:17.1.0'
@flurrydev
flurrydev / flurry_timed_event_with_param.swift
Created April 19, 2022 21:44
flurry_timed_event_with_param.swift
// Capture the author info & user status
let articleParams = ["Author": "John Q", "User_Status": "Registered"];
Flurry.log(eventName: "Article_Read", parameters: articleParams, timed: true)
// In a function that captures when a user navigates away from article
// You can pass in additional params or update existing ones here as well
Flurry.endTimedEvent(eventName: "Article_Read", parameters: nil)
// Capture author info & user status
val articleParams = HashMap<String, String>()
articleParams["Author"] = "John Q"
articleParams["User_Status"] = "Registered"
FlurryAgent.logEvent("Article_Read", articleParams)
@flurrydev
flurrydev / track_user_demographics.swift
Last active April 20, 2022 20:34
Track User Demographics Swift
Flurry.set(userId:"user_id")
Flurry.set(gender:"f")
Flurry.set(age:20)
let array = ["value1", "value2", "value3"]
//Sets and replaces (if any exist) the values for a property.
FlurryUserProperties.set("key", values: array)
FlurryUserProperties.set("key", value: "string")
//Adds the values or single value to the property.
FlurryUserProperties.add("key", values: array)
FlurryUserProperties.add("key", value: "string")
func someFunction(){
let param = FlurryParamBuilder()
.set(doubleVal: 34.99, param: FlurryParamBuilder.totalAmount())
.set(booleanVal: true, param: FlurryParamBuilder.success())
.set(stringVal: "book 1", param: FlurryParamBuilder.itemName())
.set(stringVal: "This is an awesome book to purchase !!!", key: "note")
Flurry.log(standardEvent: FlurryEvent.FLURRY_EVENT_PURCHASED, param: param)
}
@flurrydev
flurrydev / gist:cc0e1dc16f59c11e6494bbe37255c59c
Created April 19, 2022 21:39
Flurry_event_with_parameters_Swift
// Capture the author info & user status
let articleParams = ["Author": "John Q", "User_Status": "Registered"];
Flurry.log(eventName: "Article_Read", parameters: articleParams)
@flurrydev
flurrydev / gist:e8336a92c2f414869d803c6e19c2dd94
Created April 19, 2022 21:27
Flurry_event_simple.swift
Flurry.log(eventName: "article_read")
@flurrydev
flurrydev / FlutterFlurryAPI.dart
Last active February 18, 2022 19:39
Flurry APIs for Flutter
// Methods in Flurry.builder to initialize Flurry Agent
Builder withAppVersion(String versionName); // iOS only. For Android, please use Flurry.setVersionName() instead.
Builder withContinueSessionMillis(int sessionMillis);
Builder withCrashReporting(bool crashReporting);
Builder withDataSaleOptOut(bool isOptOut);
Builder withIncludeBackgroundSessionsInMetrics(bool includeBackgroundSessionsInMetrics);
Builder withLogEnabled(bool enableLog);
Builder withLogLevel(LogLevel logLevel); // LogLevel = { verbose, debug, info, warn, error, assertion }
Builder withMessaging(bool enableMessaging, MessagingListener listener);
Builder withPerformanceMetrics(int performanceMetrics); // Performance = { none, coldStart, screenTime, all }