JeroenM
JeroenM

Reputation: 837

How to fix Warning: map service token not specified

I'm working on an app in Xamarin that uses a map. The map seems to work fine because it does show my location, but it keeps showing me "warning map service token not specified" underneath the map.

The Api key type is basic/UWP and it's enabled. I put the Api key in MainPage.xaml.cs

public MainPage()
    {
        Xamarin.FormsMaps.Init("myApiKey");
        this.InitializeComponent();
        LoadApplication(new BarApp.App());
    }

And I also checked "Location" in Package.appxmanifest

I get no other errors, and everything else seems to work fine, so i'm really confused what the problem could be :/

Thanks in advance! (:

-Jeroen

Explanation I used: https://developer.xamarin.com/guides/xamarin-forms/user-interface/map/

Upvotes: 0

Views: 2547

Answers (1)

Nico Zhu
Nico Zhu

Reputation: 32775

The map seems to work fine because it does show my location, but it keeps showing me "warning map service token not specified"

The native MapControl is BingMap in UWP platform. According to Request a maps authentication key, Your Universal Windows app must be authenticated before it can use the MapControl and map services in the Windows.Services.Maps namespace. The authentication key in Xamarin official code sample was expired. You could request a new maps authentication key from the Bing Maps Developer Center and add it to your app.

Upvotes: 2

Related Questions