Skip to content

Instantly share code, notes, and snippets.

@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)
@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 }
@flurrydev
flurrydev / initalizeflurryflutter.dart
Last active February 18, 2022 19:03
Initialize Flurry with Flutter
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter_flurry_sdk/flurry.dart';
class FlurryExample {
/// Init Flurry once as early as possible recommended in main.dart.
/// For each platform (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.
- (void)somePurchasingEvent{
FlurryParamBuilder *param = [[[[[[FlurryParamBuilder alloc] init]
setDouble:34.99 forParam:FLURRY_EVENT_PARAM_TOTAL_AMOUNT]
setBoolean:YES forParam:FLURRY_EVENT_PARAM_SUCCESS]
setString:@"book 1" forParam:FLURRY_EVENT_PARAM_ITEM_NAME]
setString:@”This is an awesome book to purchase !!!” forKey:@"note"];
[Flurry logStandardEvent:FLURRY_EVENT_PURCHASED withParameters:param];
}
FlurryEvent.Params params = new FlurryEvent.Params()
.putDouble (FlurryEvent.Param.TOTAL_AMOUNT, 34.99)
.putBoolean(FlurryEvent.Param.SUCCESS, true)
.putString (FlurryEvent.Param.ITEM_NAME, "book 1")
.putString ("note", "This is an awesome book to purchase !!!");
FlurryAgent.logEvent(FlurryEvent.PURCHASED, params);
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:81bf35e155b5e47a3c7697ba1d052341
Created November 21, 2020 00:02
iOS Crash Analytics Swift
//Enable crash analytics when you start your Flurry session
let builder = FlurrySessionBuilder.init()
...
.withCrashReporting(true)
.withSessionContinueSeconds(10)
// Replace YOUR_API_KEY with the api key in the downloaded package
Flurry.startSession("YOUR_API_KEY", with: builder)
//Caught Exceptions
Flurry.logError("Error ID", message: "log with exception message", exception: exception)
@flurrydev
flurrydev / gist:b781c0d8c074ebc3613a1262fa84f838
Last active November 21, 2020 00:00
iOS Crash Analytics ObjC
//Enable crash analytics when you start your Flurry session
FlurrySessionBuilder *sessionBuilder = [[FlurrySessionBuilder new] withCrashReporting:YES];
[Flurry startSession:@"<< YOUR API KEY HERE>>" withSessionBuilder:sessionBuilder];
//Caught Exceptions
[Flurry logError:@"HandledException" message:@"" exception:exception];
//Logged Errors
[Flurry logError:@"WebView No Load" message:[error localizedDescription] error:error];