mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 21:48:04 -05:00
[INJIMOB-956]: SVG rendering (#2080)
* [INJIMOB-956]: Android native module integration Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-956]: iOS native module integration and react native layer Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-956]: React native UI design changes Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-3499]: Updating android native module integration to adapt latest chagnes in libray api Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-3499]: Updated Native module integration Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-956]: Update tht package dependency version Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-956]: Loading before SVg rendering issue fixed Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-956]: show Qr code button based on fallback image id Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-956]: Update Swift package dependency Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-3499]: Update Swift Package dependency to develop of Renderer library Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-956]: Update in received screen Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-956]: Update format in renderVC call Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-956]: Change ordering of the params Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-956]: Changes in caching Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> * [INJIMOB-956]: Updating the package dependency files Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com> --------- Signed-off-by: balachandarg-tw <balachandar.g@thoughtworks.com>
This commit is contained in:
@@ -36,8 +36,11 @@
|
||||
9CCCA19E2CF87A8400D5A461 /* securekeystore in Frameworks */ = {isa = PBXBuildFile; productRef = 9CCCA19D2CF87A8400D5A461 /* securekeystore */; };
|
||||
B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = FAC715A2D49A985799AEE119 /* ExpoModulesProvider.swift */; };
|
||||
BB2F792D24A3F905000567C9 /* Expo.plist in Resources */ = {isa = PBXBuildFile; fileRef = BB2F792C24A3F905000567C9 /* Expo.plist */; };
|
||||
C339223B2E79A536004A01EC /* InjiVcRenderer in Frameworks */ = {isa = PBXBuildFile; productRef = C339223A2E79A536004A01EC /* InjiVcRenderer */; };
|
||||
C3F18B1A2E320C85007DBE73 /* OpenID4VP in Frameworks */ = {isa = PBXBuildFile; productRef = C3F18B192E320C85007DBE73 /* OpenID4VP */; };
|
||||
C3F18B1D2E320C9A007DBE73 /* VCIClient in Frameworks */ = {isa = PBXBuildFile; productRef = C3F18B1C2E320C9A007DBE73 /* VCIClient */; };
|
||||
C3F6A9DD2E661896006C9904 /* RNInjiVcRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = C3F6A9DC2E66188D006C9904 /* RNInjiVcRenderer.swift */; };
|
||||
C3F6A9DF2E661903006C9904 /* RNInjiVcRenderer.m in Sources */ = {isa = PBXBuildFile; fileRef = C3F6A9DE2E6618F6006C9904 /* RNInjiVcRenderer.m */; };
|
||||
E86208152C0335C5007C3E24 /* RNVCIClientModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = E86208142C0335C5007C3E24 /* RNVCIClientModule.swift */; };
|
||||
E86208172C0335EC007C3E24 /* RNVCIClientModule.m in Sources */ = {isa = PBXBuildFile; fileRef = E86208162C0335EC007C3E24 /* RNVCIClientModule.m */; };
|
||||
FD8D20B92BBAACDF009AD01C /* Fontisto.ttf in Resources */ = {isa = PBXBuildFile; fileRef = FD8D20A62BBAACDF009AD01C /* Fontisto.ttf */; };
|
||||
@@ -92,6 +95,8 @@
|
||||
9C7CDF422C7CC13500243A9A /* RNSecureKeystoreModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNSecureKeystoreModule.m; sourceTree = "<group>"; };
|
||||
AA286B85B6C04FC6940260E9 /* SplashScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = SplashScreen.storyboard; path = Inji/SplashScreen.storyboard; sourceTree = "<group>"; };
|
||||
BB2F792C24A3F905000567C9 /* Expo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Expo.plist; sourceTree = "<group>"; };
|
||||
C3F6A9DC2E66188D006C9904 /* RNInjiVcRenderer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNInjiVcRenderer.swift; sourceTree = "<group>"; };
|
||||
C3F6A9DE2E6618F6006C9904 /* RNInjiVcRenderer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNInjiVcRenderer.m; sourceTree = "<group>"; };
|
||||
D98B96A488E54CBDB286B26F /* noop-file.swift */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 4; includeInIndex = 0; lastKnownFileType = sourcecode.swift; name = "noop-file.swift"; path = "Inji/noop-file.swift"; sourceTree = "<group>"; };
|
||||
E86208142C0335C5007C3E24 /* RNVCIClientModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNVCIClientModule.swift; sourceTree = "<group>"; };
|
||||
E86208162C0335EC007C3E24 /* RNVCIClientModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNVCIClientModule.m; sourceTree = "<group>"; };
|
||||
@@ -124,6 +129,7 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
C3F18B1D2E320C9A007DBE73 /* VCIClient in Frameworks */,
|
||||
C339223B2E79A536004A01EC /* InjiVcRenderer in Frameworks */,
|
||||
9C4850432C3E5873002ECBD5 /* ios-tuvali-library in Frameworks */,
|
||||
9CAE74EE2E2E38F800C2532C /* pixelpass in Frameworks */,
|
||||
9CCCA19E2CF87A8400D5A461 /* securekeystore in Frameworks */,
|
||||
@@ -138,6 +144,8 @@
|
||||
13B07FAE1A68108700A75B9A /* Inji */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
C3F6A9DE2E6618F6006C9904 /* RNInjiVcRenderer.m */,
|
||||
C3F6A9DC2E66188D006C9904 /* RNInjiVcRenderer.swift */,
|
||||
BB2F792B24A3F905000567C9 /* Supporting */,
|
||||
008F07F21AC5B25A0029DE68 /* main.jsbundle */,
|
||||
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
|
||||
@@ -317,6 +325,7 @@
|
||||
9CAE74ED2E2E38F800C2532C /* pixelpass */,
|
||||
C3F18B192E320C85007DBE73 /* OpenID4VP */,
|
||||
C3F18B1C2E320C9A007DBE73 /* VCIClient */,
|
||||
C339223A2E79A536004A01EC /* InjiVcRenderer */,
|
||||
);
|
||||
productName = Inji;
|
||||
productReference = 13B07F961A680F5B00A75B9A /* Inji.app */;
|
||||
@@ -350,6 +359,7 @@
|
||||
9CAE74EC2E2E38F800C2532C /* XCRemoteSwiftPackageReference "pixelpass-ios-swift" */,
|
||||
C3F18B182E320C85007DBE73 /* XCRemoteSwiftPackageReference "inji-openid4vp-ios-swift" */,
|
||||
C3F18B1B2E320C9A007DBE73 /* XCRemoteSwiftPackageReference "inji-vci-client-ios-swift" */,
|
||||
C33922392E79A536004A01EC /* XCRemoteSwiftPackageReference "inji-vc-renderer-ios-swift" */,
|
||||
);
|
||||
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
|
||||
projectDirPath = "";
|
||||
@@ -564,6 +574,7 @@
|
||||
1EED69FD2DA914D00042EAFC /* RNDeepLinkIntentModule.m in Sources */,
|
||||
1E6875ED2CA5550F0086D870 /* RNOpenID4VPModule.swift in Sources */,
|
||||
1E55C20B2DB120C2009DF38B /* RNDeepLinkIntentModule.swift in Sources */,
|
||||
C3F6A9DD2E661896006C9904 /* RNInjiVcRenderer.swift in Sources */,
|
||||
9C48504F2C3E59B5002ECBD5 /* RNVersionModule.swift in Sources */,
|
||||
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
|
||||
9C0E86BB2BEE36C300E9F9F6 /* RNPixelpassModule.m in Sources */,
|
||||
@@ -583,6 +594,7 @@
|
||||
9C48504D2C3E59B5002ECBD5 /* RNWalletModule.m in Sources */,
|
||||
B18059E884C0ABDD17F3DC3D /* ExpoModulesProvider.swift in Sources */,
|
||||
9C4850512C3E59B5002ECBD5 /* RNVersionModule.m in Sources */,
|
||||
C3F6A9DF2E661903006C9904 /* RNInjiVcRenderer.m in Sources */,
|
||||
73295844242A4AD3AA52D0BE /* noop-file.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -849,6 +861,14 @@
|
||||
version = 0.3.0;
|
||||
};
|
||||
};
|
||||
C33922392E79A536004A01EC /* XCRemoteSwiftPackageReference "inji-vc-renderer-ios-swift" */ = {
|
||||
isa = XCRemoteSwiftPackageReference;
|
||||
repositoryURL = "https://github.com/mosip/inji-vc-renderer-ios-swift.git";
|
||||
requirement = {
|
||||
branch = develop;
|
||||
kind = branch;
|
||||
};
|
||||
};
|
||||
C3F18B182E320C85007DBE73 /* XCRemoteSwiftPackageReference "inji-openid4vp-ios-swift" */ = {
|
||||
isa = XCRemoteSwiftPackageReference;
|
||||
repositoryURL = "https://github.com/mosip/inji-openid4vp-ios-swift.git";
|
||||
@@ -883,6 +903,11 @@
|
||||
package = 9CCCA19C2CF87A8400D5A461 /* XCRemoteSwiftPackageReference "secure-keystore-ios-swift" */;
|
||||
productName = securekeystore;
|
||||
};
|
||||
C339223A2E79A536004A01EC /* InjiVcRenderer */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
package = C33922392E79A536004A01EC /* XCRemoteSwiftPackageReference "inji-vc-renderer-ios-swift" */;
|
||||
productName = InjiVcRenderer;
|
||||
};
|
||||
C3F18B192E320C85007DBE73 /* OpenID4VP */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
package = C3F18B182E320C85007DBE73 /* XCRemoteSwiftPackageReference "inji-openid4vp-ios-swift" */;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"originHash" : "327f856a9787c0e4bf4517bc1e50ff1e45a4aee6adcc4233b1e042d022a881f0",
|
||||
"originHash" : "c97fbee22fce758b0bea2f875d3805ef3530cfb7d60c2832b0b36cf3f72da606",
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "alamofire",
|
||||
@@ -73,6 +73,15 @@
|
||||
"revision" : "ca4935478360f45dd20444eac5d6bae9affc6d36"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "inji-vc-renderer-ios-swift",
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/mosip/inji-vc-renderer-ios-swift.git",
|
||||
"state" : {
|
||||
"branch" : "develop",
|
||||
"revision" : "58237eae6caf198d725ecfcd397b4d6f8f2d87bd"
|
||||
}
|
||||
},
|
||||
{
|
||||
"identity" : "inji-vci-client-ios-swift",
|
||||
"kind" : "remoteSourceControl",
|
||||
|
||||
16
ios/RNInjiVcRenderer.m
Normal file
16
ios/RNInjiVcRenderer.m
Normal file
@@ -0,0 +1,16 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "React/RCTBridgeModule.h"
|
||||
|
||||
@interface RCT_EXTERN_MODULE(InjiVcRenderer, NSObject)
|
||||
|
||||
RCT_EXTERN_METHOD(init:(NSString *)traceabilityId)
|
||||
|
||||
|
||||
RCT_EXTERN_METHOD(renderVC:(NSString *)credentialFormat
|
||||
wellKnown:(NSString *)wellKnown
|
||||
vcJsonString:(NSString *)vcJsonString
|
||||
resolver:(RCTPromiseResolveBlock)resolve
|
||||
rejecter:(RCTPromiseRejectBlock)reject)
|
||||
|
||||
|
||||
@end
|
||||
57
ios/RNInjiVcRenderer.swift
Normal file
57
ios/RNInjiVcRenderer.swift
Normal file
@@ -0,0 +1,57 @@
|
||||
import Foundation
|
||||
import React
|
||||
import InjiVcRenderer
|
||||
@objc(InjiVcRenderer)
|
||||
class RNInjiVcRenderer: NSObject, RCTBridgeModule {
|
||||
|
||||
private var vcRenderer: InjiVcRenderer?
|
||||
|
||||
@objc static func requiresMainQueueSetup() -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
static func moduleName() -> String {
|
||||
return "InjiVcRenderer"
|
||||
}
|
||||
|
||||
@objc
|
||||
func `init`(_ traceabilityId: String) {
|
||||
vcRenderer = InjiVcRenderer(traceabilityId: traceabilityId)
|
||||
}
|
||||
|
||||
|
||||
@objc(renderVC:wellKnown:vcJsonString:resolver:rejecter:)
|
||||
func renderVC(
|
||||
credentialFormat: String,
|
||||
wellKnown: String?,
|
||||
vcJsonString: String,
|
||||
resolve: @escaping RCTPromiseResolveBlock,
|
||||
reject: @escaping RCTPromiseRejectBlock
|
||||
) {
|
||||
guard let renderer = self.vcRenderer else {
|
||||
reject(nil, "InjiVcRenderer not initialized", nil)
|
||||
return
|
||||
}
|
||||
|
||||
do {
|
||||
let format = CredentialFormat.fromValue(credentialFormat)
|
||||
let result = try renderer.renderVC(
|
||||
credentialFormat: format,
|
||||
wellKnownJson: wellKnown,
|
||||
vcJsonString: vcJsonString
|
||||
)
|
||||
resolve(result)
|
||||
} catch {
|
||||
rejectWithVcRendererError(error, reject: reject)
|
||||
}
|
||||
}
|
||||
|
||||
func rejectWithVcRendererError(_ error: Error, reject: RCTPromiseRejectBlock) {
|
||||
if let vcRendererError = error as? VcRendererException {
|
||||
reject(vcRendererError.errorCode, vcRendererError.message, vcRendererError)
|
||||
} else {
|
||||
let nsError = NSError(domain: error.localizedDescription, code: 0)
|
||||
reject("ERR_UNKNOWN", nsError.localizedDescription, nsError)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user