Skip to content

Commit 97a6986

Browse files
authored
API Key updates (#1471)
1 parent 1dc721a commit 97a6986

File tree

5 files changed

+41
-46
lines changed

5 files changed

+41
-46
lines changed

src/MAUI/Maui.Samples/Views/ApiKeyView.xaml

+27-35
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,37 @@
11
<?xml version="1.0" encoding="utf-8" ?>
2-
<ContentView
3-
x:Class="ArcGIS.ApiKeyView"
4-
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
5-
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
2+
<ContentView x:Class="ArcGIS.ApiKeyView"
3+
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
65
<ContentView.Content>
76
<StackLayout Orientation="Vertical">
8-
<Label x:Name="Instructions" Margin="5">
9-
<Label.FormattedText>
10-
<FormattedString>
11-
<Span Text="Some content used in the samples requires a developer API key for access. Go to " />
12-
<Span
13-
Text="the developer documentation"
14-
TextColor="Blue"
15-
TextDecorations="Underline">
16-
<Span.GestureRecognizers>
17-
<TapGestureRecognizer Tapped="LinkTapped" />
18-
</Span.GestureRecognizers>
19-
</Span>
20-
<Span Text=" to learn how to obtain a developer API key for ArcGIS Online." />
21-
</FormattedString>
22-
</Label.FormattedText>
23-
</Label>
24-
<StackLayout Orientation="Horizontal">
7+
<HorizontalStackLayout Margin="5">
8+
<Label Text="Some content used in the samples requires an API key to access ArcGIS location services. Go to " />
9+
<Label Text="the developer documentation tutorial"
10+
TextColor="Blue"
11+
TextDecorations="Underline">
12+
<Label.GestureRecognizers>
13+
<TapGestureRecognizer Tapped="LinkTapped" />
14+
</Label.GestureRecognizers>
15+
</Label>
16+
<Label Text=" to create a new API key." />
17+
</HorizontalStackLayout>
18+
<Label Margin="5" Text="Ensure that your API key privileges include basemaps, geocoding and routing services to run all samples." />
19+
<StackLayout Margin="5,0" Orientation="Horizontal">
2520
<Label Text="Current API key:" />
2621
<Label x:Name="CurrentKeyText" Margin="5,0,0,0" />
2722
</StackLayout>
28-
<Entry
29-
x:Name="KeyEntryBox"
30-
Margin="5"
31-
Text="" />
23+
<Entry x:Name="KeyEntryBox"
24+
Margin="5"
25+
Text="" />
3226
<StackLayout Orientation="Horizontal">
33-
<Button
34-
x:Name="SetKeyButton"
35-
Margin="5"
36-
Clicked="SetKeyButton_Clicked"
37-
Text="Set API key" />
38-
<Button
39-
x:Name="DeleteKeyButton"
40-
Margin="5"
41-
Clicked="DeleteKeyButton_Clicked"
42-
Text="Delete API key" />
27+
<Button x:Name="SetKeyButton"
28+
Margin="5"
29+
Clicked="SetKeyButton_Clicked"
30+
Text="Set API key" />
31+
<Button x:Name="DeleteKeyButton"
32+
Margin="5"
33+
Clicked="DeleteKeyButton_Clicked"
34+
Text="Delete API key" />
4335
</StackLayout>
4436
<Label x:Name="Status" Margin="5,0,0,0" />
4537
</StackLayout>

src/MAUI/Maui.Samples/Views/ApiKeyView.xaml.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ private void DeleteKeyButton_Clicked(object sender, EventArgs e)
5757
Status.Text = "API key removed";
5858
}
5959

60-
private void LinkTapped(object sender, EventArgs e)
60+
private void LinkTapped(object sender, TappedEventArgs e)
6161
{
62-
Microsoft.Maui.ApplicationModel.Launcher.OpenAsync(new Uri("https://links.esri.com/arcgis-api-keys"));
62+
Microsoft.Maui.ApplicationModel.Launcher.OpenAsync(new Uri("https://links.esri.com/create-an-api-key"));
6363
}
6464
}
6565
}

src/Samples.Shared/Managers/ApiKeyManager.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ public static string ArcGISDeveloperApiKey
4646
{
4747
get
4848
{
49-
// An Application programming interface key (API key) is a unique identifier used to authenticate a user, developer, or calling program with a server portal.
50-
// Typically, API keys are used to authenticate a calling program within the API rather than an individual user.
51-
// Go to https://links.esri.com/arcgis-api-keys to learn how to obtain a developer API key for ArcGIS Online.
49+
// An API key is a unique long-lived access token that is used to authenticate and monitor requests to ArcGIS location services and private portal items.
50+
// You can create and manage an API key using your portal when you sign in with an ArcGIS Location Platform account or an ArcGIS Online account with administrator access or a custom role that has the Generate API keys privilege.
51+
// To learn how to create and manage API keys, go to the https://links.esri.com/create-an-api-key tutorial to create a new API key.
52+
// You must ensure that your API key has the correct privileges to access secure resources.
5253
return _key;
5354
}
5455

src/WPF/WPF.Viewer/ApiKeyPrompt.xaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
<TextBlock x:Name="Instructions"
88
Margin="5"
99
TextWrapping="Wrap">
10-
Some content used in the samples requires a developer API key for access. Go to<Hyperlink NavigateUri="https://links.esri.com/arcgis-api-keys" RequestNavigate="Hyperlink_RequestNavigate">
11-
the developer documentation
10+
Some content used in the samples requires an API key to access ArcGIS location services. Go to <Hyperlink NavigateUri="https://links.esri.com/create-an-api-key" RequestNavigate="Hyperlink_RequestNavigate">
11+
the developer documentation tutorial
1212
</Hyperlink>
13-
to learn how to obtain a developer API key for ArcGIS Online.</TextBlock>
13+
to create a new API key.</TextBlock>
14+
<TextBlock Margin="5" TextWrapping="Wrap" Text="Ensure that your API key privileges include basemaps, geocoding and routing services to run all samples." />
1415
<StackPanel Orientation="Horizontal">
1516
<Label Content="Current Api Key:" />
1617
<TextBox x:Name="CurrentKeyText"

src/WinUI/ArcGIS.WinUI.Viewer/ApiKeyPrompt.xaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
<TextBlock x:Name="Instructions"
1111
Margin="5"
1212
TextWrapping="Wrap">
13-
Some content used in the samples requires a developer API key for access. Go to<Hyperlink NavigateUri="https://links.esri.com/arcgis-api-keys">
14-
the developer documentation
13+
Some content used in the samples requires an API key to access ArcGIS location services. Go to <Hyperlink NavigateUri="https://links.esri.com/create-an-api-key">
14+
the developer documentation tutorial
1515
</Hyperlink>
16-
to learn how to obtain a developer API key for ArcGIS Online.</TextBlock>
16+
to create a new API key.</TextBlock>
17+
<TextBlock Margin="5" Text="Ensure that your API key privileges include basemaps, geocoding and routing services to run all samples." />
1718
<StackPanel Orientation="Horizontal">
1819
<TextBlock Margin="5" Text="Current Api Key:" />
1920
<TextBox x:Name="CurrentKeyText"

0 commit comments

Comments
 (0)