Skip to content

lavaai/LavaMobileSDK-Android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LavaSDK

Platforms

LavaMobileSDK for Android is the client libary to integrate your mobile apps with Lava Platform.

Features

  • Handle push notification from LAVA Platform.
  • Message Inbox.
  • Membership Pass.
  • Deep Links.
  • Track Events.

Installation

This library is hosted on GitHub Packages, in order to install it, you must ask LAVA for granting you the access. After that, please follow the steps below:

  1. Generate Personal Access Token.
  2. Set up Android project.

Generate Personal Access Token

After you have the access to the library, you have to generate your Personal Access Token to use with your Android project.

  1. On the top right corner, click on your avatar and select Settings.

PAT 01

  1. On the left panel, scroll down and select Developer settings.

PAT 02

  1. Select Personal access tokens > Tokens (classic). Click on Generate new token > Generate new token (classic).

PAT 03

  1. Fill the necessary information and in the Scopes section, select only read:packages. Submit.

PAT 04

  1. Copy your newly generated Personal Access Token and store it in a secure place. This PAT will be use in the next step as the password.

Set up Android project

Let's set up your Android project:

  1. Create a new file named project.properties in your project root. You must add this file into .gitignore to not tracking it. Add the following content to the file and replace the placeholders with appropriate values:
GITHUB_USERNAME=<your GitHub username>
GITHUB_PERSONAL_ACCESS_TOKEN=<your generated Personal Access Token>
  1. Open your settings.gradle, replace the dependencyResolutionManagement block with the following content:
def property = new Properties()
file("project.properties").withInputStream { property.load(it) }

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {
            url = uri("https://maven.pkg.github.com/lavaai/LavaMobileSDK-Android")
            credentials {
                username = property.get("GITHUB_USERNAME")
                password = property.get("GITHUB_PERSONAL_ACCESS_TOKEN")
            }
        }
    }
}
  1. In your app level build.gradle, add the following dependency and sync the project:
implementation 'ai.lava.mobile-sdk:lavasdk:2.0.27'

Help

Please contact LAVA Support in case you need help.