User Info
warning
This should be done as early as possible in your Main Activity for a seamless experience to your users.
To pass information we require related to the user, use the following:
- Java
- Kotlin
- React Native
- Flutter
Your Android App
new BharatXUserManager(this) .phoneNumber("+911234567890") .id("user-200") .name("Andrey Breslav") .gender("Male") .dob("2016-02-05", "yyyy-MM-dd") .age(20) .address("20, Tech Street, Bengaluru") .prop("customKey1", "customValue1") .prop("customKey2", "customValue2") .register();
Your Android App
BharatXUserManager(this) .phoneNumber("+911234567890") .id("user-200") .name("Andrey Breslav") .gender("Male") .dob("2016-02-05", "yyyy-MM-dd") .age(20) .address("20, Tech Street, Bengaluru") .prop("customKey1", "customValue1") .prop("customKey2", "customValue2") .register()
React Native App
import BharatXTransactionManager from '@bharatx/startup-sdk-reactnative';
BharatXTransactionManager.registerUser({ phoneNumber: '+911234567890', id: 'user-200', name: 'Christopher Chedeau', gender: 'Male', dob: '2016-02-05', // dobFormat is mandatory when you supply dob dobFormat: 'yyyy-MM-dd', age: 20, address: '20, Tech Street, Bengaluru', customKey1: 'customValue1', customKey2: 'customValue2',});
Flutter App
import 'package:startup_sdk_flutter/startup_sdk_flutter.dart';
BharatXTransactionManager.registerUser({ "phoneNumber": "+911234567890", "id": "user-200", "name": 'Christopher Chedeau', "gender": 'Male', "dob": '2016-02-05', // dobFormat is mandatory when you supply dob "dobFormat": 'yyyy-MM-dd', "age": 20, "address": '20, Tech Street, Bengaluru', "customKey1": 'customValue1', "customKey2": 'customValue2',});
note
If your servers use Phone Numbers as the User ID, you can pass it as both the phoneNumber
and the id
.