@@ -6,27 +6,31 @@ class FirstViewController: UIViewController {
66 let delegate = UIApplication . shared. delegate as! AppDelegate
77
88 @IBAction func didTouchButton( _ sender: Any ) {
9- os_log ( " didTouchButton " , log : OSLog . default , type : . debug )
9+ log ( " didTouchButton " )
1010 let demoMetas = ParselyMetadata ( authors: [ " Yogi Berr " ] )
1111 delegate. parsely. trackPageView ( url: " http://parsely.com/path/cool-blog-post/1?qsarg=nawp&anotherone=yup " , metadata: demoMetas, extraData: [ " product-id " : " 12345 " ] , siteId: " subdomain.parsely-test.com " )
1212 }
1313
1414 @IBAction func didStartEngagement( _ sender: Any ) {
15- os_log ( " didStartEngagement " , log : OSLog . default , type : . debug )
15+ log ( " didStartEngagement " )
1616 delegate. parsely. startEngagement ( url: " http://parsely.com/very-not-real " , urlref: " http://parsely.com/not-real " , extraData: [ " product-id " : " 12345 " ] , siteId: " engaged.parsely-test.com " )
1717 }
1818
1919 @IBAction func didStopEngagement( _ sender: Any ) {
20- os_log ( " didStopEngagement " , log : OSLog . default , type : . debug )
20+ log ( " didStopEngagement " )
2121 delegate. parsely. stopEngagement ( )
2222 }
2323 @IBAction func didStartVideo( _ sender: Any ) {
24- os_log ( " didStartVideo " , log : OSLog . default , type : . debug )
24+ log ( " didStartVideo " )
2525 let demoMetas = ParselyMetadata ( authors: [ " Yogi Berr " ] , duration: TimeInterval ( 10 ) )
2626 delegate. parsely. trackPlay ( url: " http://parsely.com/path/cool-blog-post/1?qsarg=nawp&anotherone=yup " , urlref: " not-a-real-urlref " , videoID: " videoOne " , duration: TimeInterval ( 6000 ) , metadata: demoMetas, extraData: [ " product-id " : " 12345 " , " ts " : " should be overwritten " ] )
2727 }
2828 @IBAction func didPauseVideo( _ sender: Any ) {
29- os_log ( " didStopVideo " , log : OSLog . default , type : . debug )
29+ log ( " didStopVideo " )
3030 delegate. parsely. trackPause ( )
3131 }
32+
33+ private func log( _ message: String ) {
34+ os_log ( " [Parsely Demo App] %@ " , log: OSLog . default, type: . debug, message)
35+ }
3236}
0 commit comments