Describe the bug
We run an app using <MapboxGL.MapView /> with ~2500 monthly active users which should fit into the Mapbox free plan where 25k users per month are free with unlimited map usage ("Each user may make unlimited Vector Tiles API and Raster Tiles API requests."). The problem is we just received an unexpected invoice for our Mapbox usage mainly because of Vector Tiles API requests which were over 400k last month. We asked Mapbox support to explain the issue and they confirmed this level of usage should be free when using native SDKs, but told us that the issue could be in the unofficial library we're using to access Mapbox services:
support:
How're you implementing the Mobile SDK? Are you using our native apps or another codebase? This might be what is causing us to register and bill your vector tile API requests.
me:
we're using React Native Mapbox library https://docs.mapbox.com/help/glossary/maps-sdk-for-react-native/ , but that's just a thin React Native wrapper on top of Mapbox native SDKs for iOS and Android.
support:
Unfortunately, this looks like it might be an implementation issue, and we are not in a position currently where we can support further investigation of this, as the reactive native library you're using is no longer supported by Mapbox, and is community maintained.
Is this a known issue when using this library? Or could there be any bug in implementation causing that? Or is just Mapbox detecting React Native or this library and does this intentionally and there's nothing we can do about this?
To Reproduce
Example:
<MapboxGL.MapView
ref={map}
style={[styles.container, props.style]}
compassEnabled={false}
onRegionIsChanging={onRegionIsChanging}
rotateEnabled={props.rotationEnabled && !props.disableInteractions}
onRegionDidChange={onRegionChanged}
regionDidChangeDebounceTime={10}
pitchEnabled={false}
scrollEnabled={!props.disableInteractions}
zoomEnabled={!props.disableInteractions}
onLayout={props.onLayout}
onPress={onPress}
>
<MapboxGL.Camera
ref={camera}
maxZoomLevel={18}
defaultSettings={mapSettings}
followUserLocation={props.keepUserCentered}
followUserMode={props.followUserMode || 'normal'}
/>
{props.children}
{props.showUserLocation && <MapboxGL.UserLocation showsUserHeadingIndicator renderMode={ENV.IS_ANDROID ? 'normal' : 'native'} />}
</MapboxGL.MapView>
Expected behavior
We should not be billed for our usage.
Screenshots


Versions (please complete the following information):
@Buthrakaur thanks for the report.
I'm not aware of such an issue.
Is my understanding correct that mapbox says that it's free for up to 25K users, with unlimited requests? But because you're using react-native-mapbox-gl the unlimited requests part does not apply?!
react-native-mapbox-gl uses unmodified mapbox-gl-native-ios and mapbx-gl-native-android, i don't think we do any unsupported thing, or misuse their libs. I don't see how it's different from an app consuming mapbox-gl-native-* libs directly.
Assuming there is a misuse, do they have any tooling/logs or whatever to find out the nature of misuse?!
@mfazekas
Is my understanding correct that mapbox says that it's free for up to 25K users, with unlimited requests?
yes
But because you're using react-native-mapbox-gl the unlimited requests part does not apply?!
no - they say the unoffical unsupported library we use (= react-native-mapbox-gl :)) is probably causing some ad-hoc calls to Vector Tiles API service which aren't being done via their native iOS/Android SDK libs and this causes the Vector Tiles API requests to go above free limits (there're 200k Vector Tiles API requests free each month).
react-native-mapbox-gl uses unmodified mapbox-gl-native-ios and mapbx-gl-native-android, i don't think we do any unsupported thing, or misuse their libs. I don't see how it's different from an app consuming mapbox-gl-native-* libs directly.
Thanks - this is what I exactly thought and what I told to the support, but didn't succeed :( It looks like they just somehow detect the react-native library usage and bill the service differently, but I can't imagine how do they detect it technically - do you have any idea?
Assuming there is a misuse, do they have any tooling/logs or whatever to find out the nature of misuse?!
They aren't willing to help:
We are only able to actively support technical fixes for our annually committed customers, the minimum spend for which is $25k per year. You can still access technical support via [email protected] to investigate what implementation issues might be causing your vector tile API calls to be counted independently. Please note that there is no SLA for response time from this team for our free customers.
@mfazekas btw do you have an access to a Mapbox account/statistics for a purely Native SDK powered app? I'd be curious if the Vector Tiles API request counter just always displays zero or if it's somehow zero-ed in the billing/invoice.
@Buthrakaur
I just checked that out as I was following the discussion, the number of requests for the Vector Tiles API is not displayed for my purely native app. I'm currently on the free plan, I have $0 billings each month.

@jderrough thanks a lot for the screenshot! Is this Android or iOS app?
So it looks like there could be 3 possible causes of this issue:
btw I'm surprised no one reported the same issue yet - aren't there any big apps using react-native-mapbox-gl?
@Buthrakaur
I'm also using react-native-mapbox-gl in the app I'm playing with.
@jderrough and do you see Vector Tiles API request count >0 in the stats of this react-native-mapbox-gl powered app too or is it zero as on your "purely native app" screenshot above?
@Buthrakaur
Sorry I got you confused. When I wrote "purely native app", I was referring to the React Native app I'm playing with. The screenshot is for that app, which is the only one I'm currently using with that Mapbox account. Maybe you get to see new stats if you also use other Mapbox SDKs where these would be relevant...
@jderrough I see.. so our app is probably using some parts of react-native-mapbox-gl which you don't use and which probably cause these extra requests. There're multiple features we use in our app:
MapboxGL.MapView component to display online/offline mapMapboxGL.offlineManager to download a map region for offline useDo you use e.g. the offlineManager to download maps for offline use? And what version of react-native-mapbox-gl (or native SDKs) do you use, please? I guess the offlineManager could be the cause of this issue..
@Buthrakaur
I'm only using the MapboxGL.MapView component from react-native-mapbox-gl 8.1.0-rc.2. The MapboxVersionNumber from the SDK is set to 15256.
So I asked support once more and it looks like it's completely unrelated to react-native-mapbox-gl library or React Native. It's just about their little bit confusing pricing docs and previous support guy which probably didn't understand their pricing well like me 馃槃 The Vector Tiles API requests are counted and billed for offline downloads whereas online usage is counted and billed on monthly active users basis - that's the important difference and reason why we got billed unexpectedly. Also their statement "Each user may make unlimited Vector Tiles API and Raster Tiles API requests." is partly invalid :/
Most helpful comment
So I asked support once more and it looks like it's completely unrelated to react-native-mapbox-gl library or React Native. It's just about their little bit confusing pricing docs and previous support guy which probably didn't understand their pricing well like me 馃槃 The Vector Tiles API requests are counted and billed for offline downloads whereas online usage is counted and billed on monthly active users basis - that's the important difference and reason why we got billed unexpectedly. Also their statement "Each user may make unlimited Vector Tiles API and Raster Tiles API requests." is partly invalid :/