setup Android React
This commit is contained in:
parent
854dfef197
commit
24f733af70
4
.gitignore
vendored
4
.gitignore
vendored
@ -69,7 +69,6 @@ android/keystores/debug.keystore
|
|||||||
!.yarn/versions
|
!.yarn/versions
|
||||||
|
|
||||||
# Expo
|
# Expo
|
||||||
.expo/
|
|
||||||
|
|
||||||
# Turborepo
|
# Turborepo
|
||||||
.turbo/
|
.turbo/
|
||||||
@ -82,3 +81,6 @@ ios/generated
|
|||||||
android/generated
|
android/generated
|
||||||
|
|
||||||
.env
|
.env
|
||||||
|
/package-lock.json
|
||||||
|
/example/package-lock.json
|
||||||
|
/example/Gemfile.lock
|
||||||
|
|||||||
@ -1,19 +1,3 @@
|
|||||||
buildscript {
|
|
||||||
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
||||||
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["WebIdMetaPlugin_kotlinVersion"]
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath "com.android.tools.build:gradle:7.2.1"
|
|
||||||
// noinspection DifferentKotlinGradleVersion
|
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def reactNativeArchitectures() {
|
def reactNativeArchitectures() {
|
||||||
def value = rootProject.getProperties().get("reactNativeArchitectures")
|
def value = rootProject.getProperties().get("reactNativeArchitectures")
|
||||||
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
||||||
@ -26,10 +10,6 @@ def isNewArchitectureEnabled() {
|
|||||||
apply plugin: "com.android.library"
|
apply plugin: "com.android.library"
|
||||||
apply plugin: "kotlin-android"
|
apply plugin: "kotlin-android"
|
||||||
|
|
||||||
if (isNewArchitectureEnabled()) {
|
|
||||||
apply plugin: "com.facebook.react"
|
|
||||||
}
|
|
||||||
|
|
||||||
def getExtOrDefault(name) {
|
def getExtOrDefault(name) {
|
||||||
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["WebIdMetaPlugin_" + name]
|
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["WebIdMetaPlugin_" + name]
|
||||||
}
|
}
|
||||||
@ -82,18 +62,35 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
google()
|
|
||||||
}
|
|
||||||
|
|
||||||
def kotlin_version = getExtOrDefault("kotlinVersion")
|
def kotlin_version = getExtOrDefault("kotlinVersion")
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// For < 0.71, this will be from the local maven repo
|
// For < 0.71, this will be from the local maven repo
|
||||||
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
// For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
|
||||||
//noinspection GradleDynamicVersion
|
//noinspection GradleDynamicVersion
|
||||||
implementation "com.facebook.react:react-native:+"
|
implementation "com.google.code.gson:gson:2.10.1"
|
||||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
||||||
|
implementation("com.facebook.react:react-android")
|
||||||
|
def product_catalog_version = "15.3.0"
|
||||||
|
|
||||||
|
implementation ("de.webid-solutions:android_meta_plugin:$product_catalog_version") {
|
||||||
|
changing = true
|
||||||
|
}
|
||||||
|
|
||||||
|
implementation ("de.webid-solutions:android_auto_ident_on_server_product_plugin:$product_catalog_version") {
|
||||||
|
changing = true
|
||||||
|
}
|
||||||
|
|
||||||
|
implementation ("de.webid-solutions:android_pay_on_server_product_plugin:$product_catalog_version") {
|
||||||
|
changing = true
|
||||||
|
}
|
||||||
|
|
||||||
|
implementation ("de.webid-solutions:android_video_ident_product_plugin:$product_catalog_version") {
|
||||||
|
changing = true
|
||||||
|
}
|
||||||
|
|
||||||
|
implementation ("de.webid-solutions:android_eid_on_server_product_plugin:$product_catalog_version") {
|
||||||
|
changing = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
WebIdMetaPlugin_kotlinVersion=1.7.0
|
WebIdMetaPlugin_kotlinVersion=2.1.20
|
||||||
WebIdMetaPlugin_minSdkVersion=21
|
WebIdMetaPlugin_minSdkVersion=21
|
||||||
WebIdMetaPlugin_targetSdkVersion=31
|
WebIdMetaPlugin_targetSdkVersion=31
|
||||||
WebIdMetaPlugin_compileSdkVersion=31
|
WebIdMetaPlugin_compileSdkVersion=31
|
||||||
|
|||||||
11
android/settings.gradle
Normal file
11
android/settings.gradle
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
dependencyResolutionManagement {
|
||||||
|
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
|
||||||
|
maven {
|
||||||
|
url 'https://api.webid-solutions.de/releases/android/maven/repository/internal'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,25 +1,227 @@
|
|||||||
package com.webidmetaplugin
|
package com.webidmetaplugin
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.activity.result.ActivityResultLauncher
|
||||||
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
|
import androidx.fragment.app.Fragment
|
||||||
|
import androidx.fragment.app.FragmentActivity
|
||||||
|
import com.facebook.react.bridge.Promise
|
||||||
import com.facebook.react.bridge.ReactApplicationContext
|
import com.facebook.react.bridge.ReactApplicationContext
|
||||||
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
||||||
import com.facebook.react.bridge.ReactMethod
|
import com.facebook.react.bridge.ReactMethod
|
||||||
import com.facebook.react.bridge.Promise
|
import com.facebook.react.bridge.ReadableArray
|
||||||
|
import com.facebook.react.modules.core.DeviceEventManagerModule
|
||||||
|
import de.webidsolutions.auto_ident_on_server_product_plugin.AutoIdentOnServerProductPlugin
|
||||||
|
import de.webidsolutions.eid_on_server_product_plugin.EIdOnServerProductPlugin
|
||||||
|
import de.webidsolutions.meta_plugin.WebIdMetaPlugin
|
||||||
|
import de.webidsolutions.mobile_app.sdk.WebIdSdkEnvironment
|
||||||
|
import de.webidsolutions.pay_on_server_product_plugin.PayOnServerProductPlugin
|
||||||
|
import de.webidsolutions.plugin_core.IEPluginError
|
||||||
|
import de.webidsolutions.plugin_core.IProductPluginWebId
|
||||||
|
import de.webidsolutions.video_ident.plugin.videocall.VideoOptionsConfig
|
||||||
|
import de.webidsolutions.video_ident_product_plugin.VideoIdentProductPlugin
|
||||||
|
import java.net.URI
|
||||||
|
import com.facebook.react.bridge.UiThreadUtil
|
||||||
|
import android.util.Log
|
||||||
|
import com.google.gson.Gson
|
||||||
|
|
||||||
class WebIdMetaPluginModule(reactContext: ReactApplicationContext) :
|
private const val TAG = "WebIdMetaPlugin"
|
||||||
ReactContextBaseJavaModule(reactContext) {
|
|
||||||
|
|
||||||
override fun getName(): String {
|
class WebIdMetaPluginModule(
|
||||||
return NAME
|
private val reactContext: ReactApplicationContext
|
||||||
|
) : ReactContextBaseJavaModule(reactContext) {
|
||||||
|
|
||||||
|
private var metaPlugin: WebIdMetaPlugin? = null
|
||||||
|
|
||||||
|
override fun getName() = "WebIdMetaPlugin"
|
||||||
|
|
||||||
|
private fun sendEvent(eventName: String, data: String) {
|
||||||
|
reactContext
|
||||||
|
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
||||||
|
.emit(eventName, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Example method
|
private var listenerCount = 0
|
||||||
// See https://reactnative.dev/docs/native-modules-android
|
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
fun multiply(a: Double, b: Double, promise: Promise) {
|
fun addListener(eventName: String) {
|
||||||
promise.resolve(a * b)
|
listenerCount += 1
|
||||||
|
}
|
||||||
|
|
||||||
|
@ReactMethod
|
||||||
|
fun removeListeners(count: Int) {
|
||||||
|
listenerCount = (listenerCount - count).coerceAtLeast(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
@ReactMethod
|
||||||
|
fun createMetaPlugin(
|
||||||
|
uri: String,
|
||||||
|
username: String,
|
||||||
|
apiKey: String,
|
||||||
|
shaPins: ReadableArray,
|
||||||
|
plugins: ReadableArray,
|
||||||
|
promise: Promise
|
||||||
|
) {
|
||||||
|
val cleanUri = uri.trim()
|
||||||
|
val cleanUsername = username.trim()
|
||||||
|
val cleanApiKey = apiKey.trim()
|
||||||
|
|
||||||
|
val shaPinsList = shaPins.toArrayList().map { it.toString() }
|
||||||
|
val pluginsList = plugins.toArrayList().map { it.toString() }
|
||||||
|
|
||||||
|
Log.i(TAG, "createMetaPlugin plugins(raw) len=${pluginsList.size} values=$pluginsList")
|
||||||
|
|
||||||
|
try {
|
||||||
|
val environment = WebIdSdkEnvironment(
|
||||||
|
URI.create(cleanUri),
|
||||||
|
*shaPinsList.toTypedArray()
|
||||||
|
)
|
||||||
|
|
||||||
|
val selectedPlugins = ArrayList<IProductPluginWebId>()
|
||||||
|
|
||||||
|
pluginsList.forEach { p ->
|
||||||
|
when (p) {
|
||||||
|
"AutoIdOnServer" -> selectedPlugins.add(AutoIdentOnServerProductPlugin())
|
||||||
|
"PayOnServer" -> selectedPlugins.add(PayOnServerProductPlugin())
|
||||||
|
"VideoId" -> selectedPlugins.add(VideoIdentProductPlugin(config = VideoOptionsConfig()))
|
||||||
|
"EIdOnServer" -> selectedPlugins.add(EIdOnServerProductPlugin())
|
||||||
|
else -> Log.w(TAG, "createMetaPlugin unknown plugin string='$p'")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Log.i(TAG, "createMetaPlugin plugins(mapped) len=${selectedPlugins.size} classes=${selectedPlugins.map { it.javaClass.simpleName }}")
|
||||||
|
|
||||||
|
metaPlugin = WebIdMetaPlugin(
|
||||||
|
environment,
|
||||||
|
cleanUsername,
|
||||||
|
cleanApiKey,
|
||||||
|
reactApplicationContext,
|
||||||
|
selectedPlugins
|
||||||
|
)
|
||||||
|
|
||||||
|
promise.resolve("MetaPluginCreated")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "createMetaPlugin failed: ${e.message}", e)
|
||||||
|
promise.reject("CREATE_ERROR", e.message, e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ReactMethod
|
||||||
|
fun verifyActionId(actionId: String, promise: Promise) {
|
||||||
|
Log.i(TAG, "verifyActionId() called actionId=$actionId")
|
||||||
|
|
||||||
|
try {
|
||||||
|
val plugin = metaPlugin
|
||||||
|
if (plugin == null) {
|
||||||
|
Log.w(TAG, "verifyActionId() blocked: SDK_NOT_INITIALIZED")
|
||||||
|
promise.reject("SDK_NOT_INITIALIZED", "MetaPlugin not created. Call createMetaPlugin() first.")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val result = plugin.verify(actionId)
|
||||||
|
|
||||||
|
val json = Gson().toJson(result)
|
||||||
|
Log.i(TAG, "verifyActionId() success, jsonLen=${json.length}")
|
||||||
|
|
||||||
|
promise.resolve(json)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
Log.e(TAG, "verifyActionId() failed: ${e.message}", e)
|
||||||
|
promise.reject("VERIFY_ERROR", e.message, e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@ReactMethod
|
||||||
|
fun start(promise: Promise) {
|
||||||
|
val activity = reactApplicationContext.currentActivity
|
||||||
|
|
||||||
|
if (activity !is FragmentActivity) {
|
||||||
|
promise.reject("NO_ACTIVITY", "Current activity is not a FragmentActivity")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
val plugin = metaPlugin
|
||||||
|
if (plugin == null) {
|
||||||
|
promise.reject("SDK_NOT_INITIALIZED", "MetaPlugin not created. Call createMetaPlugin() first.")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
UiThreadUtil.runOnUiThread {
|
||||||
|
try {
|
||||||
|
val fragment = WebIdResultHostFragment.getOrCreate(
|
||||||
|
activity = activity,
|
||||||
|
onResult = { resultCode, data ->
|
||||||
|
try {
|
||||||
|
val result = data?.let {
|
||||||
|
IProductPluginWebId.getProductPluginResult<IEPluginError>(it, resultCode)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result?.error == null) {
|
||||||
|
sendEvent("WebIdSdkEvent.finishedSuccess", result?.info ?: "")
|
||||||
|
} else {
|
||||||
|
sendEvent("WebIdSdkEvent.finishedFailed", result.error.toString())
|
||||||
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
sendEvent("WebIdSdkEvent.finishedFailed", e.message ?: "Unknown")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
val customTheme: Int? = null
|
||||||
|
|
||||||
|
plugin.startPlugin(
|
||||||
|
activity,
|
||||||
|
fragment.launcher,
|
||||||
|
customTheme
|
||||||
|
)
|
||||||
|
|
||||||
|
promise.resolve("PluginStarted")
|
||||||
|
} catch (e: Exception) {
|
||||||
|
promise.reject("START_ERROR", e.message, e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class WebIdResultHostFragment : Fragment() {
|
||||||
|
|
||||||
|
private var onResult: ((resultCode: Int, data: Intent?) -> Unit)? = null
|
||||||
|
|
||||||
|
lateinit var launcher: ActivityResultLauncher<Intent>
|
||||||
|
private set
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: android.os.Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
launcher =
|
||||||
|
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
|
||||||
|
onResult?.invoke(result.resultCode, result.data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val NAME = "WebIdMetaPlugin"
|
private const val TAG = "WebIdResultHostFragment"
|
||||||
|
|
||||||
|
fun getOrCreate(
|
||||||
|
activity: FragmentActivity,
|
||||||
|
onResult: (resultCode: Int, data: Intent?) -> Unit
|
||||||
|
): WebIdResultHostFragment {
|
||||||
|
val fm = activity.supportFragmentManager
|
||||||
|
|
||||||
|
val existing = fm.findFragmentByTag(TAG) as? WebIdResultHostFragment
|
||||||
|
if (existing != null) {
|
||||||
|
existing.onResult = onResult
|
||||||
|
return existing
|
||||||
|
}
|
||||||
|
|
||||||
|
val fragment = WebIdResultHostFragment().apply {
|
||||||
|
this.onResult = onResult
|
||||||
|
}
|
||||||
|
|
||||||
|
fm.beginTransaction()
|
||||||
|
.add(fragment, TAG)
|
||||||
|
.commitNowAllowingStateLoss()
|
||||||
|
|
||||||
|
return fragment
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
apply plugin: "com.android.application"
|
plugins {
|
||||||
apply plugin: "org.jetbrains.kotlin.android"
|
id("com.android.application")
|
||||||
apply plugin: "com.facebook.react"
|
id("org.jetbrains.kotlin.android")
|
||||||
|
id("com.facebook.react")
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the configuration block to customize your React Native Android app.
|
* This is the configuration block to customize your React Native Android app.
|
||||||
@ -75,7 +77,8 @@ def jscFlavor = 'org.webkit:android-jsc:+'
|
|||||||
android {
|
android {
|
||||||
ndkVersion rootProject.ext.ndkVersion
|
ndkVersion rootProject.ext.ndkVersion
|
||||||
buildToolsVersion rootProject.ext.buildToolsVersion
|
buildToolsVersion rootProject.ext.buildToolsVersion
|
||||||
compileSdk rootProject.ext.compileSdkVersion
|
compileSdk 35
|
||||||
|
|
||||||
|
|
||||||
namespace "webidmetaplugin.example"
|
namespace "webidmetaplugin.example"
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
@ -84,6 +87,8 @@ android {
|
|||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", (project.hasProperty("newArchEnabled") ? project.getProperty("newArchEnabled") : "false")
|
||||||
|
|
||||||
}
|
}
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
debug {
|
debug {
|
||||||
|
|||||||
@ -9,7 +9,10 @@ import com.facebook.react.ReactPackage
|
|||||||
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
|
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
|
||||||
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
|
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
|
||||||
import com.facebook.react.defaults.DefaultReactNativeHost
|
import com.facebook.react.defaults.DefaultReactNativeHost
|
||||||
|
import com.facebook.react.soloader.OpenSourceMergedSoMapping
|
||||||
import com.facebook.soloader.SoLoader
|
import com.facebook.soloader.SoLoader
|
||||||
|
import com.webidmetaplugin.WebIdMetaPluginPackage
|
||||||
|
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
|
||||||
|
|
||||||
class MainApplication : Application(), ReactApplication {
|
class MainApplication : Application(), ReactApplication {
|
||||||
|
|
||||||
@ -17,16 +20,16 @@ class MainApplication : Application(), ReactApplication {
|
|||||||
object : DefaultReactNativeHost(this) {
|
object : DefaultReactNativeHost(this) {
|
||||||
override fun getPackages(): List<ReactPackage> =
|
override fun getPackages(): List<ReactPackage> =
|
||||||
PackageList(this).packages.apply {
|
PackageList(this).packages.apply {
|
||||||
// Packages that cannot be autolinked yet can be added manually here, for example:
|
add(WebIdMetaPluginPackage())
|
||||||
// add(MyReactNativePackage())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getJSMainModuleName(): String = "index"
|
override fun getJSMainModuleName(): String = "index"
|
||||||
|
|
||||||
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
|
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
|
||||||
|
|
||||||
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
|
||||||
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
|
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
|
||||||
|
|
||||||
|
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
||||||
}
|
}
|
||||||
|
|
||||||
override val reactHost: ReactHost
|
override val reactHost: ReactHost
|
||||||
@ -34,9 +37,8 @@ class MainApplication : Application(), ReactApplication {
|
|||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
SoLoader.init(this, false)
|
SoLoader.init(this, OpenSourceMergedSoMapping)
|
||||||
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
||||||
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
||||||
load()
|
load()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,21 +1,20 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
buildToolsVersion = "34.0.0"
|
buildToolsVersion = "35.0.0"
|
||||||
minSdkVersion = 23
|
minSdkVersion = 28
|
||||||
compileSdkVersion = 34
|
compileSdkVersion = 35
|
||||||
targetSdkVersion = 34
|
targetSdkVersion = 35
|
||||||
ndkVersion = "26.1.10909125"
|
ndkVersion = "26.1.10909125"
|
||||||
kotlinVersion = "1.9.24"
|
kotlinVersion = "2.1.20"
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
|
||||||
classpath("com.android.tools.build:gradle")
|
|
||||||
classpath("com.facebook.react:react-native-gradle-plugin")
|
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: "com.facebook.react.rootproject"
|
dependencies {
|
||||||
|
classpath("com.android.tools.build:gradle:8.6.0")
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.20")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@ -1,6 +1,43 @@
|
|||||||
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
|
pluginManagement {
|
||||||
plugins { id("com.facebook.react.settings") }
|
repositories {
|
||||||
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
|
gradlePluginPortal()
|
||||||
rootProject.name = 'webidmetaplugin.example'
|
google()
|
||||||
include ':app'
|
mavenCentral()
|
||||||
includeBuild('../node_modules/@react-native/gradle-plugin')
|
}
|
||||||
|
|
||||||
|
resolutionStrategy {
|
||||||
|
eachPlugin {
|
||||||
|
if (requested.id.id == "org.jetbrains.kotlin.android") {
|
||||||
|
useVersion("2.1.20")
|
||||||
|
}
|
||||||
|
if (requested.id.id == "org.jetbrains.kotlin.jvm") {
|
||||||
|
useVersion("2.1.20")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
includeBuild("../node_modules/@react-native/gradle-plugin")
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("com.facebook.react.settings")
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencyResolutionManagement {
|
||||||
|
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
|
||||||
|
maven {
|
||||||
|
url 'https://api.webid-solutions.de/releases/android/maven/repository/internal'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
extensions.configure(com.facebook.react.ReactSettingsExtension) { ex ->
|
||||||
|
ex.autolinkLibrariesFromCommand()
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.name = "webidmetaplugin.example"
|
||||||
|
include(":app")
|
||||||
|
|||||||
@ -53,6 +53,7 @@
|
|||||||
4058D6922F19726100498E39 /* WebIdVideoIdentProductPlugin.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 48F71C442C80D0DF00BD6B5D /* WebIdVideoIdentProductPlugin.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
4058D6922F19726100498E39 /* WebIdVideoIdentProductPlugin.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 48F71C442C80D0DF00BD6B5D /* WebIdVideoIdentProductPlugin.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||||
6DE0A3D7B22BC1FF2E727057 /* libPods-WebIdMetaPluginExample-WebIdMetaPluginExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4685DC1BED0D20ECAC1ED4EC /* libPods-WebIdMetaPluginExample-WebIdMetaPluginExampleTests.a */; };
|
6DE0A3D7B22BC1FF2E727057 /* libPods-WebIdMetaPluginExample-WebIdMetaPluginExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4685DC1BED0D20ECAC1ED4EC /* libPods-WebIdMetaPluginExample-WebIdMetaPluginExampleTests.a */; };
|
||||||
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
|
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
|
||||||
|
B5ABC6AE66EFC36DA14A4175 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 3A271875C9F09281B4786E72 /* PrivacyInfo.xcprivacy */; };
|
||||||
C88BC4EF9171E4119C4DE09A /* libPods-WebIdMetaPluginExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A790AFDC34C073FF67478665 /* libPods-WebIdMetaPluginExample.a */; };
|
C88BC4EF9171E4119C4DE09A /* libPods-WebIdMetaPluginExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A790AFDC34C073FF67478665 /* libPods-WebIdMetaPluginExample.a */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
@ -106,6 +107,7 @@
|
|||||||
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = WebIdMetaPluginExample/Images.xcassets; sourceTree = "<group>"; };
|
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = WebIdMetaPluginExample/Images.xcassets; sourceTree = "<group>"; };
|
||||||
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = WebIdMetaPluginExample/Info.plist; sourceTree = "<group>"; };
|
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = WebIdMetaPluginExample/Info.plist; sourceTree = "<group>"; };
|
||||||
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = WebIdMetaPluginExample/main.m; sourceTree = "<group>"; };
|
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = WebIdMetaPluginExample/main.m; sourceTree = "<group>"; };
|
||||||
|
3A271875C9F09281B4786E72 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = WebIdMetaPluginExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
|
||||||
40A7A7232F18352D00A4B1CE /* WebIdAutoIdentOnServerProductPlugin.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = WebIdAutoIdentOnServerProductPlugin.xcframework; path = Pods/WebIdAutoIdentOnServerProductPlugin/WebIdAutoIdentOnServerProductPlugin.xcframework; sourceTree = "<group>"; };
|
40A7A7232F18352D00A4B1CE /* WebIdAutoIdentOnServerProductPlugin.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = WebIdAutoIdentOnServerProductPlugin.xcframework; path = Pods/WebIdAutoIdentOnServerProductPlugin/WebIdAutoIdentOnServerProductPlugin.xcframework; sourceTree = "<group>"; };
|
||||||
40A7A7262F1835A400A4B1CE /* WebIdEIdOnServerProductPlugin.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = WebIdEIdOnServerProductPlugin.xcframework; path = Pods/WebIdEIdOnServerProductPlugin/WebIdEIdOnServerProductPlugin.xcframework; sourceTree = "<group>"; };
|
40A7A7262F1835A400A4B1CE /* WebIdEIdOnServerProductPlugin.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = WebIdEIdOnServerProductPlugin.xcframework; path = Pods/WebIdEIdOnServerProductPlugin/WebIdEIdOnServerProductPlugin.xcframework; sourceTree = "<group>"; };
|
||||||
40A7A7292F1835B400A4B1CE /* WebIdEIdentPlugin.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = WebIdEIdentPlugin.xcframework; path = Pods/WebIdEIdentPlugin/WebIdEIdentPlugin.xcframework; sourceTree = "<group>"; };
|
40A7A7292F1835B400A4B1CE /* WebIdEIdentPlugin.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = WebIdEIdentPlugin.xcframework; path = Pods/WebIdEIdentPlugin/WebIdEIdentPlugin.xcframework; sourceTree = "<group>"; };
|
||||||
@ -206,6 +208,7 @@
|
|||||||
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
|
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
|
||||||
13B07FB71A68108700A75B9A /* main.m */,
|
13B07FB71A68108700A75B9A /* main.m */,
|
||||||
EF15005B197F2F6F6438D520 /* PrivacyInfo.xcprivacy */,
|
EF15005B197F2F6F6438D520 /* PrivacyInfo.xcprivacy */,
|
||||||
|
3A271875C9F09281B4786E72 /* PrivacyInfo.xcprivacy */,
|
||||||
);
|
);
|
||||||
name = WebIdMetaPluginExample;
|
name = WebIdMetaPluginExample;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -377,6 +380,7 @@
|
|||||||
files = (
|
files = (
|
||||||
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
|
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
|
||||||
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
|
||||||
|
B5ABC6AE66EFC36DA14A4175 /* PrivacyInfo.xcprivacy in Resources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@ -733,7 +737,10 @@
|
|||||||
"-DFOLLY_CFG_NO_COROUTINES=1",
|
"-DFOLLY_CFG_NO_COROUTINES=1",
|
||||||
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
|
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
|
||||||
);
|
);
|
||||||
OTHER_LDFLAGS = "$(inherited) ";
|
OTHER_LDFLAGS = (
|
||||||
|
"$(inherited)",
|
||||||
|
" ",
|
||||||
|
);
|
||||||
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) DEBUG";
|
||||||
@ -817,7 +824,10 @@
|
|||||||
"-DFOLLY_CFG_NO_COROUTINES=1",
|
"-DFOLLY_CFG_NO_COROUTINES=1",
|
||||||
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
|
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
|
||||||
);
|
);
|
||||||
OTHER_LDFLAGS = "$(inherited) ";
|
OTHER_LDFLAGS = (
|
||||||
|
"$(inherited)",
|
||||||
|
" ",
|
||||||
|
);
|
||||||
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
|
||||||
SDKROOT = iphoneos;
|
SDKROOT = iphoneos;
|
||||||
USE_HERMES = true;
|
USE_HERMES = true;
|
||||||
|
|||||||
@ -10,17 +10,17 @@
|
|||||||
"build:ios": "react-native build-ios --scheme WebIdMetaPluginExample --mode Debug --extra-params \"-sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO\""
|
"build:ios": "react-native build-ios --scheme WebIdMetaPluginExample --mode Debug --extra-params \"-sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO\""
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"react": "18.3.1",
|
"react": "19.2.3",
|
||||||
"react-native": "0.75.2",
|
"react-native": "0.84.0",
|
||||||
"react-native-bouncy-checkbox": "^4.1.4"
|
"react-native-bouncy-checkbox": "^4.1.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.20.0",
|
"@babel/core": "^7.20.0",
|
||||||
"@babel/preset-env": "^7.20.0",
|
"@babel/preset-env": "^7.20.0",
|
||||||
"@babel/runtime": "^7.20.0",
|
"@babel/runtime": "^7.20.0",
|
||||||
"@react-native/babel-preset": "0.75.2",
|
"@react-native/babel-preset": "0.84.0",
|
||||||
"@react-native/metro-config": "0.75.2",
|
"@react-native/metro-config": "0.84.0",
|
||||||
"@react-native/typescript-config": "0.75.2",
|
"@react-native/typescript-config": "0.84.0",
|
||||||
"react-native-builder-bob": "^0.30.0",
|
"react-native-builder-bob": "^0.30.0",
|
||||||
"react-native-dotenv": "^3.4.9"
|
"react-native-dotenv": "^3.4.9"
|
||||||
},
|
},
|
||||||
|
|||||||
@ -25,11 +25,20 @@ import BouncyCheckbox from 'react-native-bouncy-checkbox';
|
|||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
const [actionId, onChangeActionId] = React.useState('');
|
const [actionId, onChangeActionId] = React.useState('');
|
||||||
var selectedPlugins: Set<string> = new Set();
|
|
||||||
|
|
||||||
|
const [selectedPlugins, setSelectedPlugins] = React.useState<string[]>([]);
|
||||||
|
|
||||||
|
const togglePlugin = (name: string, isChecked: boolean) => {
|
||||||
|
setSelectedPlugins((prev) => {
|
||||||
|
const next = new Set(prev);
|
||||||
|
if (isChecked) next.add(name);
|
||||||
|
else next.delete(name);
|
||||||
|
return Array.from(next);
|
||||||
|
});
|
||||||
|
};
|
||||||
webIdEventEmitter.addListener(WebIdSdkEvent.finishedFailed, (eventData) => {
|
webIdEventEmitter.addListener(WebIdSdkEvent.finishedFailed, (eventData) => {
|
||||||
let result = parseJSONToType<ProductPluginResultFailed>(eventData);
|
let result = parseJSONToType<ProductPluginResultFailed>(eventData);
|
||||||
if (result != undefined) {
|
if (result !== undefined) {
|
||||||
console.log(
|
console.log(
|
||||||
'received failed event with result code: ',
|
'received failed event with result code: ',
|
||||||
result.genericResultCode
|
result.genericResultCode
|
||||||
@ -39,7 +48,7 @@ export default function App() {
|
|||||||
|
|
||||||
webIdEventEmitter.addListener(WebIdSdkEvent.finishedSuccess, (eventData) => {
|
webIdEventEmitter.addListener(WebIdSdkEvent.finishedSuccess, (eventData) => {
|
||||||
let result = parseJSONToType<ProductPluginResultSuccess>(eventData);
|
let result = parseJSONToType<ProductPluginResultSuccess>(eventData);
|
||||||
if (result != undefined) {
|
if (result !== undefined) {
|
||||||
console.log(
|
console.log(
|
||||||
'received failed event with process finished: ',
|
'received failed event with process finished: ',
|
||||||
result.processFinished
|
result.processFinished
|
||||||
@ -48,12 +57,18 @@ export default function App() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
paddingHorizontal: 16,
|
||||||
|
paddingBottom: 16,
|
||||||
|
paddingTop: 64,
|
||||||
|
},
|
||||||
input: {
|
input: {
|
||||||
height: 40,
|
height: 40,
|
||||||
margin: 12,
|
margin: 12,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
padding: 10,
|
padding: 10,
|
||||||
},
|
},
|
||||||
|
btn: { marginVertical: 8 },
|
||||||
});
|
});
|
||||||
|
|
||||||
const showAlert = (title: string, message: string) => {
|
const showAlert = (title: string, message: string) => {
|
||||||
@ -63,13 +78,7 @@ export default function App() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onCreateMetaPlugin = () => {
|
const onCreateMetaPlugin = () => {
|
||||||
createMetaPlugin(
|
createMetaPlugin(URL, USERNAME, API_KEY, [CERT_BASE64], selectedPlugins)
|
||||||
URL,
|
|
||||||
USERNAME,
|
|
||||||
API_KEY,
|
|
||||||
[CERT_BASE64],
|
|
||||||
Array.from(selectedPlugins)
|
|
||||||
)
|
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
showAlert('Success', data);
|
showAlert('Success', data);
|
||||||
})
|
})
|
||||||
@ -119,66 +128,64 @@ export default function App() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView>
|
<SafeAreaView style={styles.container}>
|
||||||
<StatusBar />
|
<StatusBar />
|
||||||
<View>
|
<View>
|
||||||
<View>
|
<View>
|
||||||
<View>
|
<View>
|
||||||
<BouncyCheckbox
|
<BouncyCheckbox
|
||||||
isChecked={selectedPlugins.has('AutoIdOnServer')}
|
isChecked={selectedPlugins.includes('AutoIdOnServer')}
|
||||||
onPress={(isChecked: boolean) =>
|
onPress={(isChecked: boolean) =>
|
||||||
isChecked === true
|
togglePlugin('AutoIdOnServer', isChecked)
|
||||||
? selectedPlugins.add('AutoIdOnServer')
|
|
||||||
: selectedPlugins.delete('AutoIdOnServer')
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Text>AutoIdOnServer</Text>
|
<Text>AutoIdOnServer</Text>
|
||||||
</View>
|
</View>
|
||||||
<View>
|
<View>
|
||||||
<BouncyCheckbox
|
<BouncyCheckbox
|
||||||
isChecked={selectedPlugins.has('PayOnServer')}
|
isChecked={selectedPlugins.includes('PayOnServer')}
|
||||||
onPress={(isChecked: boolean) =>
|
onPress={(isChecked: boolean) =>
|
||||||
isChecked === true
|
togglePlugin('PayOnServer', isChecked)
|
||||||
? selectedPlugins.add('PayOnServer')
|
|
||||||
: selectedPlugins.delete('PayOnServer')
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Text>PayOnServer</Text>
|
<Text>PayOnServer</Text>
|
||||||
</View>
|
</View>
|
||||||
<View>
|
<View>
|
||||||
<BouncyCheckbox
|
<BouncyCheckbox
|
||||||
isChecked={selectedPlugins.has('VideoId')}
|
isChecked={selectedPlugins.includes('VideoId')}
|
||||||
onPress={(isChecked: boolean) =>
|
onPress={(isChecked: boolean) =>
|
||||||
isChecked === true
|
togglePlugin('VideoId', isChecked)
|
||||||
? selectedPlugins.add('VideoId')
|
|
||||||
: selectedPlugins.delete('VideoId')
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Text>VideoId</Text>
|
<Text>VideoId</Text>
|
||||||
</View>
|
</View>
|
||||||
<View>
|
<View>
|
||||||
<BouncyCheckbox
|
<BouncyCheckbox
|
||||||
isChecked={selectedPlugins.has('EIdOnServer')}
|
isChecked={selectedPlugins.includes('EIdOnServer')}
|
||||||
onPress={(isChecked: boolean) =>
|
onPress={(isChecked: boolean) =>
|
||||||
isChecked === true
|
togglePlugin('EIdOnServer', isChecked)
|
||||||
? selectedPlugins.add('EIdOnServer')
|
|
||||||
: selectedPlugins.delete('EIdOnServer')
|
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Text>EIdOnServer</Text>
|
<Text>EIdOnServer</Text>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
|
|
||||||
|
<View style={styles.btn}>
|
||||||
<Button title="Create Meta Plugin" onPress={onCreateMetaPlugin} />
|
<Button title="Create Meta Plugin" onPress={onCreateMetaPlugin} />
|
||||||
|
</View>
|
||||||
<TextInput
|
<TextInput
|
||||||
style={styles.input}
|
style={styles.input}
|
||||||
onChangeText={onChangeActionId}
|
onChangeText={onChangeActionId}
|
||||||
value={actionId}
|
value={actionId}
|
||||||
placeholder="Action Id"
|
placeholder="Action Id"
|
||||||
/>
|
/>
|
||||||
|
<View style={styles.btn}>
|
||||||
<Button title="Verify Action Id" onPress={onVerifyActionId} />
|
<Button title="Verify Action Id" onPress={onVerifyActionId} />
|
||||||
|
</View>
|
||||||
|
<View style={styles.btn}>
|
||||||
<Button title="Start" onPress={onStart} />
|
<Button title="Start" onPress={onStart} />
|
||||||
</View>
|
</View>
|
||||||
|
</View>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
24
package.json
24
package.json
@ -7,6 +7,10 @@
|
|||||||
"module": "./lib/module/index.js",
|
"module": "./lib/module/index.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
|
"react-native": {
|
||||||
|
"types": "./src/index.tsx",
|
||||||
|
"default": "./src/index.tsx"
|
||||||
|
},
|
||||||
"import": {
|
"import": {
|
||||||
"types": "./lib/typescript/module/src/index.d.ts",
|
"types": "./lib/typescript/module/src/index.d.ts",
|
||||||
"default": "./lib/module/index.js"
|
"default": "./lib/module/index.js"
|
||||||
@ -65,19 +69,21 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/config-conventional": "^17.0.2",
|
"@commitlint/config-conventional": "^17.0.2",
|
||||||
"@evilmartians/lefthook": "^1.5.0",
|
"@evilmartians/lefthook": "^1.5.0",
|
||||||
"@react-native/eslint-config": "^0.73.1",
|
"@react-native-community/cli": "latest",
|
||||||
|
"@react-native/eslint-config": "^0.84.0",
|
||||||
"@release-it/conventional-changelog": "^5.0.0",
|
"@release-it/conventional-changelog": "^5.0.0",
|
||||||
"@types/jest": "^29.5.5",
|
"@types/jest": "^29.5.5",
|
||||||
"@types/react": "^18.2.44",
|
"@types/react": "^19.2.14",
|
||||||
|
"@types/react-dom": "^19.2.3",
|
||||||
"commitlint": "^17.0.2",
|
"commitlint": "^17.0.2",
|
||||||
"del-cli": "^5.1.0",
|
"del-cli": "^5.1.0",
|
||||||
"eslint": "^8.51.0",
|
"eslint": "^8.51.0",
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"eslint-config-prettier": "^9.1.2",
|
||||||
"eslint-plugin-prettier": "^5.0.1",
|
"eslint-plugin-prettier": "^5.5.5",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.8.1",
|
||||||
"react": "18.3.1",
|
"react": "^19.2.4",
|
||||||
"react-native": "0.75.2",
|
"react-native": "0.84.0",
|
||||||
"react-native-builder-bob": "^0.30.0",
|
"react-native-builder-bob": "^0.30.0",
|
||||||
"release-it": "^15.0.0",
|
"release-it": "^15.0.0",
|
||||||
"turbo": "^1.10.7",
|
"turbo": "^1.10.7",
|
||||||
@ -129,6 +135,9 @@
|
|||||||
"@react-native",
|
"@react-native",
|
||||||
"prettier"
|
"prettier"
|
||||||
],
|
],
|
||||||
|
"plugins": [
|
||||||
|
"prettier"
|
||||||
|
],
|
||||||
"rules": {
|
"rules": {
|
||||||
"react/react-in-jsx-scope": "off",
|
"react/react-in-jsx-scope": "off",
|
||||||
"prettier/prettier": [
|
"prettier/prettier": [
|
||||||
@ -185,6 +194,7 @@
|
|||||||
"version": "0.41.0"
|
"version": "0.41.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"react-dom": "^19.2.4",
|
||||||
"react-native-bouncy-checkbox": "^4.1.4"
|
"react-native-bouncy-checkbox": "^4.1.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,7 +40,7 @@ export function verifyActionId(actionId: string): Promise<VerifyActionResult> {
|
|||||||
try {
|
try {
|
||||||
const json = await WebIdMetaPlugin.verifyActionId(actionId);
|
const json = await WebIdMetaPlugin.verifyActionId(actionId);
|
||||||
let verifyActionResult = parseJSONToType<VerifyActionResult>(json);
|
let verifyActionResult = parseJSONToType<VerifyActionResult>(json);
|
||||||
if (verifyActionId != undefined) {
|
if (verifyActionId !== undefined) {
|
||||||
resolve(verifyActionResult!);
|
resolve(verifyActionResult!);
|
||||||
} else {
|
} else {
|
||||||
reject('JSON parsing failed');
|
reject('JSON parsing failed');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user