OTA updates and Constants

  1. SDK Version: 35.0.0
  2. Platforms: Android/iOS

We have an application that has recently introduced Google Maps (MapView). We found that the OTA update to the code would happen automatically, allowing users to access the functionality, even though they did not yet have the API keys required.

The API Keys have to go with a standalone build, as stated in the docs because they are nested in android and ios in the app.json.

A fix that we cam up with was to build the standalone app and submit to the stores with the relevant API Keys. The new functionality hidden from the user.

When the builds were approved and live, we would push an OTA update that shows the new functionality AND checks that they have the API keys before allowing them to proceed. If they don’t have them, we would send them to the app store to update.

import Constants from 'expo-constants'

...

const androidApiKey = get(android, 'config.googleMaps.apiKey')
  const iosApiKey = get(ios, 'config.googleMapsApiKey')
  const hasGoogleApiKey =
    (Platform.OS === 'ios' && iosApiKey) ||
    (Platform.OS === 'android' && androidApiKey)

...

Testing locally, we could get the keys perfectly fine. However, on live, it seems we were never able to get the keys back from the manifest, rending our “fix” useless as they were pushed to update to a version they already had…

I need to know why we wouldn’t be able to obtain the keys correctly in live? Also, if there is another way of dealing with this issue of OTA completing without the user having the relevant update/configuration from the store

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.