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
The Weavr Provisioning SDK is distributed through a Maven repository alongside the dependencies it needs. In order to add it to you app you first need to add the Weavr Maven repository details to your settings.gradle
. The following snippet illustrates how to do this.
These snippets assume you have a secrets.properties
file that is git ignored
to avoid exposing credentials.
Make sure that if you don't follow this pattern, you maintain the credentials provided stored and shared securely
def keystorePropertiesFile = new File(settingsDir, "secrets.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
if (keystoreProperties['WEAVR_SDK_TOKEN'] == null) {
throw new GradleException(
"WEAVR_SDK_TOKEN is not set in secrets.properties. Ensure the value is set before attempting to build the app."
)
}
dependencyResolutionManagement {
// ...
repositories {
// ...
maven {
url = uri("https://url.to.be.decided/")
name = "GitLab"
credentials(HttpHeaderCredentials) {
name = "Private-Token"
value = keystoreProperties['WEAVR_SDK_TOKEN']
}
authentication {
create("header", HttpHeaderAuthentication)
}
}
}
}
With the Maven repository configured, you can add the dependency to Weavr Provisioning SDK with the following snippet within your app/build.gradle
:
dependencies {
// Weavr Push Provisioning SDK -- Ensure you are using the latest version.
implementation 'io.weavr.sdk:something:something:1.0.0'
}
Add mea_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 mea_config
file to your raw
assets folder.
Get in touch with our support team at support@weavr.io to obtain this file.
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.