Forum Cross Platform with Xamarin

Using Xamarin.Forms.Maps under Tizen

Hello

In my maps cross plateform solution I am adding a new Tizen client

All went ok until I setup the HERE Maps APIKEY based on the information in this page:
https://docs.tizen.org/application/dotnet/guides/location-sensors/maps

namespace AppProjectName
{
    class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
    {
        private static string APIKEY = "???";

        protected override void OnCreate()
        {
            base.OnCreate();
            LoadApplication(new App());
        }

        static void Main(string[] args)
        {
            var app = new Program();
            global::Xamarin.Forms.Forms.Init(app);
            Xamarin.FormsMaps.Init("HERE", APIKEY);
            //Xamarin.FormsMaps.Init("Google", APIKEY);
            app.Run(args);
        }
    }
}

The compilation is OK but when I run the program I get the following error:

System.UnauthorizedAccessException: Failed to create native handle for HERE, err: PermissionDenied
   at ErrorCodeExtensions.ThrowIfFailed(ErrorCode err, String msg, String file, String func, Int32 line)
   at Interop.ServiceHandle..ctor(String serviceProvider)
   at Tizen.Maps.MapService..ctor(String serviceProvider, String serviceProviderKey)
   at Xamarin.FormsMaps.Init(String provider, String authenticationToken)
   at AppProjectName.Program.Main(String[] args) in C:\Users\Username\reps\AppSolutionName\AppProjectName\AppProjectName.Tizen\AppProjectName.Tizen.cs:line 19

I used another Google Maps API key and I got the same result

Both APIKEYs are working well on the other plateforms (iOS, Android, UWP) that I built based on this example
https://github.com/xamarin/xamarin-forms-samples/tree/master/WorkingWithMaps/WorkingWithMaps

Unfortunatly the Xamarin Samples do not consider Tizen specifics (which is officially supported)

On the other hand Samsung do not publish cross plateform samples:
https://github.com/Samsung/Tizen-CSharp-Samples/tree/master/Mobile/Maps/Maps.Tizen.Mobile

Do you have any idea where does the problem comes from?

Thank you for your help

Regards

Best Answer

Answers

Sign In or Register to comment.