{"id":19167355,"url":"https://github.com/affise/flutter-sdk","last_synced_at":"2025-02-22T23:23:41.822Z","repository":{"id":162087653,"uuid":"554133166","full_name":"affise/flutter-sdk","owner":"affise","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-11T13:03:19.000Z","size":2552,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-11T14:22:50.528Z","etag":null,"topics":["affise","cross-platform","flutter","flutter-plugin","metrics","mobile","sdk"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/affise.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-19T09:56:14.000Z","updated_at":"2025-02-11T13:03:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"78b2b2e4-c232-482c-b504-170900f3f5c1","html_url":"https://github.com/affise/flutter-sdk","commit_stats":null,"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/affise%2Fflutter-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/affise%2Fflutter-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/affise%2Fflutter-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/affise%2Fflutter-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/affise","download_url":"https://codeload.github.com/affise/flutter-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240247391,"owners_count":19771291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["affise","cross-platform","flutter","flutter-plugin","metrics","mobile","sdk"],"created_at":"2024-11-09T09:36:58.146Z","updated_at":"2025-02-22T23:23:41.796Z","avatar_url":"https://github.com/affise.png","language":"Dart","readme":"# Affise Attribution Flutter Library\n\n[Change Log](CHANGELOG.md)\n\n| Package                  |                         Version                          |\n|--------------------------|:--------------------------------------------------------:|\n| `affise_attribution_lib` | [`1.6.28`](https://github.com/affise/sdk-react/releases) |\n\n- [Affise Attribution Flutter Library](#affise-attribution-flutter-library)\n- [Description](#description)\n  - [Quick start](#quick-start)\n  - [Integration](#integration)\n    - [Integrate as dependency](#integrate-as-dependency)\n    - [Modules](#modules)\n      - [Android](#android)\n      - [iOS](#ios)\n      - [Module Advertising](#module-advertising)\n      - [Module Link](#module-link)\n      - [Module Status](#module-status)\n      - [Module Subscription](#module-subscription)\n        - [AffiseProductType](#affiseproducttype)\n    - [Initialize](#initialize)\n      - [Before application is published](#before-application-is-published)\n      - [Domain](#domain)\n    - [Requirements](#requirements)\n      - [Android](#android-1)\n      - [iOS](#ios-1)\n- [Features](#features)\n  - [ProviderType identifiers collection](#providertype-identifiers-collection)\n    - [Attribution](#attribution)\n    - [Advertising](#advertising)\n    - [Network](#network)\n    - [Phone](#phone)\n  - [Event send control](#event-send-control)\n  - [Events tracking](#events-tracking)\n  - [Custom events tracking](#custom-events-tracking)\n  - [Predefined event parameters](#predefined-event-parameters)\n    - [PredefinedString](#predefinedstring)\n    - [PredefinedLong](#predefinedlong)\n    - [PredefinedFloat](#predefinedfloat)\n    - [PredefinedObject](#predefinedobject)\n    - [PredefinedListObject](#predefinedlistobject)\n    - [PredefinedListString](#predefinedliststring)\n  - [Events buffering](#events-buffering)\n  - [Advertising Identifier (google) tracking](#advertising-identifier-google-tracking)\n  - [Open Advertising Identifier (huawei) tracking](#open-advertising-identifier-huawei-tracking)\n  - [Install referrer tracking](#install-referrer-tracking)\n  - [Push token tracking](#push-token-tracking)\n  - [Reinstall Uninstall tracking](#reinstall-uninstall-tracking)\n  - [APK preinstall tracking](#apk-preinstall-tracking)\n  - [Deeplinks](#deeplinks)\n    - [Android](#android-2)\n    - [iOS](#ios-2)\n  - [AppLinks](#applinks)\n    - [Android](#android-3)\n    - [iOS](#ios-3)\n  - [Offline mode](#offline-mode)\n  - [Disable tracking](#disable-tracking)\n  - [Disable background tracking](#disable-background-tracking)\n  - [Get random user Id](#get-random-user-id)\n  - [Get random device Id](#get-random-device-id)\n  - [Get providers](#get-providers)\n  - [Is first run](#is-first-run)\n  - [Get referrer](#get-referrer)\n  - [Get referrer value](#get-referrer-value)\n  - [Get referrer on server](#get-referrer-on-server)\n  - [Get referrer on server parameter](#get-referrer-on-server-parameter)\n  - [Referrer keys](#referrer-keys)\n  - [Get module state](#get-module-state)\n  - [Platform specific](#platform-specific)\n    - [GDPR right to be forgotten](#gdpr-right-to-be-forgotten)\n    - [StoreKit Ad Network](#storekit-ad-network)\n- [SDK to SDK integrations](#sdk-to-sdk-integrations)\n- [Debug](#debug)\n  - [Validate credentials](#validate-credentials)\n- [Troubleshoots](#troubleshoots)\n  - [iOS](#ios-4)\n\n# Description\n\nAffise SDK is a software you can use to collect app usage statistics, device identifiers, deeplink usage, track install\nreferrer.\n\n## Quick start\n\n## Integration\n\n### Integrate as dependency\n\nAdd [git](https://github.com/affise/flutter-sdk) dependency to `pubspec.yaml` in your flutter application\n\n```yaml\ndependencies:\n  flutter:\n    sdk: flutter\n\n  affise_attribution_lib:\n    git:\n      url: https://github.com/affise/flutter-sdk\n```\n\n### Modules\n\n```dart\nAffise.module.moduleStart(AffiseModules.ADVERTISING);\n```\n\nGet list of installed modules:\n\n```dart\nAffise.module.getModulesInstalled().then((modules) {\n  print(\"Modules: $modules\");\n});\n```\n\n#### Android\n\nAdd modules to android project\n\n| Module        | Version                                                                                                                                                                      | Start  |\n|---------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|\n| `ADVERTISING` | [![module-advertising](https://img.shields.io/maven-central/v/com.affise/module-advertising?label=latest)](https://mvnrepository.com/artifact/com.affise/module-advertising) | `Auto` |\n| `ANDROIDID`   | [![module-androidid](https://img.shields.io/maven-central/v/com.affise/module-androidid?label=latest)](https://mvnrepository.com/artifact/com.affise/module-androidid)       | `Auto` |\n| `LINK`        | [![module-link](https://img.shields.io/maven-central/v/com.affise/module-link?label=latest)](https://mvnrepository.com/artifact/com.affise/module-link)                      | `Auto` |\n| `NETWORK`     | [![module-network](https://img.shields.io/maven-central/v/com.affise/module-network?label=latest)](https://mvnrepository.com/artifact/com.affise/module-network)             | `Auto` |\n| `PHONE`       | [![module-phone](https://img.shields.io/maven-central/v/com.affise/module-phone?label=latest)](https://mvnrepository.com/artifact/com.affise/module-phone)                   | `Auto` |\n| `STATUS`      | [![module-status](https://img.shields.io/maven-central/v/com.affise/module-status?label=latest)](https://mvnrepository.com/artifact/com.affise/module-status)                | `Auto` |\n| `SUBSCRIPTION`      | [![module-status](https://img.shields.io/maven-central/v/com.affise/module-subscription?label=latest)](https://mvnrepository.com/artifact/com.affise/module-subscription)                | `Auto` |\n| `RUSTORE`      | [![module-rustore](https://img.shields.io/maven-central/v/com.affise/module-rustore?label=latest)](https://mvnrepository.com/artifact/com.affise/module-rustore)                | `Auto` |\n| `HUAWEI`      | [![module-rustore](https://img.shields.io/maven-central/v/com.affise/module-huawei?label=latest)](https://mvnrepository.com/artifact/com.affise/module-huawei)                | `Auto` |\n\nExample [`example/android/app/build.gradle`](example/android/app/build.gradle)\n\n```gradle\nfinal affise_version = '1.6.52'\n\ndependencies {\n    // Affise modules\n    implementation \"com.affise:module-advertising:$affise_version\"\n    implementation \"com.affise:module-androidid:$affise_version\"\n    implementation \"com.affise:module-link:$affise_version\"\n    implementation \"com.affise:module-network:$affise_version\"\n    implementation \"com.affise:module-phone:$affise_version\"\n    implementation \"com.affise:module-status:$affise_version\"\n    implementation \"com.affise:module-subscription:$affise_version\"\n    // implementation \"com.affise:module-rustore:$affise_version\"\n    // implementation \"com.affise:module-huawei:$affise_version\"\n}\n```\n\n#### iOS\n\nAdd modules to iOS project\n\n| Module         |                                       Version                                        | Start    |\n|----------------|:------------------------------------------------------------------------------------:|----------|\n| `ADVERTISING`  | [`1.6.43`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Manual` |\n| `LINK`         | [`1.6.43`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto`   |\n| `STATUS`       | [`1.6.43`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto`   |\n| `SUBSCRIPTION` | [`1.6.43`](https://github.com/CocoaPods/Specs/tree/master/Specs/0/3/d/AffiseModule/) | `Auto`   |\n\nExample [example/ios/Podfile](example/ios/Podfile)\n\n```ruby\ntarget 'Runner' do\n  # ...\n  \n  # Affise Modules\n  pod 'AffiseModule/Advertising', `1.6.43`\n  pod 'AffiseModule/Link', `1.6.43`\n  pod 'AffiseModule/Status', `1.6.43`\n  pod 'AffiseModule/Subscription', `1.6.43`\nend\n```\n\n#### Module Advertising\n\n`iOS`\n\nThis module required to Use [`IDFA`](https://developer.apple.com/documentation/adsupport/asidentifiermanager/advertisingidentifier) (Identifier for advertisers)\n\n\u003e **Warning**\n\u003e\n\u003e 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\u003e\n\u003e Module Advertising requires `NSUserTrackingUsageDescription` key in `info.plist`\n\u003e\n\u003e Application **will crash** if key not present\n\u003e\n\u003e 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\nOpen `info.plist` and add key `NSUserTrackingUsageDescription` with string value. For more information [read requirements](#requirements)\n\n#### Module Link\n\nReturn last url in chan of redirection\n\n🟥Support MAX 10 redirections🟥\n\n```dart\nAffise.module.linkResolve(\"SITE_WITH_REDIRECTION\", (redirectUrl) {  \n    // handle redirect url\n});\n```\n\n#### Module Status\n\n```dart\nAffise.module.getStatus(AffiseModules.STATUS, (response) {\n    // handle status response\n});\n```\n\n#### Module Subscription\n\nGet products by ids:\n\n```dart\nvar ids = [\"exampple.product.id_1\", \"exampple.product.id_2\"];\n\nAffise.module.fetchProducts(ids, (result) {\n  if (result.isSuccess) {\n    var value = result.asSuccess;\n    List\u003cAffiseProduct\u003e products = value.products;\n    List\u003cString\u003e invalidIds = value.invalidIds;\n  } else {\n    String error = result.asFailure;\n  }\n});\n```\n\nPurchase product:\n\n```dart\n// Specify product type for correct affise event\nAffise.module.purchase(product, AffiseProductType.CONSUMABLE, (result) {\n  if (result.isSuccess) {\n    AffisePurchasedInfo purchasedInfo = result.asSuccess;\n  } else {\n    String error = result.asFailure;\n  }\n});\n```\n\n##### AffiseProductType\n\n- `CONSUMABLE`\n- `NON_CONSUMABLE`\n- `RENEWABLE_SUBSCRIPTION`\n- `NON_RENEWABLE_SUBSCRIPTION`\n\n### Initialize\n\nAfter dependency is added, sync project with `flutter pub get` and initialize.\n\n\u003e Demo app [`main.dart`](example/lib/main.dart)\n\n```dart\nimport 'package:flutter/foundation.dart';\nimport 'package:affise_attribution_lib/affise.dart';\n\nclass _MyAppState extends State\u003cMyApp\u003e {\n  @override\n  void initState() {\n    super.initState();\n\n    Affise\n      .settings(\n        affiseAppId: \"Your appId\", //Change to your app id\n        secretKey: \"Your SDK secretKey\", //Change to your SDK secretKey\n      )\n      .start(); // Start Affise SDK\n  }\n}\n```\n\nCheck if library is initialized\n\n```dart\nAffise.isInitialized();\n```\n\n#### Before application is published\n\n\u003e **Warning**\n\u003e\n\u003e 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\u003e\n\u003e Please make sure your credentials are valid\n\u003e\n\u003e Visit section [validation credentials](#validate-credentials)\n\u003e\n\u003e 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\n#### Domain\n\nSet SDK server domain:\n\n```dart\nAffise\n  .settings(\n    affiseAppId: \"Your appId\", \n    secretKey: \"Your SDK secretKey\",\n  )\n  .setProduction(false)\n  .setDomain(\"https://YoureCustomDomain/\") // Set custom domain\n  .start(); // Start Affise SDK\n```\n\n### Requirements\n\n#### Android\n\nMinimal Android SDK version is 21\nExample [`example/android/app/build.gradle`](example/android/app/build.gradle)\n\n```groovy\nandroid {\n  defaultConfig {\n    minSdkVersion Math.max(flutter.minSdkVersion, 21)\n  }\n}\n```\n\nFor a minimal working functionality your app needs to declare internet permission:\n\n```xml\n\u003cmanifest\u003e\n    \u003cuses-permission android:name=\"android.permission.INTERNET\"/\u003e\n\u003c/manifest\u003e\n```\n\nOAID certificate in your project [`example/android/app/src/main/assets/oaid.cert.pem`](example/android/app/src/main/assets/oaid.cert.pem)\n\n#### iOS\n\nAffise SDK uses `AppTrackingTransparency` framework to get `advertisingIdentifier`\nFor working functionality your app needs to declare [`NSUserTrackingUsageDescription` permission](https://developer.apple.com/documentation/bundleresources/information_property_list/nsusertrackingusagedescription):\n\nOpen XCode project `info.plist` and add key `NSUserTrackingUsageDescription` with string value\n\nExample [`info.plist`](example/ios/Runner/Info.plist):\n\n```xml\n\u003cplist version=\"1.0\"\u003e\n\u003cdict\u003e\n    ...\n\t\u003ckey\u003eNSUserTrackingUsageDescription\u003c/key\u003e\n\t\u003cstring\u003eYoure permission text\u003c/string\u003e\n\u003c/dict\u003e\n```\n\n# Features\n\n## ProviderType identifiers collection\n\nTo match users with events and data library is sending, these `ProviderType` identifiers are collected:\n\n### Attribution\n\n- `AFFISE_APP_ID`\n- `AFFISE_PKG_APP_NAME`\n- `AFF_APP_NAME_DASHBOARD`\n- `APP_VERSION`\n- `APP_VERSION_RAW`\n- `STORE`\n- `TRACKER_TOKEN`\n- `TRACKER_NAME`\n- `FIRST_TRACKER_TOKEN`\n- `FIRST_TRACKER_NAME`\n- `LAST_TRACKER_TOKEN`\n- `LAST_TRACKER_NAME`\n- `OUTDATED_TRACKER_TOKEN`\n- `INSTALLED_TIME`\n- `FIRST_OPEN_TIME`\n- `INSTALLED_HOUR`\n- `FIRST_OPEN_HOUR`\n- `INSTALL_FIRST_EVENT`\n- `INSTALL_BEGIN_TIME`\n- `INSTALL_FINISH_TIME`\n- `REFERRER_INSTALL_VERSION`\n- `REFERRAL_TIME`\n- `REFERRER_CLICK_TIME`\n- `REFERRER_CLICK_TIME_SERVER`\n- `REFERRER_GOOGLE_PLAY_INSTANT`\n- `CREATED_TIME`\n- `CREATED_TIME_MILLI`\n- `CREATED_TIME_HOUR`\n- `UNINSTALL_TIME`\n- `REINSTALL_TIME`\n- `LAST_SESSION_TIME`\n- `CPU_TYPE`\n- `HARDWARE_NAME`\n- `DEVICE_MANUFACTURER`\n- `DEEPLINK_CLICK`\n- `DEVICE_ATLAS_ID`\n- `AFFISE_DEVICE_ID`\n- `AFFISE_ALT_DEVICE_ID`\n- `ANDROID_ID`\n- `ANDROID_ID_MD5`\n- `REFTOKEN`\n- `REFTOKENS`\n- `REFERRER`\n- `USER_AGENT`\n- `MCCODE`\n- `MNCODE`\n- `REGION`\n- `COUNTRY`\n- `LANGUAGE`\n- `DEVICE_NAME`\n- `DEVICE_TYPE`\n- `OS_NAME`\n- `PLATFORM`\n- `SDK_PLATFORM`\n- `API_LEVEL_OS`\n- `AFFISE_SDK_VERSION`\n- `OS_VERSION`\n- `RANDOM_USER_ID`\n- `AFFISE_SDK_POS`\n- `TIMEZONE_DEV`\n- `AFFISE_EVENT_NAME`\n- `AFFISE_EVENT_TOKEN`\n- `LAST_TIME_SESSION`\n- `TIME_SESSION`\n- `AFFISE_SESSION_COUNT`\n- `LIFETIME_SESSION_COUNT`\n- `AFFISE_DEEPLINK`\n- `AFFISE_PART_PARAM_NAME`\n- `AFFISE_PART_PARAM_NAME_TOKEN`\n- `AFFISE_APP_TOKEN`\n- `LABEL`\n- `AFFISE_SDK_SECRET_ID`\n- `UUID`\n- `AFFISE_APP_OPENED`\n- `PUSHTOKEN`\n- `AFFISE_EVENTS_COUNT`\n- `AFFISE_SDK_EVENTS_COUNT`\n- `AFFISE_METRICS_EVENTS_COUNT`\n- `AFFISE_INTERNAL_EVENTS_COUNT`\n- `IS_ROOTED`\n- `IS_EMULATOR`\n\n### Advertising\n\n- `GAID_ADID`\n- `GAID_ADID_MD5`\n- `OAID`\n- `OAID_MD5`\n- `ADID`\n- `ALTSTR_ADID`\n- `FIREOS_ADID`\n- `COLOROS_ADID`\n\n### Network\n\n- `MAC_SHA1`\n- `MAC_MD5`\n- `CONNECTION_TYPE`\n- `PROXY_IP_ADDRESS`\n\n### Phone\n\n- `NETWORK_TYPE`\n- `ISP`\n\n## Event send control\n\nThere are two ways to send events\n\n1. Cache event to later scheduled send in batch\n\n```dart\nAddToCartEvent()\n    .send();\n```\n\n2. Send event right now\n\n```dart\nAddToCartEvent()\n    .sendNow(() {\n      // handle event send success\n    }, (status) {\n      // handle event send failed\n      // 🟥Warning🟥: event is NOT cached for later send\n    });\n```\n\n## Events tracking\n\nFor example, we want to track what items usually user adds to shopping cart. To send event first create it with\nfollowing code\n\n```dart\nimport 'package:affise_attribution_lib/affise.dart';\n\nclass Presenter {\n  void onUserAddsItemsToCart(String item) {\n    Map\u003cString, dynamic\u003e items = {\n      \"items\": \"cookies, potato, milk\",\n    };\n\n    AddToCartEvent(userData: \"groceries\")\n      .addPredefinedObject(PredefinedObject.CONTENT, items)\n      .send(); // Send event\n  }\n}\n```\n\nWith above example you can implement other events:\n\n- `AchieveLevel`\n- `AddPaymentInfo`\n- `AddToCart`\n- `AddToWishlist`\n- `AdRevenue`\n- `ClickAdv`\n- `CompleteRegistration`\n- `CompleteStream`\n- `CompleteTrial`\n- `CompleteTutorial`\n- `Contact`\n- `ContentItemsView`\n- `CustomizeProduct`\n- `DeepLinked`\n- `Donate`\n- `FindLocation`\n- `InitiateCheckout`\n- `InitiatePurchase`\n- `InitiateStream`\n- `Invite`\n- `LastAttributedTouch`\n- `Lead`\n- `ListView`\n- `Login`\n- `OpenedFromPushNotification`\n- `Order`\n- `OrderItemAdded`\n- `OrderItemRemove`\n- `OrderCancel`\n- `OrderReturnRequest`\n- `OrderReturnRequestCancel`\n- `Purchase`\n- `Rate`\n- `ReEngage`\n- `Reserve`\n- `Sales`\n- `Schedule`\n- `Search`\n- `Share`\n- `SpendCredits`\n- `StartRegistration`\n- `StartTrial`\n- `StartTutorial`\n- `SubmitApplication`\n- `Subscribe`\n- `TravelBooking`\n- `UnlockAchievement`\n- `Unsubscribe`\n- `Update`\n- `ViewAdv`\n- `ViewCart`\n- `ViewContent`\n- `ViewItem`\n- `ViewItems`\n- `InitialSubscription`\n- `InitialTrial`\n- `InitialOffer`\n- `ConvertedTrial`\n- `ConvertedOffer`\n- `TrialInRetry`\n- `OfferInRetry`\n- `SubscriptionInRetry`\n- `RenewedSubscription`\n- `FailedSubscriptionFromRetry`\n- `FailedOfferFromRetry`\n- `FailedTrialFromRetry`\n- `FailedSubscription`\n- `FailedOfferise`\n- `FailedTrial`\n- `ReactivatedSubscription`\n- `RenewedSubscriptionFromRetry`\n- `ConvertedOfferFromRetry`\n- `ConvertedTrialFromRetry`\n- `Unsubscription`\n\n## Custom events tracking\n\nUse any of custom events if default doesn't fit your scenario:\n\n- `CustomId01Event`\n- `CustomId02Event`\n- `CustomId03Event`\n- `CustomId04Event`\n- `CustomId05Event`\n- `CustomId06Event`\n- `CustomId07Event`\n- `CustomId08Event`\n- `CustomId09Event`\n- `CustomId10Event`\n\nIf above event functionality still limits your usecase, you can use `UserCustomEvent`\n\n```dart\nUserCustomEvent(eventName: \"MyCustomEvent\")\n    .send(); \n```\n\n## Predefined event parameters\n\nTo enrich your event with another dimension, you can use predefined parameters for most common cases.\nAdd it to any event:\n\n```dart\nimport 'package:affise_attribution_lib/affise.dart';\n\nclass Presenter {\n  void onUserAddsItemsToCart(String item) {\n    Map\u003cString, dynamic\u003e items = {\n      \"items\": \"cookies, potato, milk\",\n    };\n\n    AddToCartEvent(\n      timeStampMillis: DateTime.now().millisecondsSinceEpoch,\n    )\n      .addPredefinedString(PredefinedString.DESCRIPTION, \"best before 2029\")\n      .addPredefinedObject(PredefinedObject.CONTENT, items)\n      .send(); // Send event\n  }\n}\n```\n\nIn examples above `PredefinedParameters.DESCRIPTION` and `PredefinedObject.CONTENT` is used, but many others is available:\n\n| PredefinedParameter                           | Type                                   | Event Method              |\n|-----------------------------------------------|----------------------------------------|---------------------------|\n| [PredefinedString](#predefinedstring)         | String                                 | addPredefinedString()     |\n| [PredefinedLong](#predefinedlong)             | int                                    | addPredefinedLong()       |\n| [PredefinedFloat](#predefinedfloat)           | double                                 | addPredefinedFloat()      |\n| [PredefinedObject](#predefinedobject)         | Map\u0026lt;String, dynamic\u0026gt;             | addPredefinedObject()     |\n| [PredefinedListObject](#predefinedlistobject) | List\u0026lt;Map\u0026lt;String, dynamic\u0026gt;\u0026gt; | addPredefinedListObject() |\n| [PredefinedListString](#predefinedliststring) | List\u0026lt;String\u0026gt;                     | addPredefinedListString() |\n\n### PredefinedString\n\n- `ACHIEVEMENT_ID`\n- `ADREV_AD_TYPE`\n- `BRAND`\n- `BRICK`\n- `CAMPAIGN_ID`\n- `CATALOGUE_ID`\n- `CHANNEL_TYPE`\n- `CITY`\n- `CLASS`\n- `CLICK_ID`\n- `CONTENT_ID`\n- `CONTENT_NAME`\n- `CONTENT_TYPE`\n- `CONVERSION_ID`\n- `COUNTRY`\n- `COUPON_CODE`\n- `CURRENCY`\n- `CUSTOMER_SEGMENT`\n- `CUSTOMER_TYPE`\n- `CUSTOMER_USER_ID`\n- `DEEP_LINK`\n- `DESCRIPTION`\n- `DESTINATION_A`\n- `DESTINATION_B`\n- `DESTINATION_LIST`\n- `EVENT_NAME`\n- `NEW_VERSION`\n- `NETWORK`\n- `OLD_VERSION`\n- `ORDER_ID`\n- `PARAM_01`\n- `PARAM_02`\n- `PARAM_03`\n- `PARAM_04`\n- `PARAM_05`\n- `PARAM_06`\n- `PARAM_07`\n- `PARAM_08`\n- `PARAM_09`\n- `PARAM_10`\n- `PAYMENT_INFO_AVAILABLE`\n- `PID`\n- `PLACEMENT`\n- `PREFERRED_NEIGHBORHOODS`\n- `PRODUCT_ID`\n- `PRODUCT_NAME`\n- `PURCHASE_CURRENCY`\n- `RECEIPT_ID`\n- `REGION`\n- `REGISTRATION_METHOD`\n- `REVIEW_TEXT`\n- `SEARCH_STRING`\n- `SEGMENT`\n- `SOURCE`\n- `STATUS`\n- `SUBSCRIPTION_ID`\n- `SUCCESS`\n- `SUGGESTED_DESTINATIONS`\n- `SUGGESTED_HOTELS`\n- `TUTORIAL_ID`\n- `UNIT`\n- `UTM_CAMPAIGN`\n- `UTM_MEDIUM`\n- `UTM_SOURCE`\n- `VALIDATED`\n- `VERTICAL`\n- `VIRTUAL_CURRENCY_NAME`\n- `VOUCHER_CODE`\n\n### PredefinedLong\n\n- `AMOUNT`\n- `DATE_A`\n- `DATE_B`\n- `DEPARTING_ARRIVAL_DATE`\n- `DEPARTING_DEPARTURE_DATE`\n- `HOTEL_SCORE`\n- `LEVEL`\n- `MAX_RATING_VALUE`\n- `NUM_ADULTS`\n- `NUM_CHILDREN`\n- `NUM_INFANTS`\n- `PREFERRED_NUM_STOPS`\n- `PREFERRED_STAR_RATINGS`\n- `QUANTITY`\n- `RATING_VALUE`\n- `RETURNING_ARRIVAL_DATE`\n- `RETURNING_DEPARTURE_DATE`\n- `SCORE`\n- `TRAVEL_START`\n- `TRAVEL_END`\n- `USER_SCORE`\n- `EVENT_START`\n- `EVENT_END`\n\n### PredefinedFloat\n\n- `PREFERRED_PRICE_RANGE`\n- `PRICE`\n- `REVENUE`\n- `LAT`\n- `LONG`\n\n### PredefinedObject\n\n- `CONTENT`\n\n### PredefinedListObject\n\n- `CONTENT_LIST`\n\n### PredefinedListString\n\n- `CONTENT_IDS`\n\n## Events buffering\n\nAffise library will send any pending events with first opportunity,\nbut if there is no network connection or device is disabled, events are kept locally for 7 days before deletion.\n\n## Advertising Identifier (google) tracking\n\nAdvertising Identifier (google) tracking is supported automatically, no actions needed\n\n## Open Advertising Identifier (huawei) tracking\n\nOpen Advertising Identifier is supported automatically, no actions needed\n\n## Install referrer tracking\n\nInstall referrer tracking is supported automatically, no actions needed\n\n## Push token tracking\n\nTo let affise track push token you need to receive it from your push service provider, and pass to Affise library.\nFirst add firebase integration to your app completing these steps: Firebase [iOS](https://firebase.google.com/docs/cloud-messaging/ios/client) or [Android](https://firebase.google.com/docs/cloud-messaging/android/client) Docs\n\nAfter you have done with firebase integration, add to your cloud messaging service `onNewToken` method `Affise.addPushToken(token)`\n\n```dart\nimport 'package:affise_attribution_lib/affise.dart';\n\nvoid saveToken(String token) {\n  Affise.addPushToken(token);\n}\n\nclass _Application extends State\u003cApplication\u003e {\n  String _token;\n\n  Future\u003cvoid\u003e setupToken() async {\n    // Get the token each time the application loads\n    String? token = await FirebaseMessaging.instance.getToken();\n\n    // Any time the token refreshes, store this in the database too.\n    FirebaseMessaging.instance.onTokenRefresh.listen(saveToken);\n  }\n\n  @override\n  void initState() {\n    super.initState();\n\n    setupToken();\n  }\n\n  @override\n  Widget build(BuildContext context) {\n    return Text(\"...\");\n  }\n}\n```\n\n## Reinstall Uninstall tracking\n\nAffise automatically track reinstall events by using silent-push technology, to make this feature work, pass push token when it is recreated by user and on you application starts up\n\n```dart\nAffise.addPushToken(\"token\");\n```\n\n## APK preinstall tracking\n\nSDK is also supports scenario when APK is installed not from one of application markets, such as google play, huawei appgallery or amazon appstore\nTo use this feature, create file with name `partner_key` in your app assets directory, and write unique identifier inside, this key will be passed to our backend so you can track events by partner later in your Affise console.\n\n## Deeplinks\n\n\u003e **Warning**\n\u003e\n\u003e 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\u003e\n\u003e Deeplinks support only **CUSTOM** scheme **NOT** `http` or `https`\n\u003e\n\u003e For `http` or `https` read how to setup [AppLinks](#applinks)\n\u003e\n\u003e 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\nTo integrate deeplink support you need:\n\n- Follow how to set up deeplinks for [Android](#android-2) or [iOS](#ios-2)\n\n- Register deeplink callback right after `Affise.settings(..).start()`\n\n```dart\nvoid init() {\n  Affise.settings(affiseAppId, secretKey).start(); // Start Affise SDK\n\n  Affise.registerDeeplinkCallback((value) {\n    // full uri \"scheme://host/path?parameters\"\n    var deeplink = value.deeplink;\n\n    // separated for convenience\n    var scheme = value.scheme;\n    var host = value.host;\n    var path = value.path;\n    var queryParametersMap = value.parameters;\n\n    if(queryParametersMap[\"\u003cyour_uri_key\u003e\"]?.contains(\"\u003cyour_uri_key_value\u003e\") == true) {\n      // handle value\n    }\n  });\n}\n```\n\nTest Android DeepLink via terminal command:\n\n```terminal\nadb shell am start -a android.intent.action.VIEW -d \"YOUR_SCHEME://YOUR_DOMAIN/somepath?param=1\\\u0026list=some\\\u0026list=other\\\u0026list=\"\n```\n\nTest iOS DeepLink via terminal command:\n\n```terminal\nxcrun simctl openurl booted \"YOUR_SCHEME://YOUR_DOMAIN/somepath?param=1\u0026list=some\u0026list=other\u0026list=1\"\n```\n\n### Android\n\nTo integrate deeplink support in android you need:\n\n- Add intent filter to one of your activities [`AndroidManifest.xml example`](example/android/app/src/main/AndroidManifest.xml)\n\n- Add **custom** scheme (**NOT** `http` or `https`) and host to filter\n\nExample: `YOUR_SCHEME://YOUR_DOMAIN`\n\nExample: `myapp://mydomain.com`\n\n```xml\n\u003cmeta-data android:name=\"flutter_deeplinking_enabled\" android:value=\"true\" /\u003e\n\u003cintent-filter android:autoVerify=\"true\"\u003e\n    \u003caction android:name=\"android.intent.action.VIEW\" /\u003e\n    \n    \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n    \u003ccategory android:name=\"android.intent.category.BROWSABLE\" /\u003e\n    \n    \u003cdata\n        android:host=\"YOUR_DOMAIN\"\n        android:scheme=\"YOUR_SCHEME\" /\u003e\n\u003c/intent-filter\u003e\n```\n\n### iOS\n\nTo integrate deeplink support in iOS you need:\n\nAdd key `CFBundleURLTypes` to `Info.plist` [`example Info.plist`](example/ios/Runner/Info.plist)\n\nExample: `YOUR_SCHEME://YOUR_DOMAIN`\n\nExample: `myapp://mydomain.com`\n\n```xml\n\u003ckey\u003eCFBundleURLTypes\u003c/key\u003e\n\u003carray\u003e\n    \u003cdict\u003e\n        \u003ckey\u003eCFBundleTypeRole\u003c/key\u003e\n        \u003cstring\u003eEditor\u003c/string\u003e\n        \u003ckey\u003eCFBundleURLName\u003c/key\u003e\n        \u003cstring\u003eYOUR_DOMAIN\u003c/string\u003e\n        \u003ckey\u003eCFBundleURLSchemes\u003c/key\u003e\n        \u003carray\u003e\n            \u003cstring\u003eYOUR_SCHEME\u003c/string\u003e\n        \u003c/array\u003e\n    \u003c/dict\u003e\n\u003c/array\u003e\n```\n\n## AppLinks\n\n\u003e **Warning**\n\u003e\n\u003e 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\u003e\n\u003e You must owne website domain.\n\u003e\n\u003e And has ability to add file `https://yoursite/.well-known/apple-app-site-association` for iOS support\n\u003e\n\u003e And has ability to add file `https://yoursite/.well-known/assetlinks.json` for Android support\n\u003e\n\u003e 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\n- Follow how to set up AppLinks for [Android](#android-3) or [iOS](#ios-3)\n\n### Android\n\nTo integrate applink support in android you need:\n\n- Add intent filter to one of your activities [`AndroidManifest.xml example`](example/android/app/src/main/AndroidManifest.xml)\n\n- Add `https` or `http` scheme and host to filter\n\nExample: `https://YOUR_DOMAIN`\n\nExample: `https://mydomain.com`\n\n```xml\n\u003cmeta-data android:name=\"flutter_deeplinking_enabled\" android:value=\"true\" /\u003e\n\u003cintent-filter android:autoVerify=\"true\"\u003e\n    \u003caction android:name=\"android.intent.action.VIEW\" /\u003e\n    \n    \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n    \u003ccategory android:name=\"android.intent.category.BROWSABLE\" /\u003e\n    \n    \u003cdata\n        android:host=\"YOUR_DOMAIN\"\n        android:scheme=\"https\" /\u003e\n\u003c/intent-filter\u003e\n```\n\n- Associate your app with your website. [Read Google instructions](https://developer.android.com/studio/write/app-link-indexing#associatesite) \u003cdetails\u003e\n  \u003csummary\u003eHow To Associate your app with your website\u003c/summary\u003e\n\n  ---\n\n  After setting up URL support for your app, the App Links Assistant generates a Digital Assets Links file you can use to [associate your website with your app](https://developer.android.com/training/app-links/verify-android-applinks#web-assoc).\n\n  As an alternative to using the Digital Asset Links file, you can [associate your site and app in Search Console](https://support.google.com/webmasters/answer/6212023).\n\n  If you're using [Play App Signing](https://support.google.com/googleplay/android-developer/answer/9842756) for your app, then the certificate fingerprint produced by the App Links Assistant usually doesn't match the one on users' devices. In this case, you can find the correct Digital Asset Links JSON snippet for your app in your [Play Console](https://play.google.com/console/) developer account under **Release** \u003e **Setup** \u003e **App signing**.\n\n  To associate your app and your website using the App Links Assistant, click **Open Digital Asset Links File Generator** from the App Links Assistant and follow these steps:\n\n  ![app-links-assistant-dal-file-generator_2x](https://developer.android.com/static/studio/images/write/app-links-assistant-dal-file-generator_2x.png)\n  **Figure 2**. Enter details about your site and app to generate a Digital Asset Links file.\n\n  1. Enter your **Site domain** and your [**Application ID**](https://developer.android.com/studio/build/configure-app-module#set-application-id).\n\n  2. To include support in your Digital Asset Links file for [One Tap sign-in](https://developers.google.com/identity/one-tap/android/overview), select **Support sharing credentials between the app and the website** and enter your site's sign-in URL.This adds the following string to your Digital Asset Links file declaring that your app and website share sign-in credentials: `delegate_permission/common.get_login_creds`.\n\n  3. Specify the [signing config](https://developer.android.com/studio/publish/app-signing#sign-auto) or select a [keystore file](https://developer.android.com/studio/publish/app-signing#certificates-keystores).\n\n  Make sure you select the right release config or keystore file for the release build or the debug config or keystore file for the debug build of your app. If you want to set up your production build, use the release config. If you want to test your build, use the debug config.\n\n  4. Click **Generate Digital Asset Links file**.\n  5. Once Android Studio generates the file, click **Save file** to download it.\n  6. Upload the `assetlinks.json` file to your site, with read access for everyone, at `https://yoursite/.well-known/assetlinks.json`.\n\n  \u003e **Important**\n  \u003e\n  \u003e The system verifies the Digital Asset Links file via the encrypted HTTPS protocol. Make sure that the **assetlinks.json** file is accessible over an HTTPS connection, regardless of whether your app's intent filter includes **https**.\n\n  7. Click **Link and Verify** to confirm that you've uploaded the correct Digital Asset Links file to the correct location.\n\n  Learn more about associating your website with your app through the Digital Asset Links file in Declare website associations.\n\n  ---\n\n\u003c/details\u003e\n\n### iOS\n\nTo integrate applink support in iOS you need:\n\n- Follow how to set up applink in the [official documentation](https://developer.apple.com/documentation/xcode/supporting-universal-links-in-your-app).\n\n- Associate your app with your website. [Supporting associated domains](https://developer.apple.com/documentation/xcode/supporting-associated-domains)\n\n- [Configuring an associated domain](https://developer.apple.com/documentation/xcode/configuring-an-associated-domain/)\n\n- Add key `com.apple.developer.associated-domains` to `Info.plist`\n\nExample: `https://YOUR_DOMAIN`\n\nExample: `https://mydomain.com`\n\n```xml\n\u003ckey\u003ecom.apple.developer.associated-domains\u003c/key\u003e\n\u003carray\u003e\n    \u003cstring\u003eapplinks:YOUR_DOMAIN\u003c/string\u003e\n\u003c/array\u003e\n```\n\n## Offline mode\n\nIn some scenarios you would want to limit Affise network usage, to pause that activity call anywhere in your application following code after Affise start:\n\n```dart\nAffise.settings(affiseAppId, secretKey).start(); // Start Affise SDK\n\nAffise.setOfflineModeEnabled(true); // to enable offline mode\nAffise.setOfflineModeEnabled(false); // to disable offline mode\n```\n\nWhile offline mode is enabled, your metrics and other events are kept locally, and will be delivered once offline mode is disabled.\nOffline mode is persistent as Application lifecycle, and will be disabled with process termination automatically.\nTo check current offline mode status call:\n\n```dart\nAffise.isOfflineModeEnabled(); // returns true or false describing current tracking state\n```\n\n## Disable tracking\n\nTo disable any tracking activity, storing events and gathering device identifiers and metrics call anywhere in your application following code after Affise start:\n\n```dart\nAffise.settings(affiseAppId, secretKey).start(); // Start Affise SDK\n\nAffise.setTrackingEnabled(true); // to enable tracking\nAffise.setTrackingEnabled(false); // to disable tracking\n```\n\nBy default tracking is enabled.\n\nWhile tracking mode is disabled, metrics and other identifiers is not generated locally.\nKeep in mind that this flag is persistent until app reinstall, and don't forget to reactivate tracking when needed.\nTo check current status of tracking call:\n\n```dart\nAffise.isTrackingEnabled(); // returns true or false describing current tracking state\n```\n\n## Disable background tracking\n\nTo disable any background tracking activity, storing events and gathering device identifiers and metrics call anywhere in your application following code after Affise start:\n\n```dart\nAffise.settings(affiseAppId, secretKey).start(); // Start Affise SDK\n\nAffise.setBackgroundTrackingEnabled(true); // to enable background tracking\nAffise.setBackgroundTrackingEnabled(false); // to disable background tracking\n```\n\nBy default background tracking is enabled.\n\nWhile background tracking mode is disabled, metrics and other identifiers is not generated locally.\nBackground tracking mode is persistent as Application lifecycle, and will be re-enabled with process termination automatically.\nTo check current status of background tracking call:\n\n```dart\nAffise.isBackgroundTrackingEnabled(); // returns true or false describing current background tracking state\n```\n\n## Get random user Id\n\n```dart\nAffise.getRandomUserId();\n```\n\n## Get random device Id\n\n```dart\nAffise.getRandomDeviceId();\n```\n\n## Get providers\n\nReturns providers map with [ProviderType](#providertype-identifiers-collection) as key\n\n```dart\nAffise.getProviders().then((providers) {\n  var key = ProviderType.AFFISE_APP_TOKEN;\n  var value = providers[key];\n});\n```\n\n## Is first run\n```dart\nAffise.isFirstRun().then((isFirstRun) {\n  // handle\n});\n```\n\n## Get referrer\n\nUse the next public method of SDK\n\n\u003e To get Install referrer by installing from `Android` `RuStore` include module [`RuStore`](#modules)\n\n\u003e To get Install referrer by installing from `Android` `AppGallery` include module [`Huawei`](#modules)\n\n```dart\nAffise.getReferrerUrl((value) {\n  // handle referrer\n});\n```\n\n## Get referrer value\n\nUse the next public method of SDK to get referrer value by\n\n\u003e To get Install referrer by installing from `Android` `RuStore` include module [`RuStore`](#modules)\n\n\u003e To get Install referrer by installing from `Android` `AppGallery` include module [`Huawei`](#modules)\n\n```dart\nAffise.getReferrerUrlValue(ReferrerKey.CLICK_ID, (value) {\n  // handle referrer\n});\n```\n\n## Get referrer on server\n\n\u003e **Note**\n\u003e\n\u003e Requires [Affise Status Module](#modules)\n\nUse the next public method of SDK\n\n```dart\nAffise.getReferrerOnServer((value) {\n  // handle referrer\n});\n```\n\n## Get referrer on server parameter\n\n\u003e **Note**\n\u003e\n\u003e Requires [Affise Status Module](#modules)\n\nUse the next public method of SDK to get referrer parameter by\n\n```dart\nAffise.getReferrerOnServerValue(ReferrerKey.CLICK_ID, (value) {\n  // handle referrer value\n});\n```\n\n## Referrer keys\n\nIn examples above `ReferrerKey.CLICK_ID` is used, but many others is available:\n\n- `AD_ID`\n- `CAMPAIGN_ID`\n- `CLICK_ID`\n- `AFFISE_AD`\n- `AFFISE_AD_ID`\n- `AFFISE_AD_TYPE`\n- `AFFISE_ADSET`\n- `AFFISE_ADSET_ID`\n- `AFFISE_AFFC_ID`\n- `AFFISE_CHANNEL`\n- `AFFISE_CLICK_LOOK_BACK`\n- `AFFISE_COST_CURRENCY`\n- `AFFISE_COST_MODEL`\n- `AFFISE_COST_VALUE`\n- `AFFISE_DEEPLINK`\n- `AFFISE_KEYWORDS`\n- `AFFISE_MEDIA_TYPE`\n- `AFFISE_MODEL`\n- `AFFISE_OS`\n- `AFFISE_PARTNER`\n- `AFFISE_REF`\n- `AFFISE_SITE_ID`\n- `AFFISE_SUB_SITE_ID`\n- `AFFISE_SUB_1`\n- `AFFISE_SUB_2`\n- `AFFISE_SUB_3`\n- `AFFISE_SUB_4`\n- `AFFISE_SUB_5`\n- `AFFC`\n- `PID`\n- `SUB_1`\n- `SUB_2`\n- `SUB_3`\n- `SUB_4`\n- `SUB_5`\n\n## Get module state\n\n```dart\nAffise.module.getStatus(AffiseModules.STATUS, (response) {\n    // handle status response\n});\n```\n\n## Platform specific\n\n### GDPR right to be forgotten\n\n\u003e `Android Only`\n\nUnder the EU's General Data Protection Regulation (GDPR): An individual has the right to have their personal data erased.\nTo provide this functionality to user, as the app developer, you can call\n\n```dart\nAffise.settings(affiseAppId, secretKey).start(); // Start Affise SDK\n\nAffise.android.forget(); // to forget users data\n```\n\nAfter processing such request our backend servers will delete all users data.\nTo prevent library from generating new events, disable tracking just before calling Affise.forget:\n\n```dart\nAffise.settings(affiseAppId, secretKey).start(); // Start Affise SDK\n\nAffise.setTrackingEnabled(false);\nAffise.android.forget(); // to forget users data\n```\n\n### StoreKit Ad Network\n\n\u003e `iOS Only`\n\nFor ios prior `16.1` first call\n\n```dart\nAffise.ios.registerAppForAdNetworkAttribution((error) { \n  // Handle error\n});\n```\n\nUpdates the fine and coarse conversion values, and calls a completion handler if the update fails.\nSecond argument coarseValue is available in iOS 16.1+\n\n```dart\nAffise.ios.updatePostbackConversionValue(1, SKAdNetwork.CoarseConversionValue.medium, (error) { \n  // Handle error\n});\n```\n\nConfigure your app to send postback copies to Affise:\n\nAdd key `NSAdvertisingAttributionReportEndpoint` to `Info.plist`\nSet key value to `https://affise-skadnetwork.com/`\n\nExample: [`example/ios/Runner/Info.plist`](example/ios/Runner/Info.plist)\n\n```xml\n\u003ckey\u003eCFBundleURLTypes\u003c/key\u003e\n\u003carray\u003e\n    \u003cdict\u003e\n      \u003ckey\u003eNSAdvertisingAttributionReportEndpoint\u003c/key\u003e\n      \u003cstring\u003ehttps://affise-skadnetwork.com/\u003c/string\u003e\n    \u003c/dict\u003e\n\u003c/array\u003e\n```\n\n# SDK to SDK integrations\n\n```dart\n// Send AdRevenue info\nAffiseAdRevenue(AffiseAdSource.ADMOB)\n  .setRevenue(2.5, \"ImpressionData_Currency\")\n  .setNetwork(\"ImpressionData_Network\")\n  .setUnit(\"ImpressionData_Unit\")\n  .setPlacement(\"ImpressionData_Placement\")\n  .send();\n```\n\n# Debug\n\n## Validate credentials\n\n\u003e **Warning**\n\u003e\n\u003e 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\u003e \n\u003e Debug methods WON'T work on Production\n\u003e\n\u003e 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\nValidate your credentials by receiving `ValidationStatus` values:\n\n- `VALID` - your credentials are valid\n- `INVALID_APP_ID` - your app id is not valid\n- `INVALID_SECRET_KEY` - your SDK secretKey is not valid\n- `PACKAGE_NAME_NOT_FOUND` - your application package name not found\n- `NOT_WORKING_ON_PRODUCTION` - you using debug method on production\n- `NETWORK_ERROR` - network or server not available (for example `Airoplane mode` is active)\n\n```dart\nAffise\n  .settings(\n    affiseAppId: \"Your appId\",\n    secretKey: \"Your SDK secretKey\",\n  )\n  .setProduction(false) //To enable debug methods set Production to false\n  .start(); // Start Affise SDK\n\nAffise.debug.validate((status) {\n    // Handle validation status\n});\n```\n\n# Troubleshoots\n\n## iOS\n\n\u003e **Warning**\n\u003e\n\u003e 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\u003e\n\u003e This app has crashed because Affise Advertising Module is attempted to access privacy-sensitive data without a usage description.\n\u003e\n\u003e The app's `Info.plist` must contain an `NSUserTrackingUsageDescription` key with a string value explaining\n\u003e\n\u003e to the user how the app uses this data.\n\u003e\n\u003e 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥\n\nOpen `info.plist` and add key `NSUserTrackingUsageDescription` with string value. For more information [read requirements](#requirements)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faffise%2Fflutter-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faffise%2Fflutter-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faffise%2Fflutter-sdk/lists"}