@@ -50,21 +50,22 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
5050 NotificationCenter . default. post ( name: . init( " io.sentry.newbreadcrumb " ) , object: breadcrumb)
5151 return breadcrumb
5252 }
53- }
54-
55- SentrySDK . configureScope { ( scope) in
56- scope. setEnvironment ( " debug " )
57- scope. setTag ( value: " swift " , key: " language " )
58-
59- let user = User ( userId: " 1 " )
60- 61- scope. setUser ( user)
53+
54+ options. initialScope = { scope in
55+ scope. setEnvironment ( " debug " )
56+ scope. setTag ( value: " swift " , key: " language " )
57+
58+ let user = User ( userId: " 1 " )
59+ 60+ scope. setUser ( user)
6261
63- if let path = Bundle . main. path ( forResource: " Tongariro " , ofType: " jpg " ) {
64- scope. addAttachment ( Attachment ( path: path, filename: " Tongariro.jpg " , contentType: " image/jpeg " ) )
65- }
66- if let data = " hello " . data ( using: . utf8) {
67- scope. addAttachment ( Attachment ( data: data, filename: " log.txt " ) )
62+ if let path = Bundle . main. path ( forResource: " Tongariro " , ofType: " jpg " ) {
63+ scope. addAttachment ( Attachment ( path: path, filename: " Tongariro.jpg " , contentType: " image/jpeg " ) )
64+ }
65+ if let data = " hello " . data ( using: . utf8) {
66+ scope. addAttachment ( Attachment ( data: data, filename: " log.txt " ) )
67+ }
68+ return scope
6869 }
6970 }
7071 }
0 commit comments