expo / custom-expo-updates-server

238 stars 67 forks source link

expo.json extra fields are not exported on manifest endpoint #25

Open j005u opened 1 year ago

j005u commented 1 year ago

If the application uses the extra field in expo.json to set custom runtime parameters (as we do), then they will be missing in Constants.manifest2 after an OTA update due to the manifest endpoint not including them.

Happy to PR the 1 liner fix, if appropriate. Or if we should not be doing this then it'd be good to know the reasoning.

I'll also note that it took me hours to figure out that after an OTA update we're supposed to use Constants.manifest2 as opposed to Constants.manifest to access the application manifest. While technically an expo-constants 'issue', I figured maybe someone else will find this tidbit useful.

j005u commented 1 year ago

I was being somewhat of an idiot: the extra data I was after is now available under extra.expoClient.extra in a stock configuration.

This means that we have to use Constants.manifest.extra for data bundled with the app and Constants.manifest2.extra.expoClient.extra for any shipped with an update. For consistency it seems better to still merge the top level extra property into the output and strip it from the expoClient map, but maybe I'm missing some kind of reasoning as to the new path under expoClient?