Check app is paid in Apklis
- Step 1. Add the JitPack repository to your build file
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Step 2. Add the dependency
implementation 'com.github.cz9dev:apklispaidchequed:$VERSION'
- Check paid Kotlin
var paidCheked = PaidCheked.isPurchased(this, PACKAGE_ID)
when (paidCheked){
"result00" -> Toast.makeText(this,"El movil no cuenta con la aplicacion Apklis instalada.",Toast.LENGTH_LONG).show()
"result02" -> Toast.makeText(this,"No se encuentra autenticado en Apklis.",Toast.LENGTH_LONG).show()
"result03" -> Toast.makeText(this,"Usted no ha comprado la aplicación en Apklis.",Toast.LENGTH_LONG).show()
"result04" -> Toast.makeText(this,"Compra verificada en Apklis.",Toast.LENGTH_LONG).show()
}
- Check paid Java
String paidCheked = PaidCheked.Companion.isPurchased(this, PACKAGE_ID);
switch (paidCheked) {
case "result00":
Toast.makeText(this, "El movil no cuenta con la aplicacion Apklis instalada.", Toast.LENGTH_LONG).show();
case "result02":
Toast.makeText(this, "No se encuentra autenticado en Apklis.", Toast.LENGTH_LONG).show();
case "result03":
Toast.makeText(this, "Usted no ha comprado la aplicación en Apklis.", Toast.LENGTH_LONG).show();
case "result04":
Toast.makeText(this, "Compra verificada en Apklis.", Toast.LENGTH_LONG).show();
default:
Toast.makeText(this, "Puede continuar", Toast.LENGTH_LONG).show();
}
- Check has update App Kotlin
var versionCode = BuildConfig.VERSION_CODE
val updateCheked = UpdateCheked(versionCode, PAKAGE_ID)
updateCheked.start()
updateCheked.result.observe(this){hasUpdate ->
if (hasUpdate.update_exist)
// TODO: Implementas tu código para si hay actualización en Apklist
Toast.makeText(this, "Actualiza tu Apps a la version: ${hasUpdate.version_name}", Toast.LENGTH_SHORT).show()
}
All contributions are welcome!!!