Please ensure the previous steps were completed and keep the following items handy to start with the SDK integration
📘 1. API Key
- API Secret
- TenantID
- google-services.json
[block:image] { “images”: [ { “image”: [ “https://files.readme.io/c6831bf-image.png”, null, “” ], “align”: “center”, “sizing”: “70%”, “border”: true } ] } [/block]
settings.gradledependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
...
maven { url "https://jitpack.io" }
}
}
build.gradleplugins {
id 'com.google.gms.google-services'version 'version number' apply false
}
build.gradle plugins {
id 'com.google.gms.google-services'
}
Add NotiveraSDK dependency in your app level build.gradle by choosing the latest version from jitpack
dependencies {
implementation 'com.github.Notivera:android-sdk:5.0.0'
}
keep class com.notivera.** { *; } to your ProGuard rules file in case you are using it.❗️ If you’re using Proguard
Please add
-keep class com.notivera.** { *; }to your ProGuard rules file. if not the device will not register itself or appear in the Notivera portal.Troubleshooting
if you experience some troubles with Proguard in Release mode then in gradle.properties add option
android.enableR8.fullMode=false
class MyApplication: Application() {
override fun onCreate() {
super.onCreate()
initSDK()
}
private fun initPushSDK() {
FirebaseApp.initializeApp(this)
SDK.init(
application = this,
SDKConfig(
apiKey = <API KEY>,
apiSecret = <API SECRET>,
tenantID = <YOUR TENANT ID>, (Optional field)
enableDebug = true,
appVersion = <APP VERSION>,(Optional field)
enableGeofence = true,
customerId = <YOUR CUSTOMER ID>,(Optional field)
trackLocation = true,
inAppOpenDelay = <DELAY IN MILLISECONDS>, (Optional field)
downloadConnectionType = ConnectionType.WIFI,
activeGeofenceLimit = 20 (Optional field)
),
//Optional
NotiveraPushTheme(
largeIconRes = <LARGE NOTIFICATION ICON>,
smallIconRes = <SMALL NOTIFICATION ICON>,
color = R.color.black
)
)
}
}