# Usage

# Pinch

Note

References to PinchSDK can be imported with: using PinchSDK.

# Available consents

PinchX.ConsentSurveys
PinchX.ConsentAnalytics
PinchX.ConsentCampaigns
PinchX.ConsentAds
Copied to clipboard
1
2
3
4

# Granting consents

var consents = new NSNumber[]
{
    new NSNumber(PinchX.ConsentAnalytics),
    new NSNumber(PinchX.ConsentSurveys)
};

PinchX.GrantWithConsents(consents, (success) => { });
Copied to clipboard
1
2
3
4
5
6
7

# Revoking consents

Revoking a consent requires an active network connection. The revoke method accepts an optional closure which returns if the given consents were successfully revoked.

var consents = new NSNumber[]
{
    new NSNumber(PinchX.ConsentAnalytics),
    new NSNumber(PinchX.ConsentSurveys)
};

PinchX.RevokeWithConsents(consents, (success) => { });
Copied to clipboard
1
2
3
4
5
6
7

# Requesting bluetooth permission

A convenience method to trigger bluetooth permission dialog is provided:

PinchX.RequestBluetoothPermission();
Copied to clipboard
1

# Retrieve granted consents

var consents = PinchX.GrantedConsents;
Copied to clipboard
1

# Set IDFA/ADID

IDFA/ADID can be passed to PinchSDK by calling:

PinchX.Adid = new NSUuid();
Copied to clipboard
1

# Start SDK

An overloaded method accepts a list of providers to use for collection data.

// Start location & bluetooth
PinchX.Start();

// Start location
PinchX.StartLocationProvider();

// Start bluetooth
PinchX.StartBluetoothProvider();
Copied to clipboard
1
2
3
4
5
6
7
8

Note

The SDK will remember that it has been started, and subsequent calls to is unneccessary. If user clears or deletes app data, start has to be called again.

# Stop SDK

An overloaded method accepts a list of providers to disable for collecting data. If all previously granted providers are removed, SDK will be stopped.

// Stop location & bluetooth
PinchX.Stop();

// Stop location
PinchX.StopLocationProvider();

// Stop bluetooth
PinchX.StopBluetoothProvider();
Copied to clipboard
1
2
3
4
5
6
7
8

# Retrieve SDK status

You can check if the SDK is started by calling:

PinchX.IsTracking((isStarted) => { });
Copied to clipboard
1

# Send demographic profile

You can send your users demographic profile to the Pinch Platform by calling:

// 0 = Unknown
// 1 = Male
// 2 = Female
PinchX.SendDemographicProfileWithBirthYear(1995, 1, (success) => { });
Copied to clipboard
1
2
3
4

# Send custom data

You can send custom data to the Pinch Platform by calling:

var payload = new NSDictionary(
    new NSString("ticketType"), new NSString("regular"),
    new NSString("paymentMethod"), new NSString("visa")
);

PinchX.AddCustomDataWithType("Purchase", payload, (success) => { });
Copied to clipboard
1
2
3
4
5
6

# Send metadata

Note

This method performs a PUT request, replacing any previous values sent with the same type.

You can send metadata to the Pinch Platform by calling:

var payload = new NSDictionary(
    new NSString("name"), new NSString("Harald Blåtann")
);

PinchX.SetMetadataWithType("UserInfo", payload, (success) => { });
Copied to clipboard
1
2
3
4
5

# Push tokens

MessagingId is the ID used by the Pinch Platform for sending notifications to the device (eg. FCM registration id). This can be done by calling:

PinchX.MessagingId = "<token>";
Copied to clipboard
1

# Retrieve privacy dashboard URL

The URL for the privacy dashboard, which contains all collected data for given consent, can be retrieved by calling:

var privacyDashboardUrl = PinchX.PrivaryDashboardUrl;
Copied to clipboard
1

# Deleted collected PII & data

You can delete all PII and collected data about a user by calling this method. It requires an active internet connection and accepts a lambda expression to verify if the request was successfully sent.

PinchX.DeleteCollectedDataOnSuccess((success) => { });
Copied to clipboard
1