Skip to content

Instantly share code, notes, and snippets.

@ydn
ydn / configure_data.swift
Created June 10, 2015 23:40
Configure when data is sent to Flurry (Swift)
Flurry.setSessionReportsOnCloseEnabled(true);
@ydn
ydn / configure_data_second.swift
Created June 10, 2015 23:42
Configure when data is sent to Flurry (second box, Swift example)
Flurry.setSessionReportsOnPauseEnabled(true);
@ydn
ydn / FlurryiOSNativeAdTracking.swift
Created June 11, 2015 17:30
Flurry iOS Native Ad Tracking (Swift Example)
func setupWithFlurryNativeAd(adNative: FlurryAdNative, atPosition: NSInteger){
ad.removeTrackingView()
self.ad = adNative;
self.ad.trackingView = self;
}
@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;
@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 / 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 / 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 / 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 / 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 / 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);