             println("ref \(reference) & val \(value)")
         }
     }
+    
+    func showAdvert() {
+        // show an advert if they haven't left a tip
+        let leftTip = NSUserDefaults.standardUserDefaults().boolForKey("kDidLeaveDonation")
+        if !leftTip {
+            println("Display advert")
+            BatchAds.displayAdForPlacement(BatchPlacementDefault)
+        }
+    }
 }

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        
//        // Register Notifications
//        BatchPush.registerForRemoteNotifications()
//        
//        // Clear any notifications when the user opens the app
//        BatchPush.dismissNotifications()
//        
//        // Setup Ads
//        BatchAds.setupAds()
//        
//        // Unlock
//        BatchUnlock.setupUnlockWithDelegate(self)
//        
//        // Start Batch
//        Batch.startWithAPIKey("DEV54EF398118121451CB109F931AE")
        
        // Realm Migration Check
        RLMRealm.setSchemaVersion(2, forRealmAtPath: RLMRealm.defaultRealmPath()) { (migration, oldSchemaVersion) in

        
        // If we crashed, or the user left the app, let's start the entry over
        IGIGoal.cleanInvalidGoals()
                
        return true
    }
    
