Skip to main content

Usage

Kettle​

Consents​

KTLConsent.Surveys
KTLConsent.Analytics
KTLConsent.Campaigns
KTLConsent.Ads

Granting consents​

Defines what the data collected from the user can be used for.

var consents = new[] {
KTLConsent.Surveys,
KTLConsent.Analytics,
KTLConsent.Campaigns,
KTLConsent.Ads
}.Select(
consent => NSNumber.FromUnsignedLong((System.nuint)(long) consent)
).ToArray();

KTLKettle.Shared.Grant(consents);

Revoking consents​

Removes previously granted user consent.

var consents = new[] {
KTLConsent.Surveys,
KTLConsent.Analytics,
KTLConsent.Campaigns,
KTLConsent.Ads
}.Select(
consent => NSNumber.FromUnsignedLong((System.nuint)(long) consent)
).ToArray();

KTLKettle.Shared.Revoke(consents);

Retrieve granted consents​

Returns an array containing the consents granted to Kettle.

NSNumber[] consents = Kettle.Shared.Obj_grantedConsents

Start Kettle​

Starts collecting data for given modules.

var modules = new[] {
KTLModule.Bluetooth,
KTLModule.Activity,
KTLModule.Location
}.Select(
module => NSNumber.FromUnsignedLong((System.nuint)(long) module)
).ToArray();

KTLKettle.Shared.Start(modules);

Stop Kettle​

Stops collecting data from given modules.

var modules = new[] {
KTLModule.Bluetooth,
KTLModule.Activity,
KTLModule.Location
}.Select(
module => NSNumber.FromUnsignedLong((System.nuint)(long) module)
).ToArray();

KTLKettle.Shared.Stop(modules);

Retrieve SDK status​

Returns true if Kettle is currently enabled and collecting data.

var kettleStarted = KTLKettle.Shared.Started;

Assign push token​

Forwards the users push token to Kettle, allowing it to send push notifications.

KTLKettle.Shared.PushToken = "<PUSH-TOKEN>";

Assign external identifier​

Forwards the users internal user ID to Kettle, allowing Kogenta to map your internal identifier with the users Kettle ID.

KTLKettle.Shared.ExternalId = "<EXTERNAL-IDENTIFIER>";

Kettle Identifier​

Returns the internal Kettle ID for the user.

var kettleId = KTLKettle.Shared.Identifier;

Privacy terms URL​

var privacyTermsUrl = KTLKettle.Shared.PrivacyTermsUrl;

Privacy dashboard URL​

The URL for the Kogenta Privacy Dashboard. This site can be used to view all data collected by Kettle, exporting data and request deletion of data.

var privacyDashboardUrl = KTLKettle.Shared.PrivacyDashboardUrl;

Delete collected PII & Data​

Calling this method will request deletion of all data collected by Kettle for the user. This method will delete all data currently residing on the device, as well as request deletion of data in cloud. It requires an active internet connection and accepts an optional closure that can be used to verify that the deletion request was successfully sent.

KTLKettle.Shared.DeleteCollectedDataOnSuccess(null);
// or
KTLKettle.Shared.DeleteCollectedDataOnSuccess((didRequestDeletion) => { });

Requesting bluetooth permission​

Convenience method to trigget bluetooth permission dialog.

KTLKettle.Shared.RequestBluetoothPermission();