@@ -6,27 +6,31 @@ class FirstViewController: UIViewController {
6
6
let delegate = UIApplication . shared. delegate as! AppDelegate
7
7
8
8
@IBAction func didTouchButton( _ sender: Any ) {
9
- os_log ( " didTouchButton " , log : OSLog . default , type : . debug )
9
+ log ( " didTouchButton " )
10
10
let demoMetas = ParselyMetadata ( authors: [ " Yogi Berr " ] )
11
11
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 " )
12
12
}
13
13
14
14
@IBAction func didStartEngagement( _ sender: Any ) {
15
- os_log ( " didStartEngagement " , log : OSLog . default , type : . debug )
15
+ log ( " didStartEngagement " )
16
16
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 " )
17
17
}
18
18
19
19
@IBAction func didStopEngagement( _ sender: Any ) {
20
- os_log ( " didStopEngagement " , log : OSLog . default , type : . debug )
20
+ log ( " didStopEngagement " )
21
21
delegate. parsely. stopEngagement ( )
22
22
}
23
23
@IBAction func didStartVideo( _ sender: Any ) {
24
- os_log ( " didStartVideo " , log : OSLog . default , type : . debug )
24
+ log ( " didStartVideo " )
25
25
let demoMetas = ParselyMetadata ( authors: [ " Yogi Berr " ] , duration: TimeInterval ( 10 ) )
26
26
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 " ] )
27
27
}
28
28
@IBAction func didPauseVideo( _ sender: Any ) {
29
- os_log ( " didStopVideo " , log : OSLog . default , type : . debug )
29
+ log ( " didStopVideo " )
30
30
delegate. parsely. trackPause ( )
31
31
}
32
+
33
+ private func log( _ message: String ) {
34
+ os_log ( " [Parsely Demo App] %@ " , log: OSLog . default, type: . debug, message)
35
+ }
32
36
}
0 commit comments