This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Using Ruby 2.1.2 | |
| require 'net/http' | |
| require 'json' | |
| require 'SecureRandom' | |
| # | |
| # | |
| #### Configuration #### | |
| # | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // AppDelegate.m | |
| // | |
| // This skeleton code provides a custom 'tagEvent' wrapper method to be used in leiu of directly calling the Localytics | |
| // tagEvent method. This method will automatically detect when a customer lifetime value increase has occured and will | |
| // toggle a custom dimension after the first CLV increase has occured. | |
| @implementation AppDelegate | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // GSAppDelegate.m | |
| // ProximiT | |
| // | |
| // Created by Randy Dailey on 5/30/13. | |
| // Copyright (c) 2013 JLRD. All rights reserved. | |
| // | |
| @implementation GSAppDelegate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + (NSString *)stringForBucketedHours:(int)seconds | |
| { | |
| NSArray *buckets = [NSArray arrayWithObjects:@1,@3, @10, @24, @48, @96, nil]; | |
| return [NSString stringWithFormat:@"%@ hours", [GSAnalyticsProvider bucket:(seconds/3600.0f) andStep:buckets]]; | |
| } | |
| + (NSString *)stringForBucketedMeters:(int)meters | |
| { | |
| NSArray *buckets = [NSArray arrayWithObjects:@20, @50, @100, @150, @200, @500, @1000, @5000, nil]; | |
| return [NSString stringWithFormat:@"%@ meters", [GSAnalyticsProvider bucket:meters andStep:buckets]]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // App Delegate | |
| // | |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| [GSAnalyticsProvider startSession:launchOptions]; | |
| return YES; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Remove all Localytics code from this method | |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| return YES; | |
| } | |
| // This method changes! | |
| // This method is optional, per our integration guide | |
| - (void)applicationDidBecomeActive:(UIApplication *)application | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo | |
| { | |
| UIApplicationState state = [application applicationState]; | |
| if (state == UIApplicationStateActive) | |
| { | |
| // Recieved a notification while the app was already open. May want to record seperately or ignore | |
| } | |
| else | |
| { | |
| // Recieved notification while in background. Tag this as if it came from a cold start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| QString LocalyticsSession::formatAttribute(QString name, QString value, bool firstAttribute) | |
| { | |
| QString formattedString; | |
| if (!firstAttribute) | |
| { | |
| formattedString.append(QLatin1Char(',')); | |
| } | |
| QString quotedName = QString(QLatin1String("\"%1\"")).arg(escapeString(name)); | |
| value = value.isEmpty() ? QString(QLatin1String("null")) : QString(QLatin1String("\"%1\"")).arg(escapeString(value)); | |
| formattedString.append(quotedName).append(QLatin1Char(':')).append(value); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static string EscapeString(string input) | |
| { | |
| StringBuilder escapedStringBuilder = new StringBuilder(); | |
| escapedStringBuilder.Append("\""); | |
| foreach (char character in input) | |
| { | |
| switch (character) | |
| { | |
| case '\"': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
| <html xmlns="http://www.w3.org/1999/xhtml"> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <title>POST Server Demo</title> | |
| <style type="text/css"> | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| } |
NewerOlder