You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two types of tracking *ScreenView*and*SectionScreenView*. One should be used in favor of another depending on the media.
76
74
75
+
76
+
#### Screen View
77
+
If a media (website) has one topic it can be tracked by using`UserReport.trackScreenView`.
78
+
79
+
#### Section Screen View
80
+
If a website has different sections, for instance, media has *Health*, *World news*, *Local news*and it should be tracked differenlty `UserReport.trackSectionScreenView(sectionId)` method should be used instead.
81
+
82
+
#### Manual invocation
83
+
If`UserReport.trackSectionScreenView`or`UserReport.trackScreenView()` methods invoked by your code, automatic tracking should not be used.
84
+
85
+
#### Example
77
86
```swift
78
87
class ViewController: UIViewController {
79
88
override open func viewDidAppear(_ animated: Bool) {
80
89
super.viewDidAppear(animated)
81
90
82
91
// Tracking screen view
83
-
UserReport.shared?.trackScreen()
92
+
UserReport.trackScreenView()
84
93
}
85
94
}
86
95
```
87
96
88
-
#### Automatic
89
-
If you want to automatically measure views as screens using the `UserReportViewController`class.
97
+
#### Automatic tracking
98
+
If you want to automatically measure screen views. Application's ViewControllers should be inherited from the `UserReportViewController` class.
90
99
91
100
```swift
92
101
class ViewController: UserReportViewController {
@@ -103,7 +112,7 @@ The survey can appear in two ways:
103
112
To change the display mode, please specify following:
104
113
105
114
```swift
106
-
UserReport.shared?.displayMode = .fullscreen
115
+
UserReport.setDisplayMode(.fullscreen)
107
116
```
108
117
109
118
### Change settings
@@ -114,26 +123,26 @@ let settings = Settings()
114
123
settings.sessionScreensView = 5
115
124
settings.inviteAfterNSecondsInApp = 20
116
125
117
-
UserReport.shared?.updateSettings(settings)
126
+
UserReport.updateSettings(settings)
118
127
```
119
128
120
129
### Mute
121
-
In order for the survey not to appear on important screens, you can use a variable `mute`.
130
+
For the survey not to appear on important screens, you can use a variable `mute`.
122
131
123
132
```swift
124
-
UserReport.shared?.mute = true
133
+
UserReport.mute = true
125
134
```
126
-
>Don't forget to return back to `false`.
135
+
> Do not forget to restore value back to `false`.
127
136
128
137
129
138
### Update user info
130
-
When changing user data, you should also send the updated data to the UserRecord iOS SDK.
139
+
When changing user data, you should also send the updated data to the UserReport iOS SDK.
@@ -144,12 +153,12 @@ UserReport SDK stores the data on the count of screens viewed and the time the a
144
153
- `sessionSeconds` - number of seconds spent in the application for current session
145
154
- `totalSecondsInApp` - number of seconds spent in the application for all time
146
155
- `localQuarantineDate` - date until the survey will not appear again
147
-
- `settings` - current settings for appearing the survey
156
+
- `settings` - current settings for the survey appearance
148
157
149
158
150
159
```swift
151
160
// Session information about the running time of the application and screen views
152
-
let session = UserReport.shared?.session
161
+
let session = UserReport.session
153
162
154
163
// Get current settings for appear survey
155
164
let currentSetting = session?.settings
@@ -159,8 +168,12 @@ let currentSetting = session?.settings
159
168
If you decide to show the survey yourself, then you can use the following method:
160
169
161
170
```swift
162
-
UserReport.shared?.tryInvite()
171
+
UserReport.tryInvite()
163
172
```
173
+
174
+
### IDFA
175
+
SDK relies on IDFA. So make sure marking appropriate checkboxes when publishing your app.
176
+
164
177
## License
165
178
166
179
UserReport iOS SDK is released under the Apache License 2.0. [See LICENSE](https://github.com/AudienceProject/userreport-ios-sdk/blob/master/LICENSE) for details.
0 commit comments