What you will learn

This tutorial will teach you:

  • the consequence of the GDPR on the SDK
  • how to use the sdk built-in methods to make it compliant with the GDPR.

Consequences of the GDPR

The consequences of the GDPR are at the analytics level for the SDK. Indeed, the SDK generates analytics, which includes personal data:

  • the phoneId on Android or the identifierForVendor (IDFV) on iOs
  • locations data

To be compliant with the GDPR, the SDK must receive an explicit opt-in from the user to be authorized to collect these information.

As consequences:

  • When the opt-in has never been updated, the SDK queues the analytics until getting the opt-ins to treat them
  • When the opt-in is denied, The SDK will:
    • remove these personal data from the analytics sent to Herow
    • avoid to send analytics that are not relevant without the user information

Opt-ins available

The SDK comes with two opt-ins:

  • the USER_DATA opt-in:
    • mandatory by the GDPR
    • authorizes the SDK to collect the IDFV and the location data of the user.
    • set as default to false
  • the STATUS opt-in:
    • not required by the GDPR
    • authorizes the SDK to collect various analytics, which allows to determine if the SDK can correctly run on the device and if so, runs correctly on the device.
    • set as default to true

Manage the opt-ins

The SDK comes with several methods to help you to manage the opt-ins.

Step 1: Test if the opt-ins have been given

The method optinsNeverAsked from the HerowInitializer return true if the opt-ins have never been asked.

In that case, ask the user the permission to collect his personal data (IDFV and location data) explaining that you collect them for [...your reasons...]

Switch to Swift

if ([herowInitializer optinsNeverAsked]) {

}
if herowInitializer.optinsNeverAsked() {

}

Step 2: Update the opt-ins permission

The method updateOptin from the HerowInitializer allow to update the optin permission.

Switch to Swift

[herowInitializer updateOptin:OptinUSER_DATA permission:true];
herowInitializer.updateOptin(.USER_DATA, permission: true)

Step 3: notify the SDK about the opt-ins permission update

Once, all the opt-ins have been updated, you must notify the SDK about it calling allOptinsAreUpdated from the HerowInitializer.

Switch to Swift

[herowInitializer allOptinsAreUpdated];
herowInitializer.allOptinsAreUpdated()

Calling this method launches:

  • the remote synchronization of the opt-ins with the Herow Platform.
  • the analytics treatment depending on the opt-ins

Note 1:

If the user is off-line, or the synchronization with the Herow Platform meets an error, the SDK will automatically retry to synchronize the opt-ins with the Herow Platform later on.

Note 2:

Keep in mind that the user can update the opt-ins at any time. Always think to call the method allOptinsAreUpdated when the opt-ins have been updated.

Step 4: check the status of the opt-ins

Use the method isOptinAuthorized from the HerowInitializer to check the status of an opt-in.

Switch to Swift

[herowInitializer isOptinAuthorized:OptinUSER_DATA];
herowInitializer.isOptinAuthorized(.USER_DATA)