Android
Minimum Requirements¶
- Android API Level 19
- Android X Compatibility
- Compile and Target SDK version 31
- Build Tool Version 30.0.3
Add Android SDK¶
- Add the following repository to your project’s
build.gradle
file underallprojects
.
java allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
java 2. Add the following dependency to the module’s build.gradle
file under dependencies
.
dependencies { implementation 'com.github.adxcorp:talkplus-android:0.2.8' }
java 3. Add the hive-talkplus-x.x.x.aar file to the module's libs specified folder.
Initialize¶
Initialize TalkPlus API before using TalkPlus after calling AuthV4.setup()
of Hive SDK.
class SampleApplication {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
HiveTalkPlus.init { isInit, message ->
if (isInit) {
// SUCCESS
} else {
// FAILURE
}
}
}
}
Login / Logout Process¶
- You need to login (
LoginWithToken
) once TalkPlus API has been initialized. - You can get the token required when calling
LoginWithToken
through theAuthV4.getHiveTalkPlusLoginToken()
function after callingAuthV4.signIn()
. - When a user logs out, make sure to call the
Logout
function of TalkPlus. If theLogout
function call is omitted, the user will continue to receive notifications even when offline.