Skip to content

Commit 69b21e0

Browse files
committed
Added ability to open admin portal from the app.
Bump native sdks versions: iOS and Android.
1 parent ae60f43 commit 69b21e0

17 files changed

Lines changed: 133 additions & 7 deletions

File tree

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.76"
16+
s.dependency "FronteggSwift", "1.3.10"
1717
s.swift_version = '5.1'
1818
s.pod_target_xcconfig = {
1919
'CODE_SIGNING_ALLOWED' => 'YES'

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ dependencies {
6262
implementation "androidx.browser:browser:1.8.0"
6363
implementation 'io.reactivex.rxjava3:rxkotlin:3.0.1'
6464
implementation 'com.google.code.gson:gson:2.10'
65-
implementation 'com.frontegg.sdk:android:1.3.18'
65+
implementation 'com.frontegg.sdk:android:1.3.34'
6666

6767
testImplementation "junit:junit:$junitVersion"
6868
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import kotlin.Unit;
1010

11+
import com.frontegg.android.AdminPortalActivity;
1112
import com.frontegg.android.FronteggApp;
1213
import com.frontegg.android.FronteggAppKt;
1314
import com.frontegg.android.FronteggAuth;
@@ -322,4 +323,15 @@ public void getConstants(PluginCall call) {
322323
call.resolve(resultMap);
323324
}
324325

326+
@PluginMethod
327+
public void openAdminPortal(PluginCall call) {
328+
if (this.getActivity() == null) {
329+
call.reject("NO_ACTIVITY", "Cannot open Admin Portal without an active Activity");
330+
return;
331+
}
332+
333+
AdminPortalActivity.open(this.getActivity());
334+
call.resolve();
335+
}
336+
325337
}

docs/README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,28 @@ For full documentation, visit the Frontegg Developer Portal:
2222

2323
---
2424

25+
## 🔐 Native SDK versions
26+
27+
The Ionic Capacitor wrapper depends on the underlying native SDKs:
28+
29+
- On **Android**, the plugin and example app use `com.frontegg.sdk:android:1.3.34`.
30+
- On **iOS**, the plugin depends on `FronteggSwift` **1.3.10** via CocoaPods.
31+
32+
After upgrading, run `pod install` in your iOS project and rebuild both platforms.
33+
34+
---
35+
36+
## 🔐 Native SDK versions
37+
38+
The Ionic Capacitor wrapper depends on the underlying native SDKs:
39+
40+
- On **Android**, the plugin and example app use `com.frontegg.sdk:android:1.3.34`.
41+
- On **iOS**, the plugin depends on `FronteggSwift` **1.3.10** via CocoaPods.
42+
43+
After upgrading, run `pod install` in your iOS project and rebuild both platforms.
44+
45+
---
46+
2547
## 🧑‍💻 Getting Started with Frontegg
2648

2749
Don't have a Frontegg account yet?

docs/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
- [Setup Guide](setup.md)
44
- [Usage Examples](usage.md)
55
- [Advanced Topics](advanced.md)
6+
- [API Reference](api.md)

docs/advanced.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,25 @@ export default config;
244244

245245
If your app supports multiple environments or regions, define `applicationId` inside each region object:
246246

247-
```
247+
## Admin Portal (Beta)
248+
249+
The Admin Portal is a hosted page that lets end users manage their account, profile, sessions, and tenant settings. The Ionic Capacitor SDK exposes `openAdminPortal()` on `FronteggService`, which delegates to the native SDKs:
250+
251+
- **Android** — launches `AdminPortalActivity` (full-screen `WebView`)
252+
- **iOS** — presents `AdminPortalView` as a page sheet (`WKWebView`)
253+
254+
The portal loads `${baseUrl}/oauth/portal?appId=<applicationId>` and shares the SDK session, so authenticated users are not asked to sign in again.
255+
256+
> **Beta.** The API may change in future minor releases. Pin to an exact SDK version when embedding this in a shipping app.
257+
258+
### Multi-app prerequisite
259+
260+
For multi-app workspaces, configure `applicationId` in your native setup (see [Multi-apps support](#multi-apps-support)). Without `?appId=` the portal renders **"Application not found"** after sign-in.
261+
262+
### Open the portal
263+
264+
```typescript
265+
await this.fronteggService.openAdminPortal();
266+
```
267+
268+
The portal is dismissed when the user swipes down (iOS) or taps the built-in close button. On Android, `window.close()` finishes the activity automatically.

docs/usage.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,13 @@ export class MyPage implements OnInit {
287287
}
288288
}
289289
```
290+
291+
## Admin Portal (Beta)
292+
293+
Open the embedded Frontegg Admin Portal for authenticated users:
294+
295+
```typescript
296+
await this.fronteggService.openAdminPortal();
297+
```
298+
299+
See [Advanced Topics](advanced.md#admin-portal-beta) for prerequisites and platform behavior.

example/android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ dependencies {
6262

6363
implementation project(':capacitor-android')
6464
implementation project(':capacitor-cordova-android-plugins')
65-
implementation 'com.frontegg.sdk:android:1.3.18'
65+
implementation 'com.frontegg.sdk:android:1.3.34'
6666

6767
testImplementation "junit:junit:$junitVersion"
6868
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"

example/ios/App/Podfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ def capacitor_pods
1919
end
2020

2121
target 'App' do
22-
# Resolve FronteggSwift from git (1.2.76 not on CocoaPods trunk yet); must be before FronteggIonicCapacitor
23-
pod 'FronteggSwift', :git => 'https://github.com/frontegg/frontegg-ios-swift.git', :tag => '1.2.76'
22+
pod 'FronteggSwift', '1.3.10'
2423
capacitor_pods
2524
# Add your Pods here
2625
end

example/src/app/tab1/tab1.page.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,10 @@
3838
<br/>
3939
<br/>
4040
<ion-button *ngIf="isAuthenticated" (click)="refreshToken()">Refresh Token</ion-button>
41+
42+
<br/>
43+
<br/>
44+
<ion-button *ngIf="isAuthenticated" (click)="openAdminPortal()" aria-label="OpenAdminPortalButton">
45+
Open Admin Portal
46+
</ion-button>
4147
</ion-content>

0 commit comments

Comments
 (0)