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.
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:Custom JSON configuration
{
"app": {
"vendors": {
"didomi": [
"teemo"
]
}
}
}
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
{
"app": {
"vendors": {
"didomi": [
"teemo"
]
}
},
"notice": {
"enable": false
},
"preferences": {
"showWhenConsentIsMissing": true,
"canCloseWhenConsentIsMissing": false
}
}
When consent needs to be collected, our Preferences pop-in will be automatically displayed instead of a notice:
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
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.geolocstation.GeolocStation;
import com.geolocstation.consent.GeolocStationConsent;
import io.didomi.sdk.Didomi;
public class Activity extends AppCompatActivity {
private Didomi didomi = Didomi.getInstance();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
GeolocStation.requestLocationPermission(this);
try {
// Setup Didomi
didomi.setupUI(this);
didomi.onReady(() -> {
Log.d("DIDOMI", "Didomi SDK is ready");
// Pass the user consent status to GeolocStation when the app is launched
setGeolocStationSdkConsents();
didomi.addEventListener(new EventListener() {
@Override
public void consentChanged(ConsentChangedEvent event) {
// Pass the user consent status to GeolocStation when the user consent status changes
setGeolocStationSdkConsents();
}
});
});
} catch (Exception e) {
Log.d("DIDOMI", Log.getStackTraceString(e));
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
GeolocStation.onRequestPermissionsResult(this);
}
/**
* Pass the user consent status to GeolocStation
*/
public void setGeolocStationSdkConsents() {
Boolean consentStatusForTeemo = didomi.getUserConsentStatusForVendor("teemo");
if(consentStatusForTeemo ) {
Boolean advertising = didomi.getUserConsentStatusForPurpose("geolocation_for_advertising");
Boolean analytics = didomi.getUserConsentStatusForPurpose("geolocation_for_analytics");
GeolocStationConsent.setConsents(this.getApplicationContext(),
advertising != null ? advertising : false,
analytics != null ? analytics : false);
} else {
GeolocStationConsent.setConsents(this.getApplicationContext(), false, false);
}
}
}
Last modified 9mo ago