Teemo
Teemo requires a specific configuration of the Didomi SDK and will validate the integration before you can go live with the GeolocStation SDK.
This guide will walk you through the configuration requirements to collect consent for Teemo in your mobile app.
Make sure that the Didomi SDK is already setup before configuring it specifically for Teemo. Read our Setup - Android and Setup - iOS sections for more information.

1. Enable the Teemo vendor

While Teemo is an IAB-registered vendor, they require extra (non-IAB) purposes to be able to operate. The purposes are the following:
    Geolocation for advertising: Storage and access to geolocation information for targeted advertising purposes
    Geolocation for analytics: Storage and access to geolocation information to carry out marketing studies
To enable those purposes, you will need to enable the Teemo vendor as part of the app.vendors.didomi property:
didomi_config.json
1
{
2
"app": {
3
"vendors": {
4
"didomi": [
5
"teemo"
6
]
7
}
8
}
9
}
Copied!
It is required to enable Teemo this way and not only as an IAB vendor.

2. Collect consent with the Preferences pop-in

Teemo requires you to show the full Preferences pop-in with the full list of purposes when collecting consent. This allows the user to see all the purposes that they are giving consent to and make more granular choices. You cannot use a consent notice (banner or pop-in) when collecting consent for Teemo.
To enable that behavior and disable the consent notice, update your configuration:
didomi_config.json
1
{
2
"app": {
3
"vendors": {
4
"didomi": [
5
"teemo"
6
]
7
}
8
},
9
"notice": {
10
"enable": false
11
},
12
"preferences": {
13
"showWhenConsentIsMissing": true,
14
"canCloseWhenConsentIsMissing": false
15
}
16
}
Copied!
When consent needs to be collected, our Preferences pop-in will be automatically displayed instead of a notice:

3. Pass the consent status to the GeolocStation SDK

The last step is to pass the consent status of the user to the GeolocStation SDK by calling the GeolocStationConsent.setConsents function.
The function needs to be called in two cases:
    When the app gets loaded to share the initial consent status of the user with the GeolocStation SDK. Use the didomi.onReady function to register an event listener when the Didomi SDK is ready and pass the consent status to GeolocStation.
    Whenever the user consent status changes. Use the didomi.addEventListener function to register an event listener that gets called when the user consent status changes and pass the consent status to GeolocStation.
Java - Activity.java
1
import android.support.annotation.NonNull;
2
import android.support.v7.app.AppCompatActivity;
3
import android.os.Bundle;
4
5
import com.geolocstation.GeolocStation;
6
import com.geolocstation.consent.GeolocStationConsent;
7
import io.didomi.sdk.Didomi;
8
9
public class Activity extends AppCompatActivity {
10
private Didomi didomi = Didomi.getInstance();
11
12
@Override
13
protected void onCreate(Bundle savedInstanceState) {
14
super.onCreate(savedInstanceState);
15
setContentView(R.layout.activity_main);
16
17
GeolocStation.requestLocationPermission(this);
18
19
try {
20
// Setup Didomi
21
didomi.setupUI(this);
22
didomi.onReady(() -> {
23
Log.d("DIDOMI", "Didomi SDK is ready");
24
25
// Pass the user consent status to GeolocStation when the app is launched
26
setGeolocStationSdkConsents();
27
28
didomi.addEventListener(new EventListener() {
29
@Override
30
public void consentChanged(ConsentChangedEvent event) {
31
// Pass the user consent status to GeolocStation when the user consent status changes
32
setGeolocStationSdkConsents();
33
}
34
});
35
});
36
} catch (Exception e) {
37
Log.d("DIDOMI", Log.getStackTraceString(e));
38
}
39
}
40
41
@Override
42
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
43
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
44
GeolocStation.onRequestPermissionsResult(this);
45
}
46
47
/**
48
* Pass the user consent status to GeolocStation
49
*/
50
public void setGeolocStationSdkConsents() {
51
Boolean consentStatusForTeemo = didomi.getUserConsentStatusForVendor("teemo");
52
53
if(consentStatusForTeemo ) {
54
Boolean advertising = didomi.getUserConsentStatusForPurpose("geolocation_for_advertising");
55
Boolean analytics = didomi.getUserConsentStatusForPurpose("geolocation_for_analytics");
56
57
GeolocStationConsent.setConsents(this.getApplicationContext(),
58
advertising != null ? advertising : false,
59
analytics != null ? analytics : false);
60
} else {
61
GeolocStationConsent.setConsents(this.getApplicationContext(), false, false);
62
}
63
}
64
}
Copied!
Last modified 2yr ago