Skip to content

Commit 3e06a3c

Browse files
Merge pull request #63 from frontegg/upgrade-native-sdk
Upgrade Frontegg Native SDKs, Add support for loginHint in login action, Login promise now waiting until login process finished
2 parents 03e94a2 + 4e8aef2 commit 3e06a3c

17 files changed

Lines changed: 100 additions & 12096 deletions

FronteggIonicCapacitor.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
1313
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
1414
s.ios.deployment_target = '14.0'
1515
s.dependency 'Capacitor'
16-
s.dependency "FronteggSwift", "1.2.21"
16+
s.dependency "FronteggSwift", "1.2.23"
1717
s.swift_version = '5.1'
1818
s.pod_target_xcconfig = {
1919
'CODE_SIGNING_ALLOWED' => 'YES'

android/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ apply plugin: 'com.android.library'
1919

2020
android {
2121
namespace "com.frontegg.ionic"
22-
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
22+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
2323
defaultConfig {
2424
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 26
25-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
25+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
2626
versionCode 1
2727
versionName "1.0"
2828
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -52,10 +52,10 @@ dependencies {
5252
implementation fileTree(dir: 'libs', include: ['*.jar'])
5353
implementation project(':capacitor-android')
5454
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
55-
implementation "androidx.browser:browser:1.5.0"
55+
implementation "androidx.browser:browser:1.8.0"
5656
implementation 'io.reactivex.rxjava3:rxkotlin:3.0.1'
5757
implementation 'com.google.code.gson:gson:2.10'
58-
implementation 'com.frontegg.sdk:android:1.2.25'
58+
implementation 'com.frontegg.sdk:android:1.2.28'
5959

6060
testImplementation "junit:junit:$junitVersion"
6161
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"

android/src/main/java/com/frontegg/ionic/FronteggNativePlugin.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ public void load() {
113113
auth.isAuthenticated().getObservable(),
114114
auth.isLoading().getObservable(),
115115
auth.getInitializing().getObservable(),
116-
auth.getShowLoader().getObservable()
116+
auth.getShowLoader().getObservable(),
117+
auth.getRefreshingToken().getObservable()
117118
).subscribe(nullableObject -> {
118119
debouncer.debounce(this::sendEvent);
119120
});
@@ -135,6 +136,7 @@ private JSObject getData() {
135136
boolean isLoading = auth.isLoading().getValue();
136137
boolean initializing = auth.getInitializing().getValue();
137138
boolean showLoader = auth.getShowLoader().getValue();
139+
boolean refreshingToken = auth.getRefreshingToken().getValue();
138140
RegionConfig selectedRegion = auth.getSelectedRegion();
139141

140142
JSObject data = new JSObject();
@@ -148,6 +150,7 @@ private JSObject getData() {
148150
data.put("isLoading", isLoading);
149151
data.put("initializing", initializing);
150152
data.put("showLoader", showLoader);
153+
data.put("refreshingToken", refreshingToken);
151154
data.put("selectedRegion", Parser.regionToJSONObject(selectedRegion));
152155

153156
return data;
@@ -156,8 +159,11 @@ private JSObject getData() {
156159

157160
@PluginMethod
158161
public void login(PluginCall call) {
159-
FronteggApp.Companion.getInstance().getAuth().login(this.getActivity());
160-
call.resolve();
162+
String loginHint = call.getString("loginHint");
163+
FronteggApp.Companion.getInstance().getAuth().login(this.getActivity(), loginHint, ()-> {
164+
call.resolve();
165+
return null;
166+
});
161167
}
162168

163169
@PluginMethod

example/android/app/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apply plugin: 'com.android.application'
22

33

4-
def fronteggDomain = "auth.davidantoon.me"
4+
def fronteggDomain = "autheu.davidantoon.me"
55
def fronteggClientId = "b6adfe4c-d695-4c04-b95f-3ec9fd0c6cca"
66

77
android {
@@ -50,6 +50,7 @@ dependencies {
5050
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
5151
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
5252
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
53+
5354
implementation project(':capacitor-android')
5455
testImplementation "junit:junit:$junitVersion"
5556
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"

example/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
4+
55
repositories {
66
google()
77
mavenCentral()
88
}
99
dependencies {
1010
classpath 'com.android.tools.build:gradle:8.0.0'
11-
classpath 'com.google.gms:google-services:4.3.15'
11+
classpath 'com.google.gms:google-services:4.4.2'
1212

1313
// NOTE: Do not place your application dependencies here; they belong
1414
// in the individual module build.gradle files

example/capacitor.config.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@ const config: CapacitorConfig = {
99
},
1010
plugins:{
1111
FronteggNative:{
12-
// baseUrl:"https://auth.davidantoon.me",
13-
// clientId:"b6adfe4c-d695-4c04-b95f-3ec9fd0c6cca",
1412
useChromeCustomTabs:true,
1513
useAssetLinks:true,
1614
regions:[{
17-
key: 'eu1',
18-
baseUrl: 'https://auth.davidantoon.me',
15+
key: 'EU',
16+
baseUrl: 'https://autheu.davidantoon.me',
1917
clientId: 'b6adfe4c-d695-4c04-b95f-3ec9fd0c6cca'
2018
}, {
21-
key: 'us',
22-
baseUrl: 'https://davidprod.frontegg.com',
19+
key: 'US',
20+
baseUrl: 'https://authus.frontegg.com',
2321
clientId: 'd7d07347-2c57-4450-8418-0ec7ee6e096b'
2422
}]
2523
}

example/ios/App/App/App.entitlements

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>com.apple.developer.applesignin</key>
6+
<array>
7+
<string>Default</string>
8+
</array>
59
<key>com.apple.developer.associated-domains</key>
610
<array>
7-
<string>webcredentials:auth.davidantoon.me</string>
8-
<string>applinks:auth.davidantoon.me</string>
11+
<string>webcredentials:autheu.davidantoon.me</string>
12+
<string>webcredentials:davidantoon.me</string>
13+
<string>applinks:autheu.davidantoon.me</string>
914
</array>
1015
</dict>
1116
</plist>

example/ios/App/App/Frontegg-Multi.plist

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
<array>
77
<dict>
88
<key>key</key>
9-
<string>eu</string>
9+
<string>EU</string>
1010
<key>baseUrl</key>
11-
<string>https://auth.davidantoon.me</string>
11+
<string>https://autheu.davidantoon.me</string>
1212
<key>clientId</key>
1313
<string>b6adfe4c-d695-4c04-b95f-3ec9fd0c6cca</string>
1414
</dict>
1515
<dict>
1616
<key>key</key>
17-
<string>us</string>
17+
<string>US</string>
1818
<key>baseUrl</key>
19-
<string>https://davidprod.frontegg.com</string>
19+
<string>https://authus.frontegg.com</string>
2020
<key>clientId</key>
2121
<string>d7d07347-2c57-4450-8418-0ec7ee6e096b</string>
2222
</dict>

0 commit comments

Comments
 (0)