# Usage

# Pinch

Tip

It is recommended that you set the SDK to test mode while developing. This will allow both you and us to verify that everything is integrated correctly. This setting persists until the application is removed from the manifest. Please note that test-mode interferes with the built-in privacy aggregator for location by sending GPS coordinates.

Add this within the <application> element in AndroidManifest.xml to enable test mode:

  <meta-data
    android:name="com.fluxloop.pinch.sdk.PRODUCTION_MODE"
    android:value="false"/>
1
2
3

# Available consents

Pinch.Consent.SURVEYS
Pinch.Consent.ANALYTICS
Pinch.Consent.CAMPAIGNS
Pinch.Consent.ADS
1
2
3
4

# Granting consents

# Revoking consents

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

# Retrieve granted consents

# Start SDK

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

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.

# Retrieve SDK status

You can check if the SDK is started by calling:

# Send demographic profile

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

# Send custom data

WARNING

This function only accepts stringified json. If anything else is supplied, a swallowed exception will be thrown.

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

# Send metadata

WARNING

This function only accepts stringified json. If anything else is supplied, a swallowed exception will be thrown.

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:

# 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:

# Retrieve privacy terms URL

The URL for privacy terms can be retrieved by calling:

# Retrieve privacy dashboard URL

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

# 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 an optional closure to verify if the request was successfully sent.

# Pinch Messaging Center

# Retrieve messages

Retrieve incoming messages to user from Pinch.

Note

All fields in PinchMessage except created, expiry and opened is nullable.

# Pinch Motion Tracking

# Start tracking motion

Minimum SDK version: 2.5.0

Add the following permission to your applications manifest: <uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION"/>

If your application targets Android 9 (API level 28) or lower, the system will auto-grant the required permission as long as the permission line is present in manifest. If you're application targets an API level higher than 28, you need to explicity request Manifest.permission.ACTIVITY_RECOGNITION during onboarding. If this doesn't work, you may have to explicitly request com.google.android.gms.permission.ACTIVITY_RECOGNITION instead.

Pinch makes motion tracking accessible through a provider, which can be started by calling: