Hi, as we’re about to submit our managed app to the app stores, I’m worried about some of the IDFA stuff and other things which we don’t need that will balloon permissions and file size.
First, on ejecting, if I don’t explicitly reference things like the FB and Branch APIs, then will those not be brought into the app or do I have to do some explicit work to remove them?
Second, is the following a reasonable workflow?
Eject from the app, and build and submit the minimal standalone app to the app stores
Revert the ejection and continue development in managed mode
When the app needs a new update in the app stores, eject again and submit (including increment version numbers, etc.), and then go back to step 2 and repeat.
1 Like
Here is the process that works for us (obviously depends on which components you’re using):
In app.config.js
, increment MAJOR_VERSION_NUMBER
(Android always requires that the major version is incremented), and set PATCH_VERSION_NUMBER
to the current date.
Note, we have this related code in app.config.jsconst MAJOR_VERSION_NUMBER = 1;
const MINOR_VERSION_NUMBER = 1;
const PATCH_VERSION_NUMBER = 20210101;
const FULL_APP_VERSION = MAJOR_VERSION_NUMBER + "." + MINOR_VERSION_NUMBER + "." + PATCH_VERSION_NUMBER;
export default {
[...]
version: FULL_APP_VERSION,
ios: {
buildNumber: FULL_APP_VERSION
},
android: {
versionCode: MAJOR_VERSION_NUMBER
}
}
Ensure any production-related settings in App.js
:
Ensure isDevelopment = false;
Ensure isProduction = true;
Ensure isOffline = false;
git commit -am "Version X.Y.Z: Major changes"
git tag X.Y.Z
git push && git push --tags
Reset the production demo users
This is needed to reset Apple’s demo review user
Make sure you’re logged in to $USER with expo login
expo eject
iOS:
npx pod-install
Open XCode and then open $APP.xcworkspace
Wait for “Indexing” to complete
First time: Preferences } Accounts } Add }
Double click on $APP } Signing & Capabilities } Team: $APP Inc
Update the status bar style:
$APP } $APP } Info.plist
Right Click } Add Row } Status bar style: Light Content
Save the file
If you want to test in emulators, select the emulator type and click Play
Next to the play/stop buttons, to the right of $APP, select Build } Any iOS Device
Product } Archive
Click Distribute App
Wait for an email that “The following build has completed processing”
Quit XCode
There may be a Metro terminal window open. If so, Ctrl+C
and then Enter
to end it.
Go to App store Connect
Click on $APP
Click on the plus button in the top left to create a new version and put in X.Y.Z
Summarize updates under “What’s New in This Version”
If needed, update screenshots and other metadata.
iPhone 12 Pro Max for 6.5" Screenshots
iPhone 8 Plus for 5.5" Screenshots
iPad Pro (4th Gen) for iPad Pro (3rd Gen) 12.9" Screenshots
iPad Pro (4th Gen) for iPad Pro (2nd Gen) 12.9" Screenshots
Click the button, “Select a build before you submit your app”
Select Yes for encryption and Yes for exemption.
Click Save
Wait for the notification that the app is ready to be tested in Test Flight
Test the app using Test Flight
Android:
Update android/gradle.properties
and add to the bottom:org.gradle.daemon=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8
Update android/app/build.gradle
and add to the end of the android
section: dexOptions {
javaMaxHeapSize "2g"
}
To disable JS minification in the release build (for improved diagnostics), update project.ext.react
:project.ext.react = [
enableHermes: false,
extraPackagerArgs: [ '--minify=false' ]
]
Update android/app/src/main/AndroidManifest.xml
and replace uses-permission entries with: <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
Update android/build.gradle
and add the following right before the end }
of the repositories {
section of allprojects
: maven {
// expo-camera bundles a custom com.google.android:cameraview
url "$rootDir/../node_modules/expo-camera/android/maven"
}
sed -i.bak 's/com.$APP.$NAME.ReactNativeFlipper/com.$APP.ReactNativeFlipper/g' android/app/src/main/java/com/$APP/$NAME/MainApplication.java && rm android/app/src/main/java/com/$APP/$NAME/MainApplication.java.bak
Update android/app/src/main/java/com/$APP/$NAME/MainActivity.java
to set the last parameter to true
for SplashScreen.show
Update android/app/src/main/res/values/styles.xml
to add <item name="android:statusBarColor">@android:color/transparent</item>
within the Theme.App.SplashScreen
section.
Start Android Studio and wait for initialization to complete
Wait a little bit and it will pop-up “Plugin Update Recommended”; click update and wait for that to finish.
Stop Android Studio
Kill any running gradle daemons
Start Android Studio and wait for initialization to complete
Update the app icon:
Right click on app
} New } Image Asset
Foreground Layer } Path: $APP/assets/logowithmarginnobg512.png
Background Layer } Color: fcfcfc
Next
Finish
Do you want to add… } Cancel
Update the notification icon:
Right click on app
} New } Image Asset
Icon Type: Notification Icons
Asset Type: Image
Path: $APP/assets/logowithmarginnobg512.png
Name: notification_icon
Trim: Yes
Padding: 0%
Next
Finish
If you want to test in emulators, run the following (or use the later instructions to install the apk):
On Linux:
In one terminal window:
export ANDROID_HOME=$HOME/Android/Sdk/
export PATH=${ANDROID_HOME}/platform-tools/:${PATH}
react-native start
In Android studio, select the emulator type and click Play
Or from another terminal window:
export ANDROID_HOME=$HOME/Android/Sdk/
export PATH=${ANDROID_HOME}/platform-tools/:${PATH}
yarn android
On other operating systems:
In Android studio, select the emulator type and click Play
Or from another terminal window: yarn android
Stop dev server, VS Code, and any other memory intensive programs
Build } Generate Signed Bundle/APK
Android App Bundle
Key store path: files/android/upload-keystore.jks
Key store password: Android Upload Keystore
Key alias: upload
Key password: Android Upload Key
Uncheck “Export encrypted key…”
Next
Delete any previous *.aab and *.apks files under files/android/release/
Destination folder: files/android/
Build Variants: release
Finish
Do you want to add the following file to Git? } Remember, don’t ask again; Cancel
cd files/android/release/
rm *apks
Generate apks: java -jar ../bundletool-all-*.jar build-apks --bundle=app-release.aab --output=app-release.apks --ks=../upload-keystore.jks --ks-key-alias upload
export ANDROID_HOME=$HOME/Android/Sdk/
export PATH=${ANDROID_HOME}/platform-tools/:${PATH}
Connect Android phone by USB and check it’s in adb devices
java -jar ../bundletool-all-*.jar install-apks --apks=app-release.apks
Launch app from phone launcher
Close Android Studio
If the app testing is good:
iOS:
Go to App Store Connect
Click on $APP
Click Submit for Review
Android:
Update the Android app in the Play store:
Go to Google Play Console
Click on $APP
Click on Production
Click Create new release
Upload aab file
Under Release notes, summarize the updates (required)
<en-US>
Various bug fixes
</en-US>
Click Save
Click Review Release
Click Start rollout to Production
First time: Configure notifications to email when review is complete: All apps } Settings } Preferences
The store listing (such as screenshots) is updated independently under Store Presence } Main store listing
Pixel 2, Nexus 7, and Nexus 10 used for screenshots
iOS:
git checkout -b X.Y.Z_ios
git add -A .
git commit -am "iOS build"
git push --set-upstream origin X.Y.Z_ios
Android:
git checkout -b X.Y.Z_android
git add -A .
git commit -am "Android build"
git push --set-upstream origin X.Y.Z_android
git checkout master
git clean --force && git reset --hard && rm -rf android/ ios/
system
Closed
March 14, 2021, 1:56am
3
This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.