Skip to main content

Set up

Before starting, make sure you follow the Get started guide, where you'll find what's needed for integration.

In order to set up the Weavr Push Provisioning SDK, follow these steps.

Add the Weavr Provisioning SDK

From v2, the SDK is distributed via the Weavr Push Provisioning SDK Maven repository. All required runtime dependencies are bundled transitively with the SDK.

1. Get repository credentials

Contact support@weavr.io to receive:

  • A username with access to the Android SDK artifacts
  • An access token with permission to download the SDK

2. Add Weavr Push Provisioning SDK repository in settings.gradle

Add the Weavr Push Provisioning SDK Maven repository under dependencyResolutionManagement:

settings.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()

// Weavr Push Provisioning SDK Maven repository
maven {
url = uri("https://maven.pkg.github.com/weavr-io/push-provisioning-android")
credentials {
username = project.findProperty("WEAVR_SDK_USERNAME") as String?
?: System.getenv("WEAVR_SDK_USERNAME")
password = project.findProperty("WEAVR_SDK_PASSWORD") as String?
?: System.getenv("WEAVR_SDK_PASSWORD")
}
}
}
}

3. Store credentials securely in gradle.properties or environment variables

Store the repository username and access token either in your global Gradle properties file (recommended) or as environment variables. For example:

~/.gradle/gradle.properties
WEAVR_SDK_USERNAME=their-username
WEAVR_SDK_PASSWORD=sdk-access-token

You can also use a project-level gradle.properties file, but ensure it is gitignored and never committed.

note

Treat the access token as a secret. Use your team's secret management solution (such as CI secrets or a password manager) to share and rotate these values.

4. Add the SDK dependency in app/build.gradle

With the repository and credentials configured, add the Weavr Push Provisioning SDK dependency to your app module:

app/build.gradle
dependencies {
implementation 'io.weavr.push-provisioning:push-provisioning:2.0.0'
}

That is all that is required. The SDK brings in its own transitive dependencies, so you do not need to declare any additional libraries manually.

Add provisioning_config file

In addition to adding the SDK and dependencies, you'll have to provide a configuration file.

To do so, you need to add the provisioning_config file to your raw assets folder.

Get in touch with our support team at support@weavr.io to obtain this file.

danger

This file is sensitive, make sure you store and distribute it in a secure manner.

It's recommended to not to commit this file to your repository, and distribute it via a secure file sharing software amongst your team.

Finally, use the secrets feature of your CI software of choice to avoid impacting your CI/CD pipelines.