Compare commits
No commits in common. "8baac451876024d90b393130328d2397148887b7" and "854dfef19786597d2465faa1bfc6f3f0d52cc6dc" have entirely different histories.
8baac45187
...
854dfef197
6
.gitignore
vendored
6
.gitignore
vendored
@ -69,6 +69,7 @@ android/keystores/debug.keystore
|
|||||||
!.yarn/versions
|
!.yarn/versions
|
||||||
|
|
||||||
# Expo
|
# Expo
|
||||||
|
.expo/
|
||||||
|
|
||||||
# Turborepo
|
# Turborepo
|
||||||
.turbo/
|
.turbo/
|
||||||
@ -80,7 +81,4 @@ lib/
|
|||||||
ios/generated
|
ios/generated
|
||||||
android/generated
|
android/generated
|
||||||
|
|
||||||
.env
|
.env
|
||||||
/package-lock.json
|
|
||||||
/example/package-lock.json
|
|
||||||
/example/Gemfile.lock
|
|
||||||
56
README.md
56
README.md
@ -2,69 +2,21 @@
|
|||||||
|
|
||||||
> **Disclaimer**
|
> **Disclaimer**
|
||||||
>
|
>
|
||||||
> This repository contains a proof-of-concept React Native plugin and an example mobile application intended solely for technical evaluation.
|
> This repository contains a proof-of-concept React Native plugin and an example mobile application intended solely for technical evaluation.
|
||||||
>
|
>
|
||||||
> Only the iOS integration has been verified to work at this time.
|
> Only the iOS integration has been verified to work at this time.
|
||||||
> The Android bridge and Android example setup exist but have not been tested and are expected to require additional adjustments before they can be considered functional.
|
> The Android bridge and Android example setup exist but have not been tested and are expected to require additional adjustments before they can be considered functional.
|
||||||
>
|
>
|
||||||
> This repository is **experimental**, **not formally approved**, **not officially released**, **not published as an npm package**, and **not endorsed by WebID for
|
> This repository is **experimental**, **not formally approved**, **not officially released**, **not published as an npm package**, and **not endorsed by WebID for
|
||||||
> production use**.
|
> production use**.
|
||||||
>
|
>
|
||||||
> The setup described below includes non-standard workarounds and temporary configuration adjustments that are required due to current
|
> The setup described below includes non-standard workarounds and temporary configuration adjustments that are required due to current
|
||||||
> tooling and dependency constraints.
|
> tooling and dependency constraints.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# Android
|
# Android
|
||||||
## Prerequisites
|
_Android instructions will be added in a future commit._
|
||||||
- React Native version must be compatible with Kotlin 2.1
|
|
||||||
(Your host app + Gradle + Kotlin versions must match. If the native module uses Kotlin 2.1, the app must not force an incompatible Kotlin version.)
|
|
||||||
- Java 17
|
|
||||||
- Android Studio (includes Android SDK + Platform Tools / adb)
|
|
||||||
|
|
||||||
## Running the example app (Android)
|
|
||||||
|
|
||||||
### Create and Configure the `.env` File
|
|
||||||
|
|
||||||
Navigate to the example project and create the environment file:
|
|
||||||
|
|
||||||
```
|
|
||||||
cd example
|
|
||||||
cp .env.example .env
|
|
||||||
```
|
|
||||||
### Example:
|
|
||||||
|
|
||||||
```
|
|
||||||
URL=https://test.webid-solutions.de
|
|
||||||
USERNAME=your_username
|
|
||||||
API_KEY=your_api_key
|
|
||||||
CERT_BASE64=On ANdroid it need to be SHA-PINS
|
|
||||||
# SHA_PINS=sha256/AAAA...,sha256/BBBB...
|
|
||||||
```
|
|
||||||
|
|
||||||
Edit the .env file and add your username and API key.
|
|
||||||
|
|
||||||
### Install Dependencies
|
|
||||||
|
|
||||||
From the repository root:
|
|
||||||
|
|
||||||
```
|
|
||||||
yarn install
|
|
||||||
```
|
|
||||||
|
|
||||||
### Running the App
|
|
||||||
|
|
||||||
Then navigate to the iOS example project:
|
|
||||||
|
|
||||||
```
|
|
||||||
cd example/android
|
|
||||||
yarn start
|
|
||||||
```
|
|
||||||
In a second terminal:
|
|
||||||
```
|
|
||||||
cd example
|
|
||||||
yarn android
|
|
||||||
```
|
|
||||||
|
|
||||||
# iOS
|
# iOS
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,19 @@
|
|||||||
|
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"]
|
||||||
@ -10,6 +26,10 @@ 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]
|
||||||
}
|
}
|
||||||
@ -62,35 +82,18 @@ 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.google.code.gson:gson:2.10.1"
|
implementation "com.facebook.react:react-native:+"
|
||||||
|
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=2.1.20
|
WebIdMetaPlugin_kotlinVersion=1.7.0
|
||||||
WebIdMetaPlugin_minSdkVersion=21
|
WebIdMetaPlugin_minSdkVersion=21
|
||||||
WebIdMetaPlugin_targetSdkVersion=31
|
WebIdMetaPlugin_targetSdkVersion=31
|
||||||
WebIdMetaPlugin_compileSdkVersion=31
|
WebIdMetaPlugin_compileSdkVersion=31
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
dependencyResolutionManagement {
|
|
||||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
mavenCentral()
|
|
||||||
|
|
||||||
maven {
|
|
||||||
url 'https://api.webid-solutions.de/releases/android/maven/repository/internal'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,223 +1,25 @@
|
|||||||
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.ReadableArray
|
import com.facebook.react.bridge.Promise
|
||||||
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
|
|
||||||
|
|
||||||
private const val TAG = "WebIdMetaPlugin"
|
class WebIdMetaPluginModule(reactContext: ReactApplicationContext) :
|
||||||
|
ReactContextBaseJavaModule(reactContext) {
|
||||||
|
|
||||||
class WebIdMetaPluginModule(
|
override fun getName(): String {
|
||||||
private val reactContext: ReactApplicationContext
|
return NAME
|
||||||
) : 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)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private var listenerCount = 0
|
// Example method
|
||||||
|
// See https://reactnative.dev/docs/native-modules-android
|
||||||
@ReactMethod
|
@ReactMethod
|
||||||
fun addListener(eventName: String) {
|
fun multiply(a: Double, b: Double, promise: Promise) {
|
||||||
listenerCount += 1
|
promise.resolve(a * b)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ReactMethod
|
companion object {
|
||||||
fun removeListeners(count: Int) {
|
const val NAME = "WebIdMetaPlugin"
|
||||||
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() }
|
|
||||||
|
|
||||||
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(VideoOptionsConfig()))
|
|
||||||
"EIdOnServer" -> selectedPlugins.add(EIdOnServerProductPlugin())
|
|
||||||
else -> Log.w(TAG, "createMetaPlugin unknown plugin string='$p'")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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 {
|
|
||||||
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,8 +1,6 @@
|
|||||||
plugins {
|
apply plugin: "com.android.application"
|
||||||
id("com.android.application")
|
apply plugin: "org.jetbrains.kotlin.android"
|
||||||
id("org.jetbrains.kotlin.android")
|
apply plugin: "com.facebook.react"
|
||||||
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.
|
||||||
@ -77,18 +75,15 @@ 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 35
|
compileSdk rootProject.ext.compileSdkVersion
|
||||||
|
|
||||||
|
namespace "webidmetaplugin.example"
|
||||||
namespace "webidmetaplugin.example"
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "webidmetaplugin.example"
|
applicationId "webidmetaplugin.example"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
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,36 +9,34 @@ 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 {
|
||||||
|
|
||||||
override val reactNativeHost: ReactNativeHost =
|
override val reactNativeHost: ReactNativeHost =
|
||||||
object : DefaultReactNativeHost(this) {
|
object : DefaultReactNativeHost(this) {
|
||||||
override fun getPackages(): List<ReactPackage> =
|
override fun getPackages(): List<ReactPackage> =
|
||||||
PackageList(this).packages.apply {
|
PackageList(this).packages.apply {
|
||||||
add(WebIdMetaPluginPackage())
|
// Packages that cannot be autolinked yet can be added manually here, for example:
|
||||||
}
|
// 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 isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
|
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_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
|
||||||
get() = getDefaultReactHost(applicationContext, reactNativeHost)
|
get() = getDefaultReactHost(applicationContext, reactNativeHost)
|
||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
SoLoader.init(this, OpenSourceMergedSoMapping)
|
SoLoader.init(this, false)
|
||||||
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,20 +1,21 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
buildToolsVersion = "35.0.0"
|
buildToolsVersion = "34.0.0"
|
||||||
minSdkVersion = 28
|
minSdkVersion = 23
|
||||||
compileSdkVersion = 35
|
compileSdkVersion = 34
|
||||||
targetSdkVersion = 35
|
targetSdkVersion = 34
|
||||||
ndkVersion = "26.1.10909125"
|
ndkVersion = "26.1.10909125"
|
||||||
kotlinVersion = "2.1.20"
|
kotlinVersion = "1.9.24"
|
||||||
}
|
}
|
||||||
|
repositories {
|
||||||
repositories {
|
google()
|
||||||
google()
|
mavenCentral()
|
||||||
mavenCentral()
|
}
|
||||||
}
|
dependencies {
|
||||||
|
classpath("com.android.tools.build:gradle")
|
||||||
dependencies {
|
classpath("com.facebook.react:react-native-gradle-plugin")
|
||||||
classpath("com.android.tools.build:gradle:8.6.0")
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.20")
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
apply plugin: "com.facebook.react.rootproject"
|
||||||
|
|||||||
@ -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.13-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@ -1,43 +1,6 @@
|
|||||||
pluginManagement {
|
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
|
||||||
repositories {
|
plugins { id("com.facebook.react.settings") }
|
||||||
gradlePluginPortal()
|
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
|
||||||
google()
|
rootProject.name = 'webidmetaplugin.example'
|
||||||
mavenCentral()
|
include ':app'
|
||||||
}
|
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,7 +53,6 @@
|
|||||||
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 */
|
||||||
|
|
||||||
@ -107,7 +106,6 @@
|
|||||||
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>"; };
|
||||||
@ -208,7 +206,6 @@
|
|||||||
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>";
|
||||||
@ -380,7 +377,6 @@
|
|||||||
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;
|
||||||
};
|
};
|
||||||
@ -737,10 +733,7 @@
|
|||||||
"-DFOLLY_CFG_NO_COROUTINES=1",
|
"-DFOLLY_CFG_NO_COROUTINES=1",
|
||||||
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
|
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
|
||||||
);
|
);
|
||||||
OTHER_LDFLAGS = (
|
OTHER_LDFLAGS = "$(inherited) ";
|
||||||
"$(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";
|
||||||
@ -824,10 +817,7 @@
|
|||||||
"-DFOLLY_CFG_NO_COROUTINES=1",
|
"-DFOLLY_CFG_NO_COROUTINES=1",
|
||||||
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
|
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
|
||||||
);
|
);
|
||||||
OTHER_LDFLAGS = (
|
OTHER_LDFLAGS = "$(inherited) ";
|
||||||
"$(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": "19.2.3",
|
"react": "18.3.1",
|
||||||
"react-native": "0.84.0",
|
"react-native": "0.75.2",
|
||||||
"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.84.0",
|
"@react-native/babel-preset": "0.75.2",
|
||||||
"@react-native/metro-config": "0.84.0",
|
"@react-native/metro-config": "0.75.2",
|
||||||
"@react-native/typescript-config": "0.84.0",
|
"@react-native/typescript-config": "0.75.2",
|
||||||
"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,20 +25,11 @@ 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
|
||||||
@ -48,7 +39,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
|
||||||
@ -57,18 +48,12 @@ 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) => {
|
||||||
@ -78,7 +63,13 @@ export default function App() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onCreateMetaPlugin = () => {
|
const onCreateMetaPlugin = () => {
|
||||||
createMetaPlugin(URL, USERNAME, API_KEY, [CERT_BASE64], selectedPlugins)
|
createMetaPlugin(
|
||||||
|
URL,
|
||||||
|
USERNAME,
|
||||||
|
API_KEY,
|
||||||
|
[CERT_BASE64],
|
||||||
|
Array.from(selectedPlugins)
|
||||||
|
)
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
showAlert('Success', data);
|
showAlert('Success', data);
|
||||||
})
|
})
|
||||||
@ -128,63 +119,65 @@ export default function App() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SafeAreaView style={styles.container}>
|
<SafeAreaView>
|
||||||
<StatusBar />
|
<StatusBar />
|
||||||
<View>
|
<View>
|
||||||
<View>
|
<View>
|
||||||
<View>
|
<View>
|
||||||
<BouncyCheckbox
|
<BouncyCheckbox
|
||||||
isChecked={selectedPlugins.includes('AutoIdOnServer')}
|
isChecked={selectedPlugins.has('AutoIdOnServer')}
|
||||||
onPress={(isChecked: boolean) =>
|
onPress={(isChecked: boolean) =>
|
||||||
togglePlugin('AutoIdOnServer', isChecked)
|
isChecked === true
|
||||||
|
? selectedPlugins.add('AutoIdOnServer')
|
||||||
|
: selectedPlugins.delete('AutoIdOnServer')
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Text>AutoIdOnServer</Text>
|
<Text>AutoIdOnServer</Text>
|
||||||
</View>
|
</View>
|
||||||
<View>
|
<View>
|
||||||
<BouncyCheckbox
|
<BouncyCheckbox
|
||||||
isChecked={selectedPlugins.includes('PayOnServer')}
|
isChecked={selectedPlugins.has('PayOnServer')}
|
||||||
onPress={(isChecked: boolean) =>
|
onPress={(isChecked: boolean) =>
|
||||||
togglePlugin('PayOnServer', isChecked)
|
isChecked === true
|
||||||
|
? selectedPlugins.add('PayOnServer')
|
||||||
|
: selectedPlugins.delete('PayOnServer')
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Text>PayOnServer</Text>
|
<Text>PayOnServer</Text>
|
||||||
</View>
|
</View>
|
||||||
<View>
|
<View>
|
||||||
<BouncyCheckbox
|
<BouncyCheckbox
|
||||||
isChecked={selectedPlugins.includes('VideoId')}
|
isChecked={selectedPlugins.has('VideoId')}
|
||||||
onPress={(isChecked: boolean) =>
|
onPress={(isChecked: boolean) =>
|
||||||
togglePlugin('VideoId', isChecked)
|
isChecked === true
|
||||||
|
? selectedPlugins.add('VideoId')
|
||||||
|
: selectedPlugins.delete('VideoId')
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Text>VideoId</Text>
|
<Text>VideoId</Text>
|
||||||
</View>
|
</View>
|
||||||
<View>
|
<View>
|
||||||
<BouncyCheckbox
|
<BouncyCheckbox
|
||||||
isChecked={selectedPlugins.includes('EIdOnServer')}
|
isChecked={selectedPlugins.has('EIdOnServer')}
|
||||||
onPress={(isChecked: boolean) =>
|
onPress={(isChecked: boolean) =>
|
||||||
togglePlugin('EIdOnServer', isChecked)
|
isChecked === true
|
||||||
|
? 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} />
|
<Button title="Start" onPress={onStart} />
|
||||||
</View>
|
|
||||||
<View style={styles.btn}>
|
|
||||||
<Button title="Start" onPress={onStart} />
|
|
||||||
</View>
|
|
||||||
</View>
|
</View>
|
||||||
</SafeAreaView>
|
</SafeAreaView>
|
||||||
);
|
);
|
||||||
|
|||||||
24
package.json
24
package.json
@ -7,10 +7,6 @@
|
|||||||
"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"
|
||||||
@ -69,21 +65,19 @@
|
|||||||
"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-community/cli": "latest",
|
"@react-native/eslint-config": "^0.73.1",
|
||||||
"@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": "^19.2.14",
|
"@types/react": "^18.2.44",
|
||||||
"@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.1.2",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
"eslint-plugin-prettier": "^5.5.5",
|
"eslint-plugin-prettier": "^5.0.1",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"prettier": "^3.8.1",
|
"prettier": "^3.0.3",
|
||||||
"react": "^19.2.4",
|
"react": "18.3.1",
|
||||||
"react-native": "0.84.0",
|
"react-native": "0.75.2",
|
||||||
"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",
|
||||||
@ -135,9 +129,6 @@
|
|||||||
"@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": [
|
||||||
@ -194,7 +185,6 @@
|
|||||||
"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