Skip to content

Commit 5d50713

Browse files
author
Vadym Kurachevskyi
committed
Update documentation
1 parent c040a24 commit 5d50713

File tree

1 file changed

+29
-16
lines changed

1 file changed

+29
-16
lines changed

README.md

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -70,23 +70,32 @@ UserReport.configure(sakId: "YOUR_SAK_ID", mediaId: "YOU_MEDIA_ID", user: user,
7070
7171
```
7272
### Screen tracking
73-
#### Manual
74-
To manually measure the screen view, use the method `UserReport.shared?.trackScreenView()`.
75-
Or `UserReport.shared?.trackSectionScreenView(sectionId)` for measuring section screen view.
73+
There are two types of tracking *ScreenView* and *SectionScreenView*. One should be used in favor of another depending on the media.
7674

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
7786
```swift
7887
class ViewController: UIViewController {
7988
override open func viewDidAppear(_ animated: Bool) {
8089
super.viewDidAppear(animated)
8190
8291
// Tracking screen view
83-
UserReport.shared?.trackScreen()
92+
UserReport.trackScreenView()
8493
}
8594
}
8695
```
8796

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.
9099
91100
```swift
92101
class ViewController: UserReportViewController {
@@ -103,7 +112,7 @@ The survey can appear in two ways:
103112
To change the display mode, please specify following:
104113
105114
```swift
106-
UserReport.shared?.displayMode = .fullscreen
115+
UserReport.setDisplayMode(.fullscreen)
107116
```
108117
109118
### Change settings
@@ -114,26 +123,26 @@ let settings = Settings()
114123
settings.sessionScreensView = 5
115124
settings.inviteAfterNSecondsInApp = 20
116125
117-
UserReport.shared?.updateSettings(settings)
126+
UserReport.updateSettings(settings)
118127
```
119128
120129
### 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`.
122131
123132
```swift
124-
UserReport.shared?.mute = true
133+
UserReport.mute = true
125134
```
126-
> Don't forget to return back to `false`.
135+
> Do not forget to restore value back to `false`.
127136
128137
129138
### 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.
131140
132141
```swift
133142
let user = User()
134143
user.email = "[email protected]"
135144
136-
UserReport.shared?.updateUser(user)
145+
UserReport.updateUser(user)
137146
```
138147
139148
### Session info
@@ -144,12 +153,12 @@ UserReport SDK stores the data on the count of screens viewed and the time the a
144153
- `sessionSeconds` - number of seconds spent in the application for current session
145154
- `totalSecondsInApp` - number of seconds spent in the application for all time
146155
- `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
148157
149158
150159
```swift
151160
// Session information about the running time of the application and screen views
152-
let session = UserReport.shared?.session
161+
let session = UserReport.session
153162
154163
// Get current settings for appear survey
155164
let currentSetting = session?.settings
@@ -159,8 +168,12 @@ let currentSetting = session?.settings
159168
If you decide to show the survey yourself, then you can use the following method:
160169
161170
```swift
162-
UserReport.shared?.tryInvite()
171+
UserReport.tryInvite()
163172
```
173+
174+
### IDFA
175+
SDK relies on IDFA. So make sure marking appropriate checkboxes when publishing your app.
176+
164177
## License
165178
166179
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

Comments
 (0)