Skip to content

Instantly share code, notes, and snippets.

@ydn
ydn / Flurry_event_simple.swift
Created June 10, 2015 23:16
Simple Flurry Event (Swift)
Flurry.logEvent("Article_Read");
@ydn
ydn / flurry_timed_event_with_param.swift
Last active August 29, 2015 14:22
Capture Event Duration
// Capture the author info & user status
let articleParams = ["Author": "John Q", "User_Status": "Registered"];
Flurry.logEvent("Article_Read", withParameters: 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("Article_Read", withParameters: nil);
@ydn
ydn / setup_location_manager.swift
Created June 10, 2015 23:28
Track geographic location (Swift)
let locationManager: CLLocationManager = CLLocationManager();
locationManager.startUpdatingLocation();
@ydn
ydn / gps_location.swift
Last active August 29, 2015 14:22
Set GPS of user (Swift)
if let location:CLLocation = locationManager.location {
Flurry.setLatitude(location.coordinate.latitude,
longitude: location.coordinate.longitude,
horizontalAccuracy: location.horizontalAccuracy,
verticalAccuracy: location.verticalAccuracy
);
}
@ydn
ydn / track_age_and_gender.swift
Created June 10, 2015 23:33
Track Age and Gender
Flurry.setAge(21);
@ydn
ydn / gender.swift
Last active August 29, 2015 14:22
Log user's gender
Flurry.setGender("m");
@ydn
ydn / track_user_id.swift
Last active November 6, 2020 03:59
Track User ID
Flurry.setUserID("USER_ID");
@ydn
ydn / track_application_errors.swift
Created June 10, 2015 23:37
Track Application Errors
Flurry.logError("ERROR_NAME", message: "ERROR_MESSAGE", exception: e);
@ydn
ydn / track_page_views.swift
Created June 10, 2015 23:38
Track Page Views
Flurry.logAllPageViewsForTarget(navigationController);
@ydn
ydn / track_page_views_second.swift
Created June 10, 2015 23:39
Track Page Views (second box)
Flurry.logPageView();