Skip to content

Commit

Permalink
Added Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
Knut Inge Grosland committed May 26, 2015
1 parent 589baeb commit f136794
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion App Reviews.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
49ACB83D1AD5CAA00050C1B7 /* App Reviews */ = {
isa = PBXGroup;
children = (
4910B4351B0E8E7300FDC0EA /* AppDelegate.swift */,
4910B3E51B0E200200FDC0EA /* ReviewManager */,
49F800F51ADC840C004A1BF1 /* Window & ViewControllers */,
49F800F41ADC83EC004A1BF1 /* Views */,
Expand Down Expand Up @@ -316,7 +317,6 @@
isa = PBXGroup;
children = (
4910B49A1B0E906800FDC0EA /* Main.storyboard */,
4910B4351B0E8E7300FDC0EA /* AppDelegate.swift */,
4910B4371B0E8E8400FDC0EA /* StatusMenuController.swift */,
4910B4391B0E8E9600FDC0EA /* ApplicationViewController.swift */,
4910B43A1B0E8E9600FDC0EA /* ApplicationWindowController.swift */,
Expand Down
11 changes: 7 additions & 4 deletions AppReviews/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import Cocoa
import AppKit

// #define Color(value) (value) / 255.0
import SimpleCocoaAnalytics

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {
Expand All @@ -24,8 +23,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {

func applicationDidFinishLaunching(aNotification: NSNotification) {

// UA-62792522-4

var analyticsHelper = AnalyticsHelper.sharedInstance()
analyticsHelper.recordScreenWithName("Launch")
analyticsHelper.beginPeriodicReportingWithAccount("UA-62792522-3", name: "App Reviews OSX", version: NSApplication.v_versionBuild())

// Create ReviewManager shared object
var manager = ReviewManager.start()

Expand All @@ -35,6 +36,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {

func applicationWillTerminate(aNotification: NSNotification) {
// Insert code here to tear down your application
AnalyticsHelper.sharedInstance().handleApplicationWillClose()
NSUserDefaults.standardUserDefaults().synchronize()
}

func applicationShouldTerminate(sender: NSApplication) -> NSApplicationTerminateReply {
Expand Down
4 changes: 2 additions & 2 deletions AppReviews/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
<constraint firstAttribute="width" constant="135" id="Ngd-0n-4XR"/>
<constraint firstAttribute="height" constant="21" id="g6n-sk-AcZ"/>
</constraints>
<buttonCell key="cell" type="push" title="Project Pages" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="pTs-VW-UdE">
<buttonCell key="cell" type="push" title="Visit Website" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="pTs-VW-UdE">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
Expand All @@ -151,7 +151,7 @@
<constraint firstAttribute="height" constant="21" id="GMF-Wg-uJt"/>
<constraint firstAttribute="width" constant="135" id="Kob-CH-b6q"/>
</constraints>
<buttonCell key="cell" type="push" title="Check for updates" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="BVJ-mb-0pS">
<buttonCell key="cell" type="push" title="Check for Updates" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="BVJ-mb-0pS">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
Expand Down
3 changes: 2 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ use_frameworks!
pod 'SwiftyJSON', '~> 2.2'
pod 'Alamofire', '~> 1.2'
pod 'EDStarRating', '~> 1.1'
pod 'Sparkle', '~> 1.9'
pod 'Sparkle', '~> 1.9'
pod 'SimpleCocoaAnalytics', '~> 0.1'
3 changes: 3 additions & 0 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
PODS:
- Alamofire (1.2.1)
- EDStarRating (1.1)
- SimpleCocoaAnalytics (0.1.0)
- Sparkle (1.9.0)
- SwiftyJSON (2.2.0)

DEPENDENCIES:
- Alamofire (~> 1.2)
- EDStarRating (~> 1.1)
- SimpleCocoaAnalytics (~> 0.1)
- Sparkle (~> 1.9)
- SwiftyJSON (~> 2.2)

SPEC CHECKSUMS:
Alamofire: 1acfdf179aff68b41a48dff70c1ac7fa263e2bcb
EDStarRating: a41a6440a945020745d0e9ff8ada7d1afa952114
SimpleCocoaAnalytics: cc95e551884ec851002c668d15b71b8a73e92f56
Sparkle: 75bbbc5ab2d666f7f77c241afe7fd28364a8f9f7
SwiftyJSON: 0b3e6c07af17ff745e77e8e9984097b55c956e5c

Expand Down

0 comments on commit f136794

Please sign in to comment.