diff --git a/README.md b/README.md index af06c58..6115af8 100644 --- a/README.md +++ b/README.md @@ -85,12 +85,12 @@ function YourComponent() { ``` ## Android -- Digio SDK supports android version 7 (SDK level 24) and above +- Digio SDK supports android version 8 (SDK level 26) and above - Add below in your project under build.gradle (module:app)file inside dependencies ```tsx // Required for esign/mandate sign -implementation 'com.github.digio-tech:protean-esign:v3.2' +implementation 'com.github.digio-tech:protean-esign:v3.12' // under android {} of build.gradle(module:app) buildFeatures { viewBinding true @@ -185,7 +185,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 ``` ### IOS Permission -- Digio SDK supports iOS 11 and above +- Digio SDK supports iOS 15.6 and above Permissions need to add in your info.plist ``` /** Camera permission incase of selfie/video KYC/ capture document **/ diff --git a/android/build.gradle b/android/build.gradle index 2588b52..769cc9f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,7 +6,12 @@ buildscript { } dependencies { - classpath "com.android.tools.build:gradle:7.2.1" +// classpath "com.android.tools.build:gradle:7.2.1" +// classpath "com.android.tools.build:gradle:8.5.1" + classpath "com.android.tools.build:gradle:8.6.0" + + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25" + } } @@ -63,20 +68,30 @@ android { } lintOptions { - disable "GradleCompatible" +// disable "GradleCompatible" + disable += ["GradleCompatible"] } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + buildFeatures { viewBinding true dataBinding true } -// buildToolsVersion '33.0.0' + +} + +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { + compilerOptions { + jvmTarget = "1.8" + } } + + repositories { mavenCentral() google() @@ -89,7 +104,7 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // core dependencies - implementation(platform("com.github.digio-tech:digio-bom:v1.0.15")) + implementation(platform("com.github.digio-tech:digio-bom:v1.0.28")) implementation("androidx.appcompat:appcompat") implementation("com.google.android.material:material") implementation("androidx.navigation:navigation-fragment-ktx") @@ -123,7 +138,9 @@ dependencies { implementation("androidx.exifinterface:exifinterface") implementation("com.github.digio-tech:sdk_ml_camera") - implementation("com.google.mlkit:face-detection") +// implementation("com.google.mlkit:face-detection") + implementation("com.google.android.gms:play-services-mlkit-face-detection") + implementation("androidx.camera:camera-core") implementation("androidx.camera:camera-camera2") implementation("androidx.camera:camera-lifecycle") @@ -141,5 +158,9 @@ dependencies { implementation("androidx.lifecycle:lifecycle-livedata-ktx") implementation("com.squareup.retrofit2:converter-gson") + implementation("org.simpleframework:simple-xml") + implementation("com.github.bumptech.glide:glide") + + } diff --git a/android/gradle.properties b/android/gradle.properties index dcb6662..6c440d5 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,5 +1,22 @@ -DigioReactNative_kotlinVersion=1.7.0 -DigioReactNative_minSdkVersion=21 +#DigioReactNative_kotlinVersion=1.7.0 +#DigioReactNative_minSdkVersion=21 +#DigioReactNative_targetSdkVersion=35 +#DigioReactNative_compileSdkVersion=35 +#DigioReactNative_ndkversion=21.4.7075529 + + + +# Kotlin version for AGP 8.5+ +DigioReactNative_kotlinVersion=1.9.25 + +# Update minSdk to match AGP 8.x requirements (21 is fine) +DigioReactNative_minSdkVersion=26 DigioReactNative_targetSdkVersion=35 DigioReactNative_compileSdkVersion=35 -DigioReactNative_ndkversion=21.4.7075529 + +# NDK optional +DigioReactNative_ndkversion=26.2.11394342 + +# Java 17 required +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +#android.suppressUnsupportedCompileSdk=35 diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 41dfb87..8d8d13d 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +#distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/libs/digio_kyc_workflow-4.0.9.aar b/android/libs/digio_kyc_workflow-4.0.9.aar deleted file mode 100644 index 867b50c..0000000 Binary files a/android/libs/digio_kyc_workflow-4.0.9.aar and /dev/null differ diff --git a/digio-react-native.podspec b/digio-react-native.podspec index 62a4da2..493d38b 100644 --- a/digio-react-native.podspec +++ b/digio-react-native.podspec @@ -11,7 +11,7 @@ Pod::Spec.new do |s| s.license = package["license"] s.authors = package["author"] - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "15.6" } s.source = { :git => "https://github.com/digio-tech/reactnative-sdk.git", :tag => "#{s.version}" } s.source_files = "ios/**/*.{h,m,mm,swift}" diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index a03abdf..e4ca756 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -112,7 +112,7 @@ dependencies { implementation("com.facebook.react:react-android") // implementation fileTree(dir: 'libs', include: ['*.aar']) // implementation 'com.github.digio-tech:gateway_kyc:v4.0.20' - implementation 'com.github.digio-tech:protean-esign:v3.2' + implementation 'com.github.digio-tech:protean-esign:v3.12' debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { exclude group:'com.squareup.okhttp3', module:'okhttp' diff --git a/example/android/app/proguard-rules.pro b/example/android/app/proguard-rules.pro index 11b0257..df51ea2 100644 --- a/example/android/app/proguard-rules.pro +++ b/example/android/app/proguard-rules.pro @@ -8,3 +8,120 @@ # http://developer.android.com/guide/developing/tools/proguard.html # Add any project specific keep options here: + +-keepattributes SourceFile,LineNumberTable +-keep public class * extends java.lang.Exception + +-keepclassmembers class * { + @android.webkit.JavascriptInterface ; +} +-keepattributes JavascriptInterface +-keepattributes *Annotation* +-keepattributes Signature +-optimizations !method/inlining/* +-keeppackagenames + +-keepnames class androidx.navigation.fragment.NavHostFragment +-keep class * extends androidx.fragment.app.Fragment{} +-keepnames class * extends android.os.Parcelable +-keepnames class * extends java.io.Serializable + +-keepclassmembers enum * { + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +-dontwarn androidx.databinding.** +-keep class androidx.databinding.** { *; } +-keepclassmembers class * extends androidx.databinding.** { *; } + +-dontwarn org.json.** +-keep class org.json** { *; } + +-keep public class org.simpleframework.**{ *; } +-keep class org.simpleframework.xml.**{ *; } +-keep class org.simpleframework.xml.core.**{ *; } +-keep class org.simpleframework.xml.util.**{ *; } +-dontwarn com.google.android.gms.** +-keep class com.google.android.gms.** { *; } +-keep class com.google.android.material.** { *; } + +-dontwarn org.simpleframework.** + +-keepattributes ElementList, Root +-keepclassmembers class * { + @org.simpleframework.xml.* *; +} + +-keep class org.spongycastle.** { *; } +-keep class com.ecs.rdlibrary.request.** { *; } +-keep class com.ecs.rdlibrary.response.** { *; } +-keep class com.ecs.rdlibrary.utils.** { *; } +-keep class com.ecs.rdlibrary.ECSBioCaptureActivity { *; } +-keep class org.simpleframework.xml.** { *; } +-keepattributes Exceptions, InnerClasses + +-keep class com.google.android.gms.location.LocationSettingsRequest$Builder { *; } + +-keepnames class ** { *; } +-keepclassmembers class * { + @android.webkit.JavascriptInterface ; +} + + + +-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations + +# Keep annotation default values (e.g., retrofit2.http.Field.encoded). +-keepattributes AnnotationDefault + +# Retain service method parameters when optimizing. +-keepclassmembers,allowshrinking,allowobfuscation interface * { + @retrofit2.http.* ; +} + +# Ignore JSR 305 annotations for embedding nullability information. +-dontwarn javax.annotation.** + +# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath. +-dontwarn kotlin.Unit + +# Top-level functions that can only be used by Kotlin. +-dontwarn retrofit2.KotlinExtensions +-dontwarn retrofit2.KotlinExtensions$* + +# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy +# and replaces all potential values with null. Explicitly keeping the interfaces prevents this. +-if interface * { @retrofit2.http.* ; } +-keep,allowobfuscation interface <1> + +# Keep inherited services. +-if interface * { @retrofit2.http.* ; } +-keep,allowobfuscation interface * extends <1> + +# With R8 full mode generic signatures are stripped for classes that are not +# kept. Suspend functions are wrapped in continuations where the type argument +# is used. +-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation + +# R8 full mode strips generic signatures from return types if not kept. +-if interface * { @retrofit2.http.* public *** *(...); } +-keep,allowoptimization,allowshrinking,allowobfuscation class <3> + +# R8 full mode strips generic signatures from return types if not kept. +-keep,allowobfuscation,allowshrinking class retrofit2.Response + +# A resource is loaded with a relative path so the package of this class must be preserved. +-adaptresourcefilenames okhttp3/internal/publicsuffix/PublicSuffixDatabase.gz + +# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java. +-dontwarn org.codehaus.mojo.animal_sniffer.* + +# OkHttp platform used only on JVM and when Conscrypt and other security providers are available. +-dontwarn okhttp3.internal.platform.** +-dontwarn org.conscrypt.** +-dontwarn org.bouncycastle.** +-dontwarn org.openjsse.** + + +-keep class * extends androidx.databinding.DataBinderMapper diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 6ec1567..eb9d32f 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip + networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/example/ios/DigioReactNativeExample.xcodeproj/project.pbxproj b/example/ios/DigioReactNativeExample.xcodeproj/project.pbxproj index 7327bde..3374f04 100644 --- a/example/ios/DigioReactNativeExample.xcodeproj/project.pbxproj +++ b/example/ios/DigioReactNativeExample.xcodeproj/project.pbxproj @@ -8,12 +8,12 @@ /* Begin PBXBuildFile section */ 00E356F31AD99517003FC87E /* DigioReactNativeExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* DigioReactNativeExampleTests.m */; }; - 0C80B921A6F3F58F76C31292 /* libPods-DigioReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-DigioReactNativeExample.a */; }; 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 37415D3C9647767C178D8B8E /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D1978CA07E527ADCF57FA404 /* PrivacyInfo.xcprivacy */; }; - 7699B88040F8A987B510C191 /* libPods-DigioReactNativeExample-DigioReactNativeExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-DigioReactNativeExample-DigioReactNativeExampleTests.a */; }; + 60D8920BDF4C0A845B83F44D /* libPods-DigioReactNativeExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B247795B8DDA43866A635813 /* libPods-DigioReactNativeExample.a */; }; + 728CC9D3A7AE0AA9DDA58BE2 /* libPods-DigioReactNativeExample-DigioReactNativeExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DDCBAD19F6068D108295EF4 /* libPods-DigioReactNativeExample-DigioReactNativeExampleTests.a */; }; 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ @@ -37,15 +37,15 @@ 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = DigioReactNativeExample/Images.xcassets; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = DigioReactNativeExample/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = DigioReactNativeExample/main.m; sourceTree = ""; }; - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-DigioReactNativeExample-DigioReactNativeExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-DigioReactNativeExample-DigioReactNativeExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3B4392A12AC88292D35C810B /* Pods-DigioReactNativeExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DigioReactNativeExample.debug.xcconfig"; path = "Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample.debug.xcconfig"; sourceTree = ""; }; - 5709B34CF0A7D63546082F79 /* Pods-DigioReactNativeExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DigioReactNativeExample.release.xcconfig"; path = "Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample.release.xcconfig"; sourceTree = ""; }; - 5B7EB9410499542E8C5724F5 /* Pods-DigioReactNativeExample-DigioReactNativeExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DigioReactNativeExample-DigioReactNativeExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests.debug.xcconfig"; sourceTree = ""; }; - 5DCACB8F33CDC322A6C60F78 /* libPods-DigioReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-DigioReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 2C60FC82E96FE29A34936E4A /* Pods-DigioReactNativeExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DigioReactNativeExample.release.xcconfig"; path = "Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample.release.xcconfig"; sourceTree = ""; }; + 6DDCBAD19F6068D108295EF4 /* libPods-DigioReactNativeExample-DigioReactNativeExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-DigioReactNativeExample-DigioReactNativeExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = DigioReactNativeExample/LaunchScreen.storyboard; sourceTree = ""; }; - 89C6BE57DB24E9ADA2F236DE /* Pods-DigioReactNativeExample-DigioReactNativeExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DigioReactNativeExample-DigioReactNativeExampleTests.release.xcconfig"; path = "Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests.release.xcconfig"; sourceTree = ""; }; - D1978CA07E527ADCF57FA404 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = DigioReactNativeExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; + B247795B8DDA43866A635813 /* libPods-DigioReactNativeExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-DigioReactNativeExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + BABEB265EC7A8157BFF7FAD9 /* Pods-DigioReactNativeExample-DigioReactNativeExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DigioReactNativeExample-DigioReactNativeExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests.debug.xcconfig"; sourceTree = ""; }; + D1978CA07E527ADCF57FA404 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xml; name = PrivacyInfo.xcprivacy; path = DigioReactNativeExample/PrivacyInfo.xcprivacy; sourceTree = ""; }; ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; + EFD59A9C50BBB8C9302A1BAE /* Pods-DigioReactNativeExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DigioReactNativeExample.debug.xcconfig"; path = "Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample.debug.xcconfig"; sourceTree = ""; }; + F9F01A4FA2A1412B69B38013 /* Pods-DigioReactNativeExample-DigioReactNativeExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DigioReactNativeExample-DigioReactNativeExampleTests.release.xcconfig"; path = "Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -53,7 +53,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7699B88040F8A987B510C191 /* libPods-DigioReactNativeExample-DigioReactNativeExampleTests.a in Frameworks */, + 728CC9D3A7AE0AA9DDA58BE2 /* libPods-DigioReactNativeExample-DigioReactNativeExampleTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -61,7 +61,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 0C80B921A6F3F58F76C31292 /* libPods-DigioReactNativeExample.a in Frameworks */, + 60D8920BDF4C0A845B83F44D /* libPods-DigioReactNativeExample.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -103,8 +103,8 @@ isa = PBXGroup; children = ( ED297162215061F000B7C4FE /* JavaScriptCore.framework */, - 5DCACB8F33CDC322A6C60F78 /* libPods-DigioReactNativeExample.a */, - 19F6CBCC0A4E27FBF8BF4A61 /* libPods-DigioReactNativeExample-DigioReactNativeExampleTests.a */, + B247795B8DDA43866A635813 /* libPods-DigioReactNativeExample.a */, + 6DDCBAD19F6068D108295EF4 /* libPods-DigioReactNativeExample-DigioReactNativeExampleTests.a */, ); name = Frameworks; sourceTree = ""; @@ -143,10 +143,10 @@ BBD78D7AC51CEA395F1C20DB /* Pods */ = { isa = PBXGroup; children = ( - 3B4392A12AC88292D35C810B /* Pods-DigioReactNativeExample.debug.xcconfig */, - 5709B34CF0A7D63546082F79 /* Pods-DigioReactNativeExample.release.xcconfig */, - 5B7EB9410499542E8C5724F5 /* Pods-DigioReactNativeExample-DigioReactNativeExampleTests.debug.xcconfig */, - 89C6BE57DB24E9ADA2F236DE /* Pods-DigioReactNativeExample-DigioReactNativeExampleTests.release.xcconfig */, + EFD59A9C50BBB8C9302A1BAE /* Pods-DigioReactNativeExample.debug.xcconfig */, + 2C60FC82E96FE29A34936E4A /* Pods-DigioReactNativeExample.release.xcconfig */, + BABEB265EC7A8157BFF7FAD9 /* Pods-DigioReactNativeExample-DigioReactNativeExampleTests.debug.xcconfig */, + F9F01A4FA2A1412B69B38013 /* Pods-DigioReactNativeExample-DigioReactNativeExampleTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -158,12 +158,12 @@ isa = PBXNativeTarget; buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "DigioReactNativeExampleTests" */; buildPhases = ( - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, + B6FFFE022889404C9657F0B2 /* [CP] Check Pods Manifest.lock */, 00E356EA1AD99517003FC87E /* Sources */, 00E356EB1AD99517003FC87E /* Frameworks */, 00E356EC1AD99517003FC87E /* Resources */, - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */, - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, + FE647DC999D569AEC978B044 /* [CP] Embed Pods Frameworks */, + 4670853CCAB8E0C1AF2C4EF1 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -179,14 +179,14 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "DigioReactNativeExample" */; buildPhases = ( - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, + 9C895BD74D64956F437D4E25 /* [CP] Check Pods Manifest.lock */, FD10A7F022414F080027D42C /* Start Packager */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, - 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */, - E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, + FCFBF0F137699C472950B3DE /* [CP] Embed Pods Frameworks */, + A805C112A6726752CB587631 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -270,24 +270,24 @@ shellPath = /bin/sh; shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; }; - 00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = { + 4670853CCAB8E0C1AF2C4EF1 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { + 9C895BD74D64956F437D4E25 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -302,103 +302,103 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-DigioReactNativeExample-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { + A805C112A6726752CB587631 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample-resources-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; + name = "[CP] Copy Pods Resources"; outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-DigioReactNativeExample-checkManifestLockResult.txt", + "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample-resources-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample-resources.sh\"\n"; showEnvVarsInLog = 0; }; - C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = { + B6FFFE022889404C9657F0B2 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Embed Pods Frameworks"; + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-frameworks.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { + FCFBF0F137699C472950B3DE /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample-resources-${CONFIGURATION}-input-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample-resources-${CONFIGURATION}-output-files.xcfilelist", + "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample-resources.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample/Pods-DigioReactNativeExample-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { + FD10A7F022414F080027D42C /* Start Packager */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", ); - name = "[CP] Copy Pods Resources"; + inputPaths = ( + ); + name = "Start Packager"; outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-resources.sh\"\n"; + shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; showEnvVarsInLog = 0; }; - FD10A7F022414F080027D42C /* Start Packager */ = { + FE647DC999D569AEC978B044 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", ); - inputPaths = ( - ); - name = "Start Packager"; + name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( - ); - outputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DigioReactNativeExample-DigioReactNativeExampleTests/Pods-DigioReactNativeExample-DigioReactNativeExampleTests-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -434,7 +434,7 @@ /* Begin XCBuildConfiguration section */ 00E356F61AD99517003FC87E /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-DigioReactNativeExample-DigioReactNativeExampleTests.debug.xcconfig */; + baseConfigurationReference = BABEB265EC7A8157BFF7FAD9 /* Pods-DigioReactNativeExample-DigioReactNativeExampleTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; DEVELOPMENT_TEAM = 4R2V8KY8U8; @@ -443,7 +443,7 @@ "$(inherited)", ); INFOPLIST_FILE = DigioReactNativeExampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -462,13 +462,13 @@ }; 00E356F71AD99517003FC87E /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-DigioReactNativeExample-DigioReactNativeExampleTests.release.xcconfig */; + baseConfigurationReference = F9F01A4FA2A1412B69B38013 /* Pods-DigioReactNativeExample-DigioReactNativeExampleTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; DEVELOPMENT_TEAM = 4R2V8KY8U8; INFOPLIST_FILE = DigioReactNativeExampleTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.4; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -487,7 +487,7 @@ }; 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-DigioReactNativeExample.debug.xcconfig */; + baseConfigurationReference = EFD59A9C50BBB8C9302A1BAE /* Pods-DigioReactNativeExample.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; @@ -495,6 +495,7 @@ DEVELOPMENT_TEAM = 4R2V8KY8U8; ENABLE_BITCODE = NO; INFOPLIST_FILE = DigioReactNativeExample/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -506,6 +507,7 @@ "-lc++", ); PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; + "PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = org.reactjs.native.example.DigioReactNativeExample; PRODUCT_NAME = DigioReactNativeExample; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -515,13 +517,14 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-DigioReactNativeExample.release.xcconfig */; + baseConfigurationReference = 2C60FC82E96FE29A34936E4A /* Pods-DigioReactNativeExample.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 4R2V8KY8U8; INFOPLIST_FILE = DigioReactNativeExample/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -533,6 +536,7 @@ "-lc++", ); PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; + "PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = org.reactjs.native.example.DigioReactNativeExample; PRODUCT_NAME = DigioReactNativeExample; SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; diff --git a/example/ios/DigioReactNativeExample/PrivacyInfo.xcprivacy b/example/ios/DigioReactNativeExample/PrivacyInfo.xcprivacy index 41b8317..b961c4b 100644 --- a/example/ios/DigioReactNativeExample/PrivacyInfo.xcprivacy +++ b/example/ios/DigioReactNativeExample/PrivacyInfo.xcprivacy @@ -18,6 +18,7 @@ NSPrivacyAccessedAPITypeReasons CA92.1 + C56D.1 diff --git a/example/ios/Podfile b/example/ios/Podfile index 043cfe6..7d95c9b 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -5,7 +5,8 @@ require Pod::Executable.execute_command('node', ['-p', {paths: [process.argv[1]]}, )', __dir__]).strip -platform :ios, min_ios_version_supported +# platform :ios, min_ios_version_supported + platform :ios, '15.6' prepare_react_native_project! # If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set. @@ -63,3 +64,4 @@ target 'DigioReactNativeExample' do end # pod 'DigiokycSDK', '~> 1.1.0' +# pod 'DigioCaptureKit' diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 7169fdb..6a76238 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,14 +1,14 @@ PODS: - boost (1.83.0) - CocoaAsyncSocket (7.6.5) - - digio-react-native (2.0.1): + - digio-react-native (2.0.4): - DigioEsignSDK - DigiokycSDK - glog - RCT-Folly (= 2022.05.16.00) - React-Core - - DigioEsignSDK (1.0.4) - - DigiokycSDK (1.2.2) + - DigioEsignSDK (1.0.9) + - DigiokycSDK (1.3.0) - DoubleConversion (1.1.6) - FBLazyVector (0.73.11) - FBReactNativeSpec (0.73.11): @@ -1320,9 +1320,9 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: d3f49c53809116a5d38da093a8aa78bf551aed09 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 - digio-react-native: 9f416e2150942258e0bbbc7f6d0a60981da1c633 - DigioEsignSDK: a83db91acf10a043ba06da5d56aa976b64eb0c48 - DigiokycSDK: 198d94e5856735c791ee6ca475cb5f78fc333210 + digio-react-native: 25d59ee7b30521a8528e45c124b413058b58050d + DigioEsignSDK: 332390c3775c662da6ca2671be4a13aa01901bfe + DigiokycSDK: c7e9cf3470ab0e028caad3f3f836515ce3ddc865 DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953 FBLazyVector: b46891061bfe0a9b07f601813114c8653a72a45c FBReactNativeSpec: 9a01850c21d81027fa7b20b9dcc25d9bfae083da @@ -1383,6 +1383,6 @@ SPEC CHECKSUMS: SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17 Yoga: a813a6d82538ccba91c54406404e3ed80b48a692 -PODFILE CHECKSUM: d55135704fc2aff36cd399dde52913d2f5b83609 +PODFILE CHECKSUM: 0ee706da6f5af172ee9ac0cf8ec769ce173ae9c5 COCOAPODS: 1.16.2 diff --git a/example/src/App.tsx b/example/src/App.tsx index 0cef44a..7b8b5ed 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,16 +1,21 @@ -import React, { useState, useEffect } from 'react'; -import { StyleSheet, View, Text } from 'react-native'; +import React, { useState, useEffect, useRef } from 'react'; +import { StyleSheet, View, Text, TouchableOpacity } from 'react-native'; import { Digio, Environment, ServiceMode } from '@digiotech/react-native'; import type { GatewayEvent } from '@digiotech/react-native'; export default function App() { const [digioResult, setDigioResult] = useState(null); const [digioEvent, setDigioEvent] = useState(null); + const digioRef = useRef(null); useEffect(() => { - const digio = new Digio({ environment: Environment.PRODUCTION, serviceMode: ServiceMode.OTP }); + // Initialize Digio only once + digioRef.current = new Digio({ + environment: Environment.PRODUCTION, + serviceMode: ServiceMode.OTP, + }); - const digioGatewayEventSubscription = digio.addGatewayEventListener( + const digioGatewayEventSubscription = digioRef.current.addGatewayEventListener( (event: GatewayEvent) => { console.log('Digio_event ' + event.event); if (event.event !== undefined) { @@ -19,28 +24,30 @@ export default function App() { } ); - digio - .start( - 'KID250423131507165T4ALP7UIDB4UFZ', - 'akash.kumar@digio.in', - 'GWT250423131507194T9AD9V4FENFHYS' + return () => { + digioGatewayEventSubscription.remove(); + }; + }, []); + + const startDigioFlow = () => { + digioRef.current + ?.start( + 'KID2510271XXXXX1AW9QWSDV1CXQE', + 'abc@digio.in', + 'GWT251027XXX121856MDL4XLZRMJ336S' ) - .then((res) => { + .then((res: any) => { console.log(res); if (res !== undefined) { setDigioResult(res); } }) - .catch((err) => console.error(err)); - - return () => { - digioGatewayEventSubscription.remove(); - }; - }, []); + .catch((err: any) => console.error(err)); + }; return ( - Digio Starting + Digio Ready Result: {digioResult ? JSON.stringify(digioResult) : 'Waiting...'} @@ -49,6 +56,11 @@ export default function App() { Event: {digioEvent ? digioEvent : 'Waiting...'} + + {/* Floating Action Button */} + + + + ); } @@ -71,4 +83,21 @@ const styles = StyleSheet.create({ backgroundColor: '#e0e0e0', borderRadius: 5, }, + fab: { + position: 'absolute', + right: 20, + bottom: 30, + backgroundColor: '#6200ee', + width: 60, + height: 60, + borderRadius: 30, + alignItems: 'center', + justifyContent: 'center', + elevation: 5, + }, + fabText: { + color: '#fff', + fontSize: 30, + fontWeight: 'bold', + }, }); diff --git a/package.json b/package.json index 77c4c53..9bbcf55 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@digiotech/react-native", - "version": "2.0.4", + "version": "2.0.5", "description": "SDK for invoking client side journey for any of Digio request", "main": "lib/commonjs/index", "module": "lib/module/index",