Hyperlink Button & Windows.System.LaunchUriAsync() not working on iOS #18562
-
We're trying to add links to our privacy policy and EULA to meet apple's app store requirements. Both the hyperlinks and the buttons work when running on windows, but do not on iOS (see snippets below). <Grid HorizontalAlignment="Stretch" RowSpacing="20" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<HyperlinkButton Grid.Column="0"
HorizontalAlignment="Center"
Content="Privacy Policy"
NavigateUri="https://www.wereallrelated.com/privacy_policy.html" />
<HyperlinkButton Grid.Column="1"
HorizontalAlignment="Center"
Content="Terms of Use"
NavigateUri="https://www.apple.com/legal/internet-services/itunes/dev/stdeula" />
<Button Grid.Column="0"
Grid.Row="1"
Style="{StaticResource TextButtonStyle}"
Content="Privacy Policy"
Tag="https://www.wereallrelated.com/privacy_policy.html"
HorizontalAlignment="Center"
Click="On_Button_Hyperlink_Click" />
<Button Grid.Column="1"
Grid.Row="1"
Style="{StaticResource TextButtonStyle}"
Content="Terms of Use"
Tag="https://www.apple.com/legal/internet-services/itunes/dev/stdeula"
HorizontalAlignment="Center"
Click="On_Button_Hyperlink_Click" />
</Grid> private async void On_Button_Hyperlink_Click(object sender, RoutedEventArgs e)
{
// Launch the url from the button tag
if (sender is Button button)
{
if (button.Tag is string url)
{
if (Uri.TryCreate(url, UriKind.RelativeOrAbsolute, out Uri uri))
{
var result = await Windows.System.Launcher.LaunchUriAsync(uri);
}
}
}
} I put a HyperlinkButton in the project below to test. It would not work for me when running in debug on iOS in Visual Studio. |
Beta Was this translation helpful? Give feedback.
Answered by
MartinZikmund
Oct 30, 2024
Replies: 1 comment 5 replies
-
Thanks for the report. Could you indicate which version of Uno you're using? Also, do you see any exception in the app's logs? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@trydalch Turned this into an issue, follow the progress there please #18621