Skip to content

Commit

Permalink
Fix README
Browse files Browse the repository at this point in the history
  • Loading branch information
frontegg-david committed Jan 8, 2024
1 parent f603d21 commit 6955253
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 21 deletions.
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ from [Frontegg Portal Domain](https://portal.frontegg.com/development/settings/d

- Navigate to [Login Method Settings](https://portal.frontegg.com/development/authentication/hosted)
- Toggle Hosted login method
- Add `{{ANDROID_PACKAGE_NAME}}://{{FRONTEGG_BASE_URL}}/ios/oauth/callback`
- Add `{{ANDROID_PACKAGE_NAME}}://{{FRONTEGG_BASE_URL}}/android/oauth/callback` **(without assetlinks)**
- Add `https://{{FRONTEGG_BASE_URL}}/{{ANDROID_PACKAGE_NAME}}/android/oauth/callback` **(required for assetlinks)**
- Replace `ANDROID_PACKAGE_NAME` with your application identifier
- Replace `FRONTEGG_BASE_URL` with your Frontegg base url

Expand Down Expand Up @@ -319,9 +320,11 @@ Follow [Config Android AssetLinks](#config-android-assetlinks) to add your Andro

The first domain will be placed automatically in the `AndroidManifest.xml` file. For each additional region, you will
need to add an `intent-filter`.
Replace `${FRONTEGG_DOMAIN_2}` with the second domain from the previous step.

NOTE: if you are using `Custom Chrome Tab` you have to use `android:name` `com.frontegg.android.HostedAuthActivity` instead of `com.frontegg.android.EmbeddedAuthActivity`


```xml

<application>
Expand All @@ -334,13 +337,15 @@ NOTE: if you are using `Custom Chrome Tab` you have to use `android:name` `com.f
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="https" />
<!-- Modify second domain -->
<data android:host="{{FRONTEGG_DOMAIN_2}}" />
<data android:pathPrefix="/oauth/account/activate" />
<data android:pathPrefix="/oauth/account/invitation/accept" />
<data android:pathPrefix="/oauth/account/reset-password" />
<data android:pathPrefix="/oauth/account/social/success" />
<data android:pathPrefix="/oauth/account/login/magic-link" />
<!-- DONT NOT COMBINE THE FOLLOWING LINES INTO ONE LINE-->
<data android:host="${FRONTEGG_DOMAIN_2}"
android:pathPrefix="/oauth/account/activate" />
<data android:host="${FRONTEGG_DOMAIN_2}"
android:pathPrefix="/oauth/account/invitation/accept" />
<data android:host="${FRONTEGG_DOMAIN_2}"
android:pathPrefix="/oauth/account/reset-password" />
<data android:host="${FRONTEGG_DOMAIN_2}"
android:pathPrefix="/oauth/account/login/magic-link" />
</intent-filter>
</activity>

Expand All @@ -352,8 +357,11 @@ NOTE: if you are using `Custom Chrome Tab` you have to use `android:name` `com.f
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<!-- Modify second domain -->
<data android:host="davidprod.frontegg.com" android:scheme="${package_name}" />
<!-- DONT NOT COMBINE THE FOLLOWING LINES INTO ONE LINE-->
<data android:host="${FRONTEGG_DOMAIN_2}" android:scheme="${package_name}" />
<data android:host="${FRONTEGG_DOMAIN_2}"
android:pathPrefix="/${package_name}/android/oauth/callback"
android:scheme="https" />
</intent-filter>
</activity>
</application>
Expand Down
4 changes: 2 additions & 2 deletions android/src/main/java/com/frontegg/android/FronteggApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class FronteggApp private constructor(
val isEmbeddedMode: Boolean = true,
val regions: List<RegionConfig> = listOf(),
val selectedRegion: RegionConfig? = null,
val handleLoginWithSocialLogin: Boolean = true,
val handleLoginWithSSO: Boolean = false,
var handleLoginWithSocialLogin: Boolean = true,
var handleLoginWithSSO: Boolean = false,
val useAssetsLinks: Boolean = false,
) {

Expand Down
2 changes: 1 addition & 1 deletion embedded/src/main/java/com/frontegg/demo/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class App : Application() {
BuildConfig.FRONTEGG_DOMAIN,
BuildConfig.FRONTEGG_CLIENT_ID,
this,
useAssetsLinks = true
useAssetsLinks = true,
)
}
}
28 changes: 20 additions & 8 deletions multi-region/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
tools:targetApi="31">
<activity
android:name=".RegionSelectionActivity"
android:label="Select Region"
android:exported="false" />
android:exported="false"
android:label="Select Region" />

<activity
android:name=".NavigationActivity"
Expand All @@ -39,12 +39,19 @@
<category android:name="android.intent.category.BROWSABLE" />

<data android:scheme="https" />
<data android:host="davidprod.frontegg.com" />
<data android:pathPrefix="/oauth/account/activate" />
<data android:pathPrefix="/oauth/account/invitation/accept" />
<data android:pathPrefix="/oauth/account/reset-password" />
<data android:pathPrefix="/oauth/account/social/success" />
<data android:pathPrefix="/oauth/account/login/magic-link" />
<!-- DONT NOT COMBINE THE FOLLOWING LINES INTO ONE LINE-->
<data
android:host="davidprod.frontegg.com"
android:pathPrefix="/oauth/account/activate" />
<data
android:host="davidprod.frontegg.com"
android:pathPrefix="/oauth/account/invitation/accept" />
<data
android:host="davidprod.frontegg.com"
android:pathPrefix="/oauth/account/reset-password" />
<data
android:host="davidprod.frontegg.com"
android:pathPrefix="/oauth/account/login/magic-link" />
</intent-filter>
</activity>
<activity
Expand All @@ -57,9 +64,14 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<!-- DONT NOT COMBINE THE FOLLOWING LINES INTO ONE LINE-->
<data
android:host="davidprod.frontegg.com"
android:scheme="${package_name}" />
<data
android:host="${frontegg_domain}"
android:pathPrefix="/${package_name}/android/oauth/callback"
android:scheme="https" />
</intent-filter>
</activity>
</application>
Expand Down

0 comments on commit 6955253

Please sign in to comment.