Appflow.ai
Visit our websitePricingSign up for freeLog in
  • GET STARTED
    • What is Appflow.ai?
    • Quickstart - How to start working with Appflow.ai?
    • FAQ
    • Ownership and other roles
  • SDK Set-up Instructions
    • Android SDK
      • Google Play Store Credentials
        • Google Service Account Key
        • Google real-time developer notifications(RTDN)
        • FCM server key(optional)(to be updated)
      • Events (Custom events)
      • Purchases
      • Visual constructor
      • User info
      • Push notifications
    • iOS SDK
      • Specify Apple Store Keys
      • Purchases and User Info
      • Event tracking (Custom events)
      • Push Notifications Configuration
      • Visual constructor
  • IN-APP PURCHASE
    • SKU adding
  • METRICS & EVENTS
    • Calculations of Analytics
    • Terms and Descriptions
    • Purchase Events
    • In-app Events
    • Events Structure
    • End-users Attributes
    • Users' statuses
  • SUBSCRIPTION ANALYTICS
    • Dashboard
    • Configurator
    • Reports
    • A/B Testing
    • Integrations
    • Create Push-notifications
    • In-app Messages
    • Return of Advertisement
    • Funnels
    • Funnel 2.0 BETA
    • Entitlements
    • Visual Constructor
  • INTEGRATIONS
    • Adjust
    • Appsflyer
    • Mixpanel
    • Webhooks
    • Apple Search Ads Attributions
    • Branch
    • Amplitude
  • OTHERS
    • Pricing plans and important information about your payments
    • Storing your data
    • Privacy Policy
    • Terms of Use
    • Unsubscribe from Appflow.ai
Powered by GitBook
On this page

Was this helpful?

  1. SDK Set-up Instructions

Android SDK

Instructions to set up Appflow.ai SDK for your Android app

PreviousOwnership and other rolesNextGoogle Play Store Credentials

Last updated 1 year ago

Was this helpful?


Warning!

Please note! We will be not able to receive and show your data without this step!

To connect your Android app to Appflow.ai console you need to follow 3 steps during onboarding or using Settings=>Applications=>New Application

  1. First step is to download app token. Download and put it into the assets folder.

  2. Second step is Install SDK. Install via Gradle

a. If your project doesn't have dependencyResolutionManagement in your settings.gradle, add the following to your top-level build.gradle at the end of repositories:

/** top-level build.gradle */
allprojects {
    repositories {
        ...
        maven { url 'https://maven.appflow.ai/repository/sdk' }
    }
}

Otherwise add the following to your settings.gradle in repositories of dependencyResolutionManagement section:

/** settings.gradle */
dependencyResolutionManagement {
    ...
    repositories {
        ...
        maven { url 'https://maven.appflow.ai/repository/sdk' }
    }
}

b. add the dependency to your module-level build.gradle at the end of dependencies

/** module-level build.gradle */
dependencies {
    ...
    implementation 'com.imp:appflow:1.1.0'
}

3. The step 3 is the most important - Initialize SDK

Add configuration file

Download the appflow-app-token.json file in the dash.appflow.ai and add the file to the app\src\main\assets folder of the project

Initialize

Add the following to your Application class

override fun onCreate() {
    super.onCreate()
    Appflow.init(this)
}

If you want to know if the SDK is initialized, you can do the following

override fun onCreate() {
    super.onCreate()
    Appflow.init(this, AppflowConfig.Builder().build()) {
			//AppflowSDK initialization finished,do something
    }
}

Set user id (optional)

You can set the user id in the following way

override fun onCreate() {
    super.onCreate()
    Appflow.init(this, AppflowConfig.Builder().setAppUserID("your_user_id").build())
}

Enable SDK log (optional)

You can enable SDK log output before initializing the SDK

override fun onCreate() {
    super.onCreate()
    Appflow.setLogEnable(true)
    Appflow.init(this)
}

Please, also follow the next step - adding keys for the RTDN access

Can't find topic name?

  • Find the Settings tab on your project.

  • Click on "Stores"

  • Then click "Connect to Google" in Google Developer Notification settings.

Make sure you switched on for your project

Google Pub/Sub