amay077 / Xamarin.Forms.GoogleMaps

Map library for Xamarin.Forms using Google maps API
https://www.nuget.org/packages/Xamarin.Forms.GoogleMaps/
MIT License
544 stars 344 forks source link

Is there a way to assign an ApiKey without the use of a constant? #794

Open Maticasale opened 1 year ago

Maticasale commented 1 year ago

VERSIONS

PLATFORMS

ACTUAL BEHAVIOR

I will explain my situation.

I'm working on a taxi application that consumes a lot of the google map service, so in order to reduce costs we decided to use 6 different ApiKeys that rotate throughout the month. These ApiKeys are received by my app through a service that tells me which ApiKey to use when it starts.

The problem appears when I can't find a way to change the apiKey because the only way to assign it is through a constant and It became imposible.

Captura de Pantalla 2022-10-14 a la(s) 15 34 11

(Sorry for my bad English)

ACTUAL SCREENSHOTS/STACKTRACE

This is what happens when I don´t use a constant

Captura de Pantalla 2022-10-14 a la(s) 15 36 50

But When it is a constant, everything is OK

Captura de Pantalla 2022-10-14 a la(s) 15 41 04

EXPECTED BEHAVIOR

Get ApiKey through a service and assign it at the beginning when I launch my App