1- package com.segment.analytics.destinations.mydestination .testapp
1+ package com.segment.analytics.consent.onetrust .testapp
22
33import android.app.Application
44import android.content.Context
@@ -10,8 +10,8 @@ import com.segment.analytics.kotlin.android.Analytics
1010import com.segment.analytics.kotlin.core.Analytics
1111import com.segment.analytics.kotlin.core.platform.policies.CountBasedFlushPolicy
1212import com.segment.analytics.kotlin.core.platform.policies.FrequencyFlushPolicy
13- import com.segment.analytics.kotlin.destinations. consent.ConsentManager
14- import com.segment.analytics.kotlin.destinations. consent.onetrust.OneTrustConsentCategoryProvider
13+ import com.segment.analytics.kotlin.consent.ConsentManager
14+ import com.segment.analytics.kotlin.consent.onetrust.OneTrustConsentCategoryProvider
1515import org.json.JSONException
1616import org.json.JSONObject
1717import sovran.kotlin.SynchronousStore
@@ -81,6 +81,15 @@ class MainApplication : Application() {
8181
8282 analytics.add(consentPlugin)
8383
84+ // This is commented out because before we start allowing events to flow
85+ // we want to make sure that our CMP OneTrust has started and we're able
86+ // to get the current consent settings from it.
87+ //
88+ // See below where we call this function inside the OneTrust success
89+ // callback.
90+ //
91+ // consentPlugin.start()
92+
8493 otPublishersHeadlessSDK.startSDK(
8594 DOMAIN_URL ,
8695 DOMAIN_ID ,
@@ -91,11 +100,11 @@ class MainApplication : Application() {
91100 override fun onSuccess (otSuccessResponse : OTResponse ) {
92101 // do logic to render UI getOTSDKData();
93102 val otData =
94- MainApplication . otPublishersHeadlessSDK.bannerData.toString()
103+ otPublishersHeadlessSDK.bannerData.toString()
95104 Log .d(TAG , " OT onSuccess: otData: $otData " )
96105
97106 val categories =
98- getGroupIds(MainApplication . otPublishersHeadlessSDK.domainGroupData)
107+ getGroupIds(otPublishersHeadlessSDK.domainGroupData)
99108
100109 Log .d(TAG , " Setting up Analytics with categories: ${categories} " )
101110 consentCategoryProvider.setCategoryList(categories)
0 commit comments