Skip to content

Instantly share code, notes, and snippets.

@ydn
ydn / age_gender.mm
Created June 22, 2015 20:59
Track age and gender
[Flurry setAge:21];
@ydn
ydn / tracking_geographic_location_2.mm
Last active August 29, 2015 14:23
Tracking Geographic Location 2
CLLocation *location = locationManager.location;
[Flurry setLatitude:location.coordinate.latitude
longitude:location.coordinate.longitude
horizontalAccuracy:location.horizontalAccuracy
verticalAccuracy:location.verticalAccuracy];
@ydn
ydn / geographic_location.mm
Created June 22, 2015 20:54
Tracking Geographic location 1
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
[locationManager startUpdatingLocation];
@ydn
ydn / Flurry_timed_events_with_parameters.swift
Created June 22, 2015 20:51
Timed Flurry Events with Parameters
// 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 / swift_bridging_header.swift
Created June 17, 2015 00:16
Swift Bridging Header file
#ifndef demonstration_demonstration_Bridging_Header_h
#define demonstration_demonstration_Bridging_Header_h
#import "Flurry.h"
#endif
@ydn
ydn / UniversalIntegration.mm
Last active August 29, 2015 14:22
Universal Integration Example
- (void)applicationDidFinishLaunching:(UIApplication *)application {
if (device is iPAD) {
[FlurryAnalytics startSession:@"API Key for iPad project"]
} else {
[FlurryAnalytics startSession:@"API Key for iPhone project"]
}
}
@ydn
ydn / Log_Events_AppleWatch.swift
Created June 12, 2015 18:31
Log Events on Apple Watch (Swift)
@IBAction func theButtonPressed(sender:WKInterfaceButton) {
FlurryWatch.logWatchEvent("The Button has been pressed")
//your code
}
@ydn
ydn / Log_event_apple_watch.mm
Last active August 29, 2015 14:22
Log events on Apple Watch
#import "FlurryWatch.h"
- (IBAction) theButtonPressed:(WKInterfaceButton*) sender {
[FlurryWatch logWatchEvent:@"The Button has been pressed"];
//your code
}
@ydn
ydn / Apple_watch_events.mm
Created June 12, 2015 18:27
Apple Watch Events Objective C
[FlurryWatch logWatchEvent:(NSString*) eventName];
[FlurryWatch logWatchEvent:(NSString*) eventName withParameters:(NSDictionary*) parameters];
@ydn
ydn / FlurryiOSNativeAdViewComposition.swift
Last active August 29, 2015 14:22
Flurry iOS Native Ad view composition
func adNativeDidFetchAd(nativeAd: FlurryAdNative!) {
NSLog("Native Ad for Space \(nativeAd.space) Received Ad with \(nativeAd.assetList.count) assets");
for asset in nativeAd.assetList {
switch(asset.name) {
case "headline":
streamTitleLabel.text = asset.value;
case "summary":
streamDescriptionLabel.text = asset.value;