Running two Expo Release Channels on the same device? - react-native

I have a testing and production release channel, on TestFlight and the App Store, respectively. I want the ability to run both on the same device. Otherwise if there is an issue with my testing release channel me and my beta users are blocked from using the working production channel (as least without constantly downloading and overwriting the TestFlight vs App Store versions)
I tried https://medium.com/#ywongcode/building-multiple-versions-of-a-react-native-app-4361252ddde5, but it seems like most of the configurations were reverted on build, and I wound up with the same bundleIdentifier and therefore I could not download the TestFlight testing version without removing the App Store version.

I think your best bet is to release multiple apps from 1 source code. We ran into this problem as well and ended up releasing separate test (internal testing), beta (external testing) and production apps. Each with their own app logo, app name and expo release channel. As far as I know, there is no way to switch release channel after your app has been built.
Alternatively you could (beta) test your app by pointing your users to https://exp.host/#username/yourApp?release-channel=. This way your testers can test most of your app’s functionally in the Expo Go app.
You can use iOS Build Configurations and Android Build Variants to easily create different apps within one project.

Related

Best practice for using Expo development builds while also having Testflight version

I'm building a React Native app and, because I'm working on payments, Expo recommends I use their development build methodology. This is working pretty well.
I am also beginning to push versions of my app to App Store Connect, to share them with specific testers via Testflight. This also works fine.
However, as the developer, I can't have both the development build and the latest Testflight version installed on my phone at the same time because they have the same name.
I'm curious what are best practices React Native developers have to get around situations like this. Is it renaming the development build version of the app to free up that namespace?
To install both at the same time you need to create your development clients with different bundle identifier. There is a guide for that here https://docs.expo.dev/build-reference/variants/.

How to fix optimazition error publish in play store

my apk is 1.4MB but error is "This APK results in unused code and resources being sent to users. Your app could be smaller if you used the Android App Bundle. By not optimizing your app for device configurations, your app is larger to download and install on users' devices than it needs to be. Larger apps see lower install success rates and take up storage on users' devices."
how to fix this error
It's only a warning, not an error.
For an app that small I wouldn't worry.
It's not something that's made its way into the Ionic ecosystem yet but I heard that if you open up your project in Android Studio and then do the build through there you can create an app bundle.
I'm not totally sure that its fully tested for Ionic so you might have issues with this, but Android have published a full guide:
https://developer.android.com/guide/app-bundle#get_started
This is what they say:
Download Android Studio 3.2 or higher—it's the easiest way
to add dynamic feature modules and build app bundles.
Add support for Dynamic Delivery
by including a base module, organizing code and resources for configuration
APKs, and, optionally, adding dynamic feature modules.
Build an Android App Bundle using Android Studio.
If you're not using the IDE, you can instead build an app bundle from the
command line.
Test your Android App Bundle by using it to generate APKs that
you deploy to a device.
Enroll into app signing by Google Play.
Otherwise, you can't upload your app bundle to the Play Console.
Publish your app bundle to Google Play.

How to publish and keep multiple versions of an React Native app installed?

I am in need of advice of how to deal with something:
I have an app that will soon be published to App Store and Google Play, I would like to find a way to have a clone of this app with less features, this clone is meant to give a taste of the app for users and also for the salesman of the company to demonstrate it, also I would like to keep both apps installed in the same device, so in the case of the salesman, they could demonstrate with this "demo app" and also use the real app for their own purposes.
I know that I could just have a beta user group on TestFlight and Google Play but that would need me to register those users or give them a link to register as beta and would not be possible to have both apps installed.
I want to make this "demonstration app" to be downloadable from the stores, it would have different API calls from the real app, different icon, etc...
but I would like to avoid having to maintain and copying every change from the "production" app to the "demo" app.
The option I thought: create a branch and rename the app to the new signature, name, icons and so I will just have to always pull the diff from the origin/master branch and publish it on the stores, but it didn't worked, since xcode breaks the app and give me random errors when I do it.
I would appreciate to receive ideas and workarounds for this.
I can currently have four different versions of an app I developed installed. The solution for this really depends on your setup, but here is currently how I do it1. It is not the only way but it works for me and I find the issues that this setup causes so small that it doesn't really bother me.
iOS
The simplest solution for iOS is to have different Bundle Identifiers. This requires you to have different provisioning profiles. One provisioning profile for each development environment (if you want to put them on device for testing away from the development machine they need to be distribution profiles) and one profile for submission to the App Store.
Xcode has the ability to manage different environments with different provisioning profiles, however this caused me major issues when using CocoaPods and I ended up having to stop Xcode from managing it.
What I do now is I add a script to my workflow2 that forces the correct Bundle Identifier for the environment. If I want to build locally, I just manually change the Bundle Identifier and the provisioning profile (it only takes a second)
Android
For Android I use the built in flavors to manage the different environments. It is really easy to set up. in my app/build.gradle I added the following:
flavorDimensions "version"
productFlavors {
dev {
dimension "version"
applicationIdSuffix ".dev"
}
uat {
dimension "version"
applicationIdSuffix ".uat"
}
staging {
dimension "version"
applicationIdSuffix ".staging"
}
prod {
dimension "version"
applicationIdSuffix ".prod"
}
}
This adds a applicationIdSuffix to your builds which means that you can install multiple types on to your device. Using flavors is a really powerful way to manage your android applications. You can read more about using flavors here
One important point to note is that using flavors does change how you have to run your application.
Instead of using react-native run-android I now have to use react-native run-android --variant=devDebug.
When I want to build it instead of using ./gradlew assembleRelease, I have to use ./gradlew assembledevRelease (you have to change this for each flavor that you use)
There is also a small bug with react-native that when using the --variant flag it doesn't launch the app, so you just have to click on the icon on the device. But if you launch it from Android Studio it launches just fine.
So if you launch your application from Android Studio, or add the appropriate scripts to your package.json these issues melt away.
1 I don't use Expo for my production applications, only for prototyping, so these solutions are for full react-native applications with access to native code.
2 I use Bitrise to build my apps so it is easy to add bash scripts or similar to the build process.
If you want them to download the apps from stores then apps have to have different package/applicationIDs.
I've worked on a react native project recently and we actually handled staging and production apps in single branch. Although we didn't release staging app on play store, we were sharing using Google drive and since both app had different packages, it was possible to install both of them together.
To change the applicationId, you need to make changes in app's build.gradle file in Android. Simply add .demo or .anything at the end of your production applicationId. And also change your api end point and App name and icons if you'd like. So this becomes cumbersome doing manually after sometime because you have to change back and forth. So we wrote a shell script to make all these changes before building the apk.
We actually didn't need to install 2 versions on iPhone, so we didn't do anything about it. Also I'm not familiar with iOS development but I guess process will be somewhat similar.
Now we don't have to keep track of changes from one branch to another. Setup(Shell scripts) will take some but it will be worth it.

Expo uses old code even though new code has been deployed

I have a react-native app that is using Expo.
In the beginning of the project I pushed some code to the default publishing channel that was never intended to be used in production.
Since then I have released dozens of versions to production and mostly all works as expected. (New installs gets the latest JS code)
However, a few users still gets old versions of the code, even though they literally just downloaded the app from App Store / Google Play.
This is extremely frustrating. How can I make sure that fresh downloads of the app will download the correct/latest version och my JS?
Note that this is not related to the app detecting new code that might be available for download. It is the fact that the wrong code is downloaded and used to begin with. Is there any way to remove all JS-code except the very last version that I published? I imagine that would solve my issue
Turns out, expo don’t always do this successfully. You need to rebuild the react native bundle before publishing.https://proandroiddev.com/bundling-react-native-during-android-release-builds-ec52c24e200d
This is what expo gives as a feature known as Over the Air updates (OTA). Whenever a new version is built with expo channel, it automatically updates even in the app store and play store. But there is a way to disable the updates. the expo documentation for disabling:
It is possible to entirely disable OTA JavaScript updates in a standalone app, by setting updates.enabled to false in app.json. This will ignore all code paths that fetch app bundles from Expo's servers. In this case, all updates to your app will need to be routed through the iOS App Store and/or Google Play Store.
This setting is ignored in the Expo client.
And I do recommend you to read the documents of OTA, which is a good feature when you get to know all of it.
The expo link is expo OTA

Can't Install xCode 4.3 beta apps using TestFlight

I just upgraded to xCode 4.3 and used it to generate a new revision of an iPad app about 50 beta testers have been using for several months. I distributed the beta app through TestFlight as usual.
Most testers upgraded with no problem, but several testers are getting the TestFlight message "You have not permitted this device to install this build" when they try to install the new rev. I've never seen this message before. Their iPad UDID is definitely in the build's embedded.mobileprovision file and everything was working working fine with the prior revision.
What am I -- or the testers -- doing wrong and how do we correct it?
Hi i experienced the same and it seems that you must generate your mobile provisioner profile from Xcode(instead of Apple dev site for example) and you should update your App permissions (TestFlight) with this same provisioner profile that you just generated on your machine so basically the machine that generates and archive the apps using Xcode must generate the provisioner profile and then you should update your testflight app permissions with this file.
Does that make any sense?
Hope this works for you testflight is really nice to use, i faced same problems with all of my apps and hardware devices (testers all around the world)
Thanks
Turns out this is apparently a bug in Testflight. I tried to resolve the issue through their support forum and multiple emails with no real answer. I did not want to switch services as my testers knew the Testflight system well. But eventually switched to Diawi. My testers were able to install the app using Diawi with no problems.