I have read this discussion, but it is not clear of how to solve it yet.
Recently I eject my project from Managed to Bare, still want to use OTA updates.
I use fastlane to automate the build and deploy process. Basically I add
Expo.plist before building iOS app.
Herewith my fastlane code.
$NativeVersion = 'ManualVersion' platform :ios do desc 'Build and deploy' private_lane :build do |options| buildNumber = Time.now.strftime("%y%m%d%H%M") buildDirectory = './ios/build' releaseChannel = $NativeVersion + '-' + options[:type] set_info_plist_value( path: './ios/tooot/Supporting/Expo.plist', key: 'EXUpdatesSDKVersion', value: $ExpoSDK ) set_info_plist_value( path: './ios/tooot/Supporting/Expo.plist', key: 'EXUpdatesReleaseChannel', value: releaseChannel ) case options[:type] when 'staging', 'production' increment_build_number( xcodeproj: './ios/tooot.xcodeproj', build_number: buildNumber ) app_store_connect_api_key( key_filepath: "./fastlane/appstore.p8" ) end case options[:type] when 'staging' match( type: 'appstore', readonly: true ) build_ios_app( scheme: 'tooot', workspace: './ios/tooot.xcworkspace', export_method: 'app-store', output_directory: buildDirectory, output_name: releaseChannel + '-' + buildNumber ) upload_to_testflight( skip_submission: true, notify_external_testers: false ) end yarn( # The 'expo publish' script package_path: './package.json', flags: 'release', command: releaseChannel ) end desc 'Build staging to TestFlight' lane :staging do build(type: 'staging') end end
Above flow works perfectly. But launching the app from TestFlight results in undefine of
Constants.manifest.releaseChannel. Though the OTA is working perfectly. After the building above, I manually run
expo publish again to the same channel. After that, the app runs OTA by itself, and now the
Constants.manifest.releaseChannel is correct.
What could be the reason behind
releaseChannel shows undefined but OTA is working fine? How can I fix this? Or maybe I should try to read
releaseChannel from somewhere else when the building is handled by RN instead of Expo?