Skip to content

Commit

Permalink
[INJIMOB-2449] fix multiple ios signin issue
Browse files Browse the repository at this point in the history
Signed-off-by: Abhishek Paul <[email protected]>
  • Loading branch information
abhip2565 committed Nov 28, 2024
1 parent c07e6bc commit 182de1e
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 172 deletions.
46 changes: 23 additions & 23 deletions ios/Inji.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
9C4850532C3E59E2002ECBD5 /* RNEventEmitterProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C4850522C3E59E2002ECBD5 /* RNEventEmitterProtocol.swift */; };
9C7CDF3E2C7CBEDE00243A9A /* RNSecureKeystoreModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9C7CDF3D2C7CBEDE00243A9A /* RNSecureKeystoreModule.swift */; };
9C7CDF432C7CC13500243A9A /* RNSecureKeystoreModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C7CDF422C7CC13500243A9A /* RNSecureKeystoreModule.m */; };
9C7CDF492C89802C00243A9A /* securekeystore in Frameworks */ = {isa = PBXBuildFile; productRef = 9C7CDF482C89802C00243A9A /* securekeystore */; };
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 */; };
E86208152C0335C5007C3E24 /* RNVCIClientModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = E86208142C0335C5007C3E24 /* RNVCIClientModule.swift */; };
Expand Down Expand Up @@ -116,8 +116,8 @@
34873E472CD8DAF3004DE734 /* VCIClient in Frameworks */,
9C4850432C3E5873002ECBD5 /* ios-tuvali-library in Frameworks */,
1E6875E92CA554E80086D870 /* OpenID4VP in Frameworks */,
9CCCA19E2CF87A8400D5A461 /* securekeystore in Frameworks */,
34873E4D2CD8DD11004DE734 /* pixelpass in Frameworks */,
9C7CDF492C89802C00243A9A /* securekeystore in Frameworks */,
96905EF65AED1B983A6B3ABC /* libPods-Inji.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -282,10 +282,10 @@
name = Inji;
packageProductDependencies = (
9C4850422C3E5873002ECBD5 /* ios-tuvali-library */,
9C7CDF482C89802C00243A9A /* securekeystore */,
1E6875E82CA554E80086D870 /* OpenID4VP */,
34873E462CD8DAF3004DE734 /* VCIClient */,
34873E4C2CD8DD11004DE734 /* pixelpass */,
9CCCA19D2CF87A8400D5A461 /* securekeystore */,
);
productName = Inji;
productReference = 13B07F961A680F5B00A75B9A /* Inji.app */;
Expand Down Expand Up @@ -317,8 +317,8 @@
34873E4B2CD8DD11004DE734 /* XCRemoteSwiftPackageReference "pixelpass-ios-swift" */,
34873E452CD8DAF3004DE734 /* XCRemoteSwiftPackageReference "inji-vci-client-ios-swift" */,
9C4850412C3E5873002ECBD5 /* XCRemoteSwiftPackageReference "tuvali-ios-swift" */,
9C7CDF472C89802C00243A9A /* XCRemoteSwiftPackageReference "secure-keystore-ios-swift" */,
1E6875E72CA554E80086D870 /* XCRemoteSwiftPackageReference "inji-openid4vp-ios-swift" */,
9CCCA19C2CF87A8400D5A461 /* XCRemoteSwiftPackageReference "secure-keystore-ios-swift" */,
);
productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
projectDirPath = "";
Expand Down Expand Up @@ -771,33 +771,33 @@
kind = branch;
};
};
9C4850412C3E5873002ECBD5 /* XCRemoteSwiftPackageReference "tuvali-ios-swift" */ = {
34873E452CD8DAF3004DE734 /* XCRemoteSwiftPackageReference "inji-vci-client-ios-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/mosip/tuvali-ios-swift/";
repositoryURL = "https://github.com/mosip/inji-vci-client-ios-swift";
requirement = {
branch = develop;
kind = branch;
};
};
9C7CDF472C89802C00243A9A /* XCRemoteSwiftPackageReference "secure-keystore-ios-swift" */ = {
34873E4B2CD8DD11004DE734 /* XCRemoteSwiftPackageReference "pixelpass-ios-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/mosip/secure-keystore-ios-swift";
repositoryURL = "https://github.com/mosip/pixelpass-ios-swift";
requirement = {
branch = develop;
kind = branch;
};
};
34873E452CD8DAF3004DE734 /* XCRemoteSwiftPackageReference "inji-vci-client-ios-swift" */ = {
9C4850412C3E5873002ECBD5 /* XCRemoteSwiftPackageReference "tuvali-ios-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/mosip/inji-vci-client-ios-swift";
repositoryURL = "https://github.com/mosip/tuvali-ios-swift/";
requirement = {
branch = develop;
kind = branch;
};
};
34873E4B2CD8DD11004DE734 /* XCRemoteSwiftPackageReference "pixelpass-ios-swift" */ = {
9CCCA19C2CF87A8400D5A461 /* XCRemoteSwiftPackageReference "secure-keystore-ios-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/mosip/pixelpass-ios-swift";
repositoryURL = "https://github.com/mosip/secure-keystore-ios-swift";
requirement = {
branch = develop;
kind = branch;
Expand All @@ -811,25 +811,25 @@
package = 1E6875E72CA554E80086D870 /* XCRemoteSwiftPackageReference "inji-openid4vp-ios-swift" */;
productName = OpenID4VP;
};
9C4850422C3E5873002ECBD5 /* ios-tuvali-library */ = {
isa = XCSwiftPackageProductDependency;
package = 9C4850412C3E5873002ECBD5 /* XCRemoteSwiftPackageReference "tuvali-ios-swift" */;
productName = "ios-tuvali-library";
};
9C7CDF482C89802C00243A9A /* securekeystore */ = {
34873E462CD8DAF3004DE734 /* VCIClient */ = {
isa = XCSwiftPackageProductDependency;
package = 9C7CDF472C89802C00243A9A /* XCRemoteSwiftPackageReference "secure-keystore-ios-swift" */;
productName = securekeystore;
package = 34873E452CD8DAF3004DE734 /* XCRemoteSwiftPackageReference "inji-vci-client-ios-swift" */;
productName = VCIClient;
};
34873E4C2CD8DD11004DE734 /* pixelpass */ = {
isa = XCSwiftPackageProductDependency;
package = 34873E4B2CD8DD11004DE734 /* XCRemoteSwiftPackageReference "pixelpass-ios-swift" */;
productName = pixelpass;
};
34873E462CD8DAF3004DE734 /* VCIClient */ = {
9C4850422C3E5873002ECBD5 /* ios-tuvali-library */ = {
isa = XCSwiftPackageProductDependency;
package = 34873E452CD8DAF3004DE734 /* XCRemoteSwiftPackageReference "inji-vci-client-ios-swift" */;
productName = VCIClient;
package = 9C4850412C3E5873002ECBD5 /* XCRemoteSwiftPackageReference "tuvali-ios-swift" */;
productName = "ios-tuvali-library";
};
9CCCA19D2CF87A8400D5A461 /* securekeystore */ = {
isa = XCSwiftPackageProductDependency;
package = 9CCCA19C2CF87A8400D5A461 /* XCRemoteSwiftPackageReference "secure-keystore-ios-swift" */;
productName = securekeystore;
};
/* End XCSwiftPackageProductDependency section */
};
Expand Down
4 changes: 2 additions & 2 deletions ios/Inji.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"originHash" : "178f6c7c607eeb08b99a4966015d08339500de64791888a2e79d6b7afae53659",
"originHash" : "6b82a714050e22d309e029aaffac33f021c04aac740f661a9879441a7d414f4f",
"pins" : [
{
"identity" : "base45-swift",
Expand Down Expand Up @@ -61,7 +61,7 @@
"location" : "https://github.com/mosip/secure-keystore-ios-swift",
"state" : {
"branch" : "develop",
"revision" : "4f736866277379f5aa5128e64a39be6165b3500d"
"revision" : "767b9dabd1a0cd374732ee97cb7cf34dd051acc1"
}
},
{
Expand Down
9 changes: 9 additions & 0 deletions ios/RNSecureKeystoreModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,14 @@ @interface RCT_EXTERN_MODULE(RNSecureKeystoreModule, NSObject)
RCT_EXTERN_METHOD(getJwk: (RCTPromiseResolveBlock)resolve
rejecter: (RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(storeValueInCloud:(NSString *)key
value:(NSString *)value
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)

RCT_EXTERN_METHOD(retrieveValueFromCloud:(NSString *)key
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)


@end
28 changes: 26 additions & 2 deletions ios/RNSecureKeystoreModule.swift
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,32 @@ class RNSecureKeystoreModule: NSObject,RCTBridgeModule {
}
secureKeystore.retrieveKey(tag: alias, onSuccess: successLambda, onFailure: failureLambda)
}



@objc
func storeValueInCloud(_ key: String, value: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
let successLambda: (Bool) -> Void = { success in
resolve(success)
}

let failureLambda: (String, String) -> Void = { code, message in
reject(code, message, nil)
}

secureKeystore.storeValueInCloud(key: key, value: value, onSuccess: successLambda, onFailure: failureLambda)
}

@objc
func retrieveValueFromCloud(_ key: String, resolver resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
let successLambda: (String?) -> Void = { value in
resolve(value)
}

let failureLambda: (String, String) -> Void = { code, message in
reject(code, message, nil)
}

secureKeystore.retrieveValueFromCloud(key: key, onSuccess: successLambda, onFailure: failureLambda)
}


}
Loading

0 comments on commit 182de1e

Please sign in to comment.