tiki_sdk_flutter library Null safety

The TIKI SDK for Flutter.

This SDK works as a wrapper for TikiSdk, defining specific implementations for Android and iOS.

How to use

Use TikiSdkFlutterBuilder to initialize the SDK.

API Reference

TikiSdkDataTypeEnum

The type of data to which the ownership refers.

  • data_point A specific and single ocurrence of a data.
  • data_pool A pool of data from different ocurrences.
  • data_stream A continuous stream of data.

TikiSdkDestination

The destination to which the data is consented to be used. It is composed by uses and paths. To allow all the constant is TikiSdkDestination.all(). To block all use TikiSdkDestination.none().

uses

An optional list of application specific uses cases applicable to the given destination.

Prefix with NOT to invert. i.e. NOT ads.

paths

A list of paths, preferably URL without the scheme or reverse FQDN. Keep list short and use wildcard () matching. Prefix with NOT to invert. _i.e. NOT mytiki.com/

WildCards

Wildcards are allowed in paths and uses using *. To allow all uses, use a single item list with *. To block all uses, create an empty list.

Assign Ownership

String ownershipId = sdk.assignOwnership(source, type, contains, origin: origin);

Assign ownership to a given source : data point, pool, or stream.
The types describe the various types of data represented by the referenced data.
Optionally, the origin can be overridden for the specific ownership grant.

ConsentModel consent = sdk.modifyConsent(
  ownershipId, destination, about: about, reward: reward, expiry: expiry);

The consent is always given by overriding the previous consent. It is up to the implementer to verify the prior consent and modify it if necessary.

ConsentModel consent = sdk. getConsent(source, origin: origin);

Get the latest consent given for the source. The origin is optional and defaults to the one used in SDK builder.

ConsentModel consent = sdk.modifyConsent(ownershipId, TikiSdkDestination.none());

To revoke a given consent, use the constant TikiSdkDestition.none().

Function request = () => print('ok');
Function onBlocked = () => print('blocked');
sdk.applyConsent(source, destination, request, onBlocked: onBlocked);

Runs a request if the consent was given for a specific source and destination. If the consent was not given, onBlocked is executed.

Classes

TikiSdkFlutter