You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
MapboxAccountManager is singleton and can be started only once with given access token. This is a problem for "showcase" apps which uses multiple Mapbox accounts (access token + style url combinations) in different Activities.
public static MapboxAccountManager start(Context context, String accessToken) {
if (mapboxAccountManager == null) {
// init some stuff
}
return mapboxAccountManager;
}
Workaround would be to use MapboxMapOptions.accessToken() but it is deprecated and assumably going away in the future. However, it can be used to initialise MapboxMap and MapView with different access tokens within the same app.
Suggested solutions:
check accessToken in MapboxAccountManager.start(). If it was different than in previous run, reset whole thing.
or
Implement MapboxAccountManager.stop() which would reset whole thing.
The text was updated successfully, but these errors were encountered:
@olliSP thank you for reaching out and explaining your issue. Note that we have removed MapboxAccountManager on the master branch and now working towards using Mapbox instead. I think exposing a setter their would solve the issue for you. Before loading a MapView you can call into Mapbox#setAccessToken(String) to change the current active accesstoken.
Platform: Android
Mapbox SDK version: 4.2.1
MapboxAccountManager is singleton and can be started only once with given access token. This is a problem for "showcase" apps which uses multiple Mapbox accounts (access token + style url combinations) in different Activities.
Workaround would be to use MapboxMapOptions.accessToken() but it is deprecated and assumably going away in the future. However, it can be used to initialise MapboxMap and MapView with different access tokens within the same app.
Suggested solutions:
or
The text was updated successfully, but these errors were encountered: