User privacy is a central concern of Inloco. Regulations such as the General Data Protection Regulation (GDPR) require application developers to ask for permission before collecting user data. Inloco SDK provides a mechanism to handle this in a user friendly way.
The Inloco SDK provides a way to delay data collection until the user has given privacy consent.
To wait for the user's privacy consent, you must set privacyConsentRequired
to YES
on the InLocoOptions.plist
file. By doing this, the SDK will be initialized without data collection.
To check if a given set of consents has been explicitly set, the following method can be used. If the consents are missing, it is necessary to show the privacy policy to the user explaining why those consent types are needed and what benefits are available with the granted consents.
/**Returns through a block a Object containing the informations bellow:- isWaitingConsent: Return true if any consent has not been settled, and false if all consents are either GIVEN or DENIED- areAllConsentTypesGiven: Return true if all requested consents were given, otherwise returns false- hasFinished: If the operation has finished or was incomplete due to any error that occurred. Returns true if the operation has finished and false if any exception was thrown in the process.*/ILMInLoco.checkConsent(forTypes: [ILM_CONSENT_TYPE_CONTEXT_PROVIDER,ILM_CONSENT_TYPE_ENGAGE,ILM_CONSENT_TYPE_EVENTS,ILM_CONSENT_TYPE_LOCATION,]) { (result: ILMConsentResult?) inguard let result = result else {// Some error occurred during the process and the operation could not be finishedprint("Error")return}if !result.hasFinished() {// Some error occurred during the process and the operation could not be finishedprint("Error")} else if result.areAllConsentTypesGiven() {// All consents passed as parameters have been previously accepted by the userprint("Success!")} else {// At least one consent passed as parameter was denied by the userprint("Success, but user denied.")}}
/**Returns through a block a Object containing the informations bellow:- isWaitingConsent: Return true if any consent has not been settled, and false if all consents are either GIVEN or DENIED- areAllConsentTypesGiven: Return true if all requested consents were given, otherwise returns false- hasFinished: If the operation has finished or was incomplete due to any error that occurred. Returns true if the operation has finished and false if any exception was thrown in the process.*/[ILMInLoco checkConsentForTypes:[NSSet setWithArray: @[ILM_CONSENT_TYPE_CONTEXT_PROVIDER,ILM_CONSENT_TYPE_ENGAGE,ILM_CONSENT_TYPE_EVENTS,ILM_CONSENT_TYPE_LOCATION]] withBlock:^(ILMConsentResult *result){if (result) {if (![result hasFinished]) {//Some error occurred during the process and the operation could not be finishedNSLog(@"Error");} else if ([result areAllConsentTypesGiven]) {// All consents passed as parameters have been previously accepted by the userNSLog(@"Success!");} else {// At least one consent passed as parameter was denied by the userNSLog(@"Success, but user denied.");}}}];
After the user agrees to the privacy policy, one of the following methods must be called to allow or deny the SDK to begin collecting data:
Request privacy consent using Inloco's customized dialog
​🧠Note: This is a consent dialog provided by Inloco but you can use your own consent dialog if you want.
The SDK provides a method that presents to the user a customized Dialog for consent request. If the user allows it, it will give the privacy consent for the consent types present on the given parameters. Otherwise, it will deny consent for the given consent types.
The dialog will appear only if the SDK is waiting for the user consent.
let consentTypes: Set = [ILM_CONSENT_TYPE_CONTEXT_PROVIDER,ILM_CONSENT_TYPE_ENGAGE,ILM_CONSENT_TYPE_EVENTS,ILM_CONSENT_TYPE_LOCATION]let builder = ILMConsentDialogOptionsBuilder()builder.title = "title text"builder.message = "message text"builder.acceptText = "accept text"builder.denyText = "refuse text"builder.consentTypes = consentTypeslet dialogOptions = builder.build(nil)ILMInLoco.requestPrivacyConsent(with: dialogOptions) { (result: ILMConsentResult?) inguard let result = result else {// Some error occurred during the process and the operation could not be finishedprint("Error")return}if !result.hasFinished() {// Some error occurred during the process and the operation could not be finishedprint("Error")} else if result.areAllConsentTypesGiven() {// The dialog was shown and the consent was givenprint("Success!")} else {// The dialog was shown but the consent was deniedprint("Success, but user denied.")}}
ILMConsentDialogOptions *dialogOptions = [[ILMConsentDialogOptions alloc] init];[dialogOptions setTitle:@"title text"];[dialogOptions setMessage:@"message text"];[dialogOptions setAcceptText:@"accept text"];[dialogOptions setDenyText:@"deny text"];[dialogOptions setConsentTypes:[NSSet setWithArray: @[ILM_CONSENT_TYPE_CONTEXT_PROVIDER,ILM_CONSENT_TYPE_ENGAGE,ILM_CONSENT_TYPE_EVENTS,ILM_CONSENT_TYPE_LOCATION]]];[ILMInLoco requestPrivacyConsentWithOptions:dialogOptionsandConsentBlock:^(ILMConsentResult *result){NSLog(@"Operation has finished?: %d", [result hasFinished]);NSLog(@"Are all consent types given?: %d", [result areAllConsentTypesGiven]);NSLog(@"Is missing consent?: %d", [result isWaitingConsent]);}];
allowConsentTypes
This method allows consent for the functionality types specified in the array. It should be used to enable functionalities in case the user has not given consent in the previous dialog.
// This call should be made in your code after the user has given privacy consentILMInLoco.allowConsentTypes([ILM_CONSENT_TYPE_CONTEXT_PROVIDER,ILM_CONSENT_TYPE_ENGAGE,ILM_CONSENT_TYPE_EVENTS,ILM_CONSENT_TYPE_LOCATION])
// This call should be made in your code after the user has given privacy consent[ILMInLoco allowConsentTypes:[NSSet setWithArray: @[ILM_CONSENT_TYPE_CONTEXT_PROVIDER,ILM_CONSENT_TYPE_ENGAGE,ILM_CONSENT_TYPE_EVENTS,ILM_CONSENT_TYPE_LOCATION]]];
setAllowedConsentTypes
This method is similar to calling [ILMInLoco allowConsentTypes:]
but all other predefined consent types not present in the array are considered denied by the user.
// This call should be made in your code after the user has given privacy consentILMInLoco.setAllowedConsentTypes([ILM_CONSENT_TYPE_CONTEXT_PROVIDER,ILM_CONSENT_TYPE_ENGAGE,ILM_CONSENT_TYPE_EVENTS,ILM_CONSENT_TYPE_LOCATION])
// This call should be made in your code after the user has given privacy consent[ILMInLoco setAllowedConsentTypes:[NSSet setWithArray: @[ILM_CONSENT_TYPE_CONTEXT_PROVIDER,ILM_CONSENT_TYPE_ENGAGE,ILM_CONSENT_TYPE_EVENTS,ILM_CONSENT_TYPE_LOCATION]]];
The privacy consent setting is persisted and requestPrivacyConsentWithOptions
or setAllowedConsentTypes
can be called just once. If the privacy consent is given, the following SDK initializations will start with data collection enabled.
Name | Description | Plan |
ILM_CONSENT_TYPE_LOCATION | Enables the collection of location data from users. | Free |
ILM_CONSENT_TYPE_ENGAGE | Enables the usage of location data to send push notifications. | Free, Pro |
ILM_CONSENT_TYPE_CONTEXT_PROVIDER | Enables the context data delivery for engagement actions or analysis. | Enterprise |
If you wish to use all or none of them, you can use one of the following variables:
Name | Description |
ILM_CONSENT_SET_ALL | Enable all consent types. |
ILM_CONSENT_SET_NONE | Disable all consent types. |
​🧠Note: It is important to notice that without data collection, features won't be enabled for the user. For example, it won't be possible to send localized push notifications without location data.
​🚧Attention: The default value of inloco_privacy_consent_required
is false. It means that not setting this property will make the SDK start data collection right away and you need to ask the user consent through your app's Privacy Policy. In following SDK versions, this setting will be removed and consent will be always required.
It is also possible for the user to revoke a privacy consent previously given. When this happens, you should call denyConsentTypes
.
// This call should be made in your code after the user has revoked a previously given privacy consentILMInLoco.denyConsentTypes([ILM_CONSENT_TYPE_CONTEXT_PROVIDER,ILM_CONSENT_TYPE_ENGAGE,ILM_CONSENT_TYPE_EVENTS,ILM_CONSENT_TYPE_LOCATION])
// This call should be made in your code after the user has revoked a previously given privacy consent[ILMInLoco denyConsentTypes:[NSSet setWithArray: @[ILM_CONSENT_TYPE_CONTEXT_PROVIDER,ILM_CONSENT_TYPE_ENGAGE,ILM_CONSENT_TYPE_EVENTS,ILM_CONSENT_TYPE_LOCATION]]];