create services module
This commit is contained in:
parent
d201cfb36f
commit
ccb3f1c4e1
|
|
@ -0,0 +1 @@
|
|||
/build
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
apply from: "../android-configs/lib-config.gradle"
|
||||
apply plugin: 'com.huawei.agconnect'
|
||||
|
||||
dependencies {
|
||||
implementation "androidx.core:core"
|
||||
implementation "androidx.annotation:annotation"
|
||||
implementation "com.google.android.gms:play-services-base"
|
||||
implementation "com.huawei.hms:safetydetect"
|
||||
|
||||
constraints {
|
||||
implementation("androidx.core:core") {
|
||||
version {
|
||||
require '1.0.0'
|
||||
}
|
||||
}
|
||||
|
||||
implementation("androidx.annotation:annotation") {
|
||||
version {
|
||||
require '1.1.0'
|
||||
}
|
||||
}
|
||||
|
||||
implementation("com.google.android.gms:play-services-base") {
|
||||
version {
|
||||
require '18.0.1'
|
||||
}
|
||||
}
|
||||
|
||||
implementation("com.huawei.hms:safetydetect") {
|
||||
version {
|
||||
require '4.0.3.300'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="ru.touchin.client_services">
|
||||
|
||||
</manifest>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package ru.touchin.client_services
|
||||
|
||||
enum class MobileService {
|
||||
HUAWEI_SERVICE, GOOGLE_SERVICE
|
||||
}
|
||||
|
|
@ -1,11 +1,10 @@
|
|||
package ru.touchin.recaptcha
|
||||
package ru.touchin.client_services
|
||||
|
||||
import android.content.Context
|
||||
import com.google.android.gms.common.ConnectionResult
|
||||
import com.google.android.gms.common.GoogleApiAvailability
|
||||
import com.huawei.hms.api.HuaweiApiAvailability
|
||||
|
||||
//TODO: in the future move to a module with services
|
||||
class ServicesUtils {
|
||||
|
||||
fun getCurrentService(context: Context): MobileService = when {
|
||||
|
|
@ -23,7 +22,3 @@ class ServicesUtils {
|
|||
.isGooglePlayServicesAvailable(context) == ConnectionResult.SUCCESS
|
||||
|
||||
}
|
||||
|
||||
enum class MobileService {
|
||||
HUAWEI_SERVICE, GOOGLE_SERVICE
|
||||
}
|
||||
|
|
@ -2,7 +2,8 @@ apply from: "../android-configs/lib-config.gradle"
|
|||
apply plugin: 'com.huawei.agconnect'
|
||||
|
||||
dependencies {
|
||||
implementation project(':kotlin-extensions')
|
||||
implementation project(':client-services')
|
||||
|
||||
implementation "androidx.core:core"
|
||||
implementation "androidx.annotation:annotation"
|
||||
implementation "com.google.android.gms:play-services-safetynet"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package ru.touchin.recaptcha
|
||||
|
||||
import android.app.Activity
|
||||
import ru.touchin.client_services.MobileService
|
||||
import ru.touchin.client_services.ServicesUtils
|
||||
|
||||
/**
|
||||
* onNewTokenReceived - callback на успешную проверку каптчи
|
||||
|
|
|
|||
Loading…
Reference in New Issue