Skip to content

Commit d760952

Browse files
authored
feat: Cococ update (#833)
1 parent 6bb4639 commit d760952

File tree

1 file changed

+28
-1
lines changed
  • src/collections/_documentation/clients/cocoa

1 file changed

+28
-1
lines changed

src/collections/_documentation/clients/cocoa/advanced.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,36 @@ Client.shared?.extra = [
4343
"my_key": 1,
4444
"some_other_value": "foo bar"
4545
]
46+
Client.shared?.releaseName = "release"
47+
Client.shared?.dist = "dist"
48+
Client.shared?.environment = "production"
4649
```
4750

48-
All of the above (_user_, _tags_, and _extra_) can be set at anytime. Call `Client.shared?.clearContext()` to clear all set variables.
51+
All of the above (_user_, _tags_, _extra_, _releaseName_, _dist_ and _environment_) can be set at anytime. Call `Client.shared?.clearContext()` to clear all set variables.
52+
53+
## Disabling the Client
54+
55+
You can disable the client to prevent events from being sent. Note that the events will still be stored to disk. This functionality is helpful in case you want to ask the user for consent if they want to send the crash reports for example.
56+
57+
```swift
58+
Client.shared?.enabled = false
59+
```
60+
61+
## Init client with options
62+
63+
You can also `init` the client with options:
64+
65+
```swift
66+
Client.shared = try Client(options: [
67+
"dsn": "___PUBLIC_DSN___",
68+
"enabled": false, // In Objective-C this is @YES/@NO
69+
"release": "release",
70+
"dist": "dist",
71+
"environment": "production",
72+
])
73+
```
74+
75+
This way of initialization is helpful if you want to prevent the client from sending stored events.
4976

5077
## User Feedback {#cocoa-user-feedback}
5178

0 commit comments

Comments
 (0)