Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated sample to hide iOS prompt #167

Merged
merged 1 commit into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.30.1" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.31.0" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="3.1.3" />
<PackageReference Include="Microsoft.Win32.Primitives" Version="4.3.0" />
<PackageReference Include="NETStandard.Library" Version="2.0.3" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1560" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.10" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.30.1" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.31.0" />
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Identity.Client" Version="4.30.1" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.31.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Xamarin.Forms">
<Version>4.8.0.1560</Version>
Expand Down
2 changes: 2 additions & 0 deletions 1-Basic/UserDetailsClient/UserDetailsClient/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
HorizontalOptions="FillAndExpand" />
<Button x:Name="btnSignInSignOut"
Text="Sign in"
FontSize="Medium"
Margin="20"
Clicked="OnSignInSignOut"
VerticalOptions="End"
HorizontalOptions="FillAndExpand" />
Expand Down
9 changes: 7 additions & 2 deletions 1-Basic/UserDetailsClient/UserDetailsClient/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ async void OnSignInSignOut(object sender, EventArgs e)
{
try
{
// Hide the privacy prompt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a lnk to the wiki or doc where it explains what this is? Maybe it should be false by default...

SystemWebViewOptions systemWebViewOptions = new SystemWebViewOptions()
{ iOSHidePrivacyPrompt = true, };

authResult = await App.PCA.AcquireTokenInteractive(App.Scopes)
.WithParentActivityOrWindow(App.ParentWindow)
.ExecuteAsync();
.WithParentActivityOrWindow(App.ParentWindow)
.WithSystemWebViewOptions(systemWebViewOptions)
.ExecuteAsync();
}
catch(Exception ex2)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AsyncUsageAnalyzers" version="1.0.0-alpha003" developmentDependency="true" />
<PackageReference Include="Microsoft.Identity.Client" version="4.30.1" />
<PackageReference Include="AsyncUsageAnalyzers" version="1.0.0-alpha003" developmentDependency="true" Version="1.0.0-alpha003" />
<PackageReference Include="Microsoft.Identity.Client" version="4.31.0" Version="4.31.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1560" />
</ItemGroup>
Expand Down