From 5f98154b823b5e8bf9b6b7a6d10035f44d7ee5ed Mon Sep 17 00:00:00 2001 From: Diana Khortiuk Date: Mon, 10 Feb 2025 14:18:34 +0200 Subject: [PATCH 1/2] upgrade ios version and add additionalQueryParams to directLoginAction --- FronteggRN.podspec | 4 ++-- example/ios/Podfile.lock | 4 ++-- ios/FronteggRN.m | 1 + ios/FronteggRN.swift | 9 ++++++++- src/FronteggNative.ts | 5 +++-- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/FronteggRN.podspec b/FronteggRN.podspec index fa20879..e9ff9bd 100644 --- a/FronteggRN.podspec +++ b/FronteggRN.podspec @@ -20,10 +20,10 @@ Pod::Spec.new do |s| # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79. if respond_to?(:install_modules_dependencies, true) install_modules_dependencies(s) - s.dependency "FronteggSwift", "1.2.31" + s.dependency "FronteggSwift", "1.2.32" else s.dependency "React-Core" - s.dependency "FronteggSwift", "1.2.31" + s.dependency "FronteggSwift", "1.2.32" # Don't install the dependencies when we run `pod install` in the old architecture. if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 18f5d06..c2fc5e5 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -11,10 +11,10 @@ PODS: - ReactCommon/turbomodule/core (= 0.72.1) - fmt (6.2.1) - FronteggRN (1.2.8): - - FronteggSwift (= 1.2.31) + - FronteggSwift (= 1.2.32) - RCT-Folly (= 2021.07.22.00) - React-Core - - FronteggSwift (1.2.31) + - FronteggSwift (1.2.32) - glog (0.3.5) - hermes-engine (0.72.1): - hermes-engine/Pre-built (= 0.72.1) diff --git a/ios/FronteggRN.m b/ios/FronteggRN.m index 689d4f9..65404ab 100644 --- a/ios/FronteggRN.m +++ b/ios/FronteggRN.m @@ -20,6 +20,7 @@ @interface RCT_EXTERN_MODULE(FronteggRN, RCTEventEmitter) directLoginAction: (NSString *)type data: (NSString *)data ephemeralSession: (BOOL)ephemeralSession + additionalQueryParams: (nullable NSDictionary *)additionalQueryParams resolver: (RCTPromiseResolveBlock)resolve rejecter: (RCTPromiseRejectBlock)reject ) diff --git a/ios/FronteggRN.swift b/ios/FronteggRN.swift index 7909d11..384f46c 100644 --- a/ios/FronteggRN.swift +++ b/ios/FronteggRN.swift @@ -151,11 +151,18 @@ class FronteggRN: RCTEventEmitter { _ type: String, data: String, ephemeralSession: Bool, + additionalQueryParams: [String: String]? = nil, resolver: @escaping RCTPromiseResolveBlock, rejecter: RCTPromiseRejectBlock ) -> Void { - fronteggApp.auth.directLoginAction(window: nil, type: type, data: data, ephemeralSession: ephemeralSession) { _ in + fronteggApp.auth.directLoginAction( + window: nil, + type: type, + data: data, + ephemeralSession: ephemeralSession, + additionalQueryParams: additionalQueryParams + ) { _ in resolver("Success") } } diff --git a/src/FronteggNative.ts b/src/FronteggNative.ts index c257bc2..bba5210 100644 --- a/src/FronteggNative.ts +++ b/src/FronteggNative.ts @@ -46,9 +46,10 @@ export async function refreshToken() { export async function directLoginAction( type: string, data: string, - ephemeralSession: boolean = true + ephemeralSession: boolean = true, + additionalQueryParams?: Record ): Promise { - return FronteggRN.directLoginAction(type, data, ephemeralSession); + return FronteggRN.directLoginAction(type, data, ephemeralSession, additionalQueryParams); } export async function loginWithPasskeys(): Promise { From 8b745bc9aee5b64f870da8e8a0e7358622190c92 Mon Sep 17 00:00:00 2001 From: Diana Khortiuk Date: Mon, 10 Feb 2025 14:21:13 +0200 Subject: [PATCH 2/2] fix linter --- src/FronteggNative.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/FronteggNative.ts b/src/FronteggNative.ts index bba5210..9bb9d73 100644 --- a/src/FronteggNative.ts +++ b/src/FronteggNative.ts @@ -49,7 +49,12 @@ export async function directLoginAction( ephemeralSession: boolean = true, additionalQueryParams?: Record ): Promise { - return FronteggRN.directLoginAction(type, data, ephemeralSession, additionalQueryParams); + return FronteggRN.directLoginAction( + type, + data, + ephemeralSession, + additionalQueryParams + ); } export async function loginWithPasskeys(): Promise {