Skip to content

Commit 0d7d23d

Browse files
authored
Update comments and README.md with new event name. (#7)
1 parent 9b4c581 commit 0d7d23d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ After
8080
}
8181
```
8282

83-
## Segment Consent Preference Event
83+
## Segment Consent Preference Updated Event
8484

85-
When notified by the CMP SDK that consent has changed, a track event with name “Segment Consent Preference” will be emitted. Below is example of what that event will look like:
85+
When notified by the CMP SDK that consent has changed, a track event with name “Segment Consent Preference Updated” will be emitted. Below is example of what that event will look like:
8686

8787
```json
8888
{
8989
"anonymousId": "23adfd82-aa0f-45a7-a756-24f2a7a4c895",
9090
"type": "track",
91-
"event": "Segment Consent Preference",
91+
"event": "Segment Consent Preference Updated",
9292
"userId": "u123",
9393
"timestamp": "2023-01-01T00:00:00.000Z",
9494
"context": {
@@ -265,7 +265,7 @@ class OneTrustConsentChangedReceiver(val consentPlugin: ConsentManagementPlugin)
265265
}
266266
```
267267

268-
Here we can see that the OneTrust SDK notifies us of consent change via an Android Intent with the action `OTBroadcastServiceKeys.OT_CONSENT_UPDATED` so our notifier must create a broadcast receiver and listen for this event. One the event is broadcast the reciever will then call `consentPlugin.notifyConsentChanged()` to let the ConsentManagmentPlugin to send the `Segment Consent Preference` event.
268+
Here we can see that the OneTrust SDK notifies us of consent change via an Android Intent with the action `OTBroadcastServiceKeys.OT_CONSENT_UPDATED` so our notifier must create a broadcast receiver and listen for this event. One the event is broadcast the reciever will then call `consentPlugin.notifyConsentChanged()` to let the ConsentManagmentPlugin to send the `Segment Consent Preference Updated` event.
269269

270270

271271
## License

lib/src/main/java/com/segment/analytics/kotlin/destinations/consent/ConsentBlocker.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ open class ConsentBlocker(
3737
if (!consentJsonArray.contains(it)) {
3838

3939
if (allowSegmentPreferenceEvent && event is TrackEvent && event.event == EVENT_SEGMENT_CONSENT_PREFERENCE) {
40-
// IF event is the SEGMENT CONSENT PREFERENCE event let it through
40+
// IF event is the EVENT_SEGMENT_CONSENT_PREFERENCE event let it through
4141
return event
4242
} else {
4343
return null

lib/src/main/java/com/segment/analytics/kotlin/destinations/consent/ConsentManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class ConsentManager(
162162

163163
/**
164164
* Notify the ConsentManagementPlugin that consent has changed. This will
165-
* trigger the Segment Consent Preference event to be fired.
165+
* trigger the Segment Consent Preference Updated event to be fired.
166166
*/
167167
fun notifyConsentChanged() {
168168
consentChange?.invoke()
@@ -175,4 +175,4 @@ class ConsentManager(
175175
queuedEvents.poll()?.let { analytics.process(it) }
176176
}
177177
}
178-
}
178+
}

0 commit comments

Comments
 (0)