-
-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f613b1
commit f7a44bf
Showing
14 changed files
with
180 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
#if IOS || MACCATALYST || WINDOWS | ||
namespace OpenIddict.Sandbox.Maui.Client; | ||
namespace OpenIddict.Sandbox.Maui.Client; | ||
|
||
public partial class App : Application | ||
{ | ||
public App() => InitializeComponent(); | ||
|
||
protected override Window CreateWindow(IActivationState? activationState) => new(new AppShell()); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
#if IOS || MACCATALYST || WINDOWS | ||
namespace OpenIddict.Sandbox.Maui.Client; | ||
namespace OpenIddict.Sandbox.Maui.Client; | ||
|
||
public partial class AppShell : Shell | ||
{ | ||
public AppShell() => InitializeComponent(); | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
sandbox/OpenIddict.Sandbox.Maui.Client/Platforms/Android/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
</manifest> |
31 changes: 31 additions & 0 deletions
31
sandbox/OpenIddict.Sandbox.Maui.Client/Platforms/Android/MainActivity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Android.App; | ||
using Android.Content.PM; | ||
using OpenIddict.Client.SystemIntegration; | ||
using Intent = Android.Content.Intent; | ||
|
||
namespace OpenIddict.Sandbox.Maui.Client | ||
{ | ||
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, | ||
LaunchMode = LaunchMode.SingleTop, | ||
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] | ||
// Intent filter for custom URI scheme | ||
[IntentFilter(new[] { Intent.ActionView }, | ||
Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable }, | ||
DataScheme = "com.openiddict.sandbox.maui.client")] | ||
public class MainActivity : MauiAppCompatActivity | ||
{ | ||
|
||
protected override async void OnNewIntent(Intent? intent) | ||
{ | ||
base.OnNewIntent(intent); | ||
|
||
// Handle the custom URL scheme | ||
if (intent?.Data is not null && | ||
IPlatformApplication.Current?.Services is IServiceProvider provider) | ||
{ | ||
var scheme = intent?.Data?.Scheme; | ||
await provider.GetRequiredService<OpenIddictClientSystemIntegrationService>().HandleCustomTabsIntentAsync(intent!); | ||
} | ||
} | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
sandbox/OpenIddict.Sandbox.Maui.Client/Platforms/Android/MainApplication.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Android.App; | ||
using Android.Runtime; | ||
|
||
namespace OpenIddict.Sandbox.Maui.Client | ||
{ | ||
[Application] | ||
public class MainApplication : MauiApplication | ||
{ | ||
public MainApplication(IntPtr handle, JniHandleOwnership ownership) | ||
: base(handle, ownership) | ||
{ | ||
} | ||
|
||
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
sandbox/OpenIddict.Sandbox.Maui.Client/Platforms/Android/Resources/values/colors.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<color name="colorPrimary">#512BD4</color> | ||
<color name="colorPrimaryDark">#2B0B98</color> | ||
<color name="colorAccent">#2B0B98</color> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#if !IOS && !MACCATALYST && !WINDOWS | ||
#if !IOS && !MACCATALYST && !WINDOWS && !ANDROID | ||
Console.Error.WriteLine("This sample is only supported on iOS, Mac Catalyst and Windows."); | ||
#endif |
Oops, something went wrong.