Setup
- Native Android
- React Native
- Flutter
In the project level build.gradle
file, add the following lines. This will make the SDKs from our server available to you.
buildscript { // ... dependencies { // VERSION must be 3.3.3, 3.4.3, 3.5.4, 3.6.4, 4.0.1, 4.1.x or any version above 4 classpath("com.android.tools.build:gradle:VERSION") }}allprojects { repositories { // ... maven { url "https://repository.bharatx.tech/repository/maven-releases/" credentials { username "repository-user" password "nxN7D4U6CBdJs8g2" } } }}
Add the following lines to your app-level build.gradle
file.
android { buildTypes { debug { manifestPlaceholders = [ bharatx_partner_id: "testPartnerId", bharatx_api_key: "testApiKey" ] } release { manifestPlaceholders = [ bharatx_partner_id: "testPartnerId", bharatx_api_key: "testApiKey" ] } }}
dependencies { // ... implementation 'tech.bharatx.sdk:startup:3.1.2' // ...}
You can now use BharatX's SDK in your project!
Inside the android-specific folder, in the project level build.gradle
file, add the following lines.
This will make the SDKs from our server available to you.
buildscript { // ... dependencies { // VERSION must be 3.3.3, 3.4.3, 3.5.4, 3.6.4, 4.0.1, 4.1.x or any version above 4 classpath("com.android.tools.build:gradle:VERSION") }}allprojects { repositories { // ... maven { url "https://repository.bharatx.tech/repository/maven-releases/" credentials { username "repository-user" password "nxN7D4U6CBdJs8g2" } } }}
Inside the android-specific folder, add the following lines to your app-level build.gradle
file.
android { buildTypes { debug { manifestPlaceholders = [ bharatx_partner_id: "testPartnerId", bharatx_api_key: "testApiKey" ] } release { manifestPlaceholders = [ bharatx_partner_id: "testPartnerId", bharatx_api_key: "testApiKey" ] } }}
Install the required BharatX packages:
- NPM
- Yarn
npm install --save @bharatx/startup-sdk-reactnative@3.1.2-release1
yarn add @bharatx/startup-sdk-reactnative@3.1.2-release1
You can now use BharatX's SDK in your project!
buildscript { // ... dependencies { // VERSION must be 3.3.3, 3.4.3, 3.5.4, 3.6.4, 4.0.1 or 4.1.x or later classpath("com.android.tools.build:gradle:VERSION") }}allprojects { repositories { // ... maven { url "https://repository.bharatx.tech/repository/maven-releases/" credentials { username "repository-user" password "nxN7D4U6CBdJs8g2" } } }}
Add the BharatX dependency to pubspec.yaml
:
dependencies: bharatx_flutter_startup: 3.1.2-release2
For BharatX's SDK to work, your Flutter's Main Activity should extend
from FlutterFragmentActivity
rather than FlutterActivity
given default.
Go to:
Project/android/app/src/main/java.kotlin/your/apps/packagename/MainActivity
and replace all references to FlutterActivity
by FlutterFragmentActivity
.
You can now use BharatX's SDK in your project!