Quote

Hi @all, how is your week ? are u ready for learn something ? In this session, we will go to next session of expo for building mobile application, but in release stuff like artifacts to App Store and Google Play. Now let digesting, and don’t turn around

But before we start, if you want to know what happen in previous session, take your time to check Build mobile with Expo (Part 1) - Article cover about expo, way to build your application and get connection to authentication your host to expo.dev

About Mobile Artifact

Quote

Honestly, I don’t release as much application to these platforms, I just have little bit experience to hang out with Google Play and App Store for particular release to Testflight for IOS and Google Play Internal for Android, at least for internal testing. The story get your application to one of huge platform, ain’t gonna lie really hard in this time

IOS CI/CD (Created by: Bitrise)

Android CI/CD (Created by: Bitrise)

Info

In my perspective, this progress is try to describe step by step in the image with workflow, and give the illustration for understand more how to build artifact come, what file we get after that and where we head to release application.

Technically, expo does same thing as bitrise - Illustration of bitrise attached, automation platform to build and distribute mobile applications. But I want to share the journey, and you can do to get the best result with expo. But if you want to inspect more detail to build one of these artifact, I think fastlane is one of thing you want to find, read my old article to understand more

As you can see, the artifact of each platform have different in someway, and method to hang out make different but with expo anything else becoming easy more ever. Some reason, I will try to list in below about what thing you can do with expo

  1. Not need to implement build progress - if you read about previous session, you don’t need to hang out with implement step by step to build. Your application will sign with auto generated in expo.dev, but the sign it’s on you
  2. Have place to help you store certificate - The big problem is using with fastlane about method to keep anything secure, especially certificates for IOS and Android Platform, and anything else resolve store that in expo.dev with automation generate and supply for your application
  3. Artifact is stored inside expo.dev - You can retrieve your artifact inside expo.dev for 30 days, and be ready submit to any platform

Quote

I think if you want to try some easily, expo is one of thing recommendation for your first Android and IOS to build and distribute (NOTE: Bare React Native is hard but you will learn a lot, don’t rush to use expo)

I think with helping from tutorial articles of relate topics that can help you to earning more little knowledge before we start with next part

Try to release

As you can see, expo takes care mostly thing for us when try to release to one of build to platforms, including Google Play Store and App Store with zero (0) effort and complexity.

center

EAS Submit bring us powerful feature to release your build previous session through eas.json, again you need to take care itself inside profile, and submit it to help expo imagine what keys and certificate to help your application go to right place.

With both, Android and IOS, they have different way to create that secrets one, but I think you can get this with step by step through tutorial of Apple (Ease to understand)

  • Android: You need to handling create Google Service Account for yourself to help expo have permission to submit .aab to your Google Play Console (NOTE: Pay 29$ to using it). Android Platform require you manually created for first time to automation after that, explore at First Submission of an Android App
  • IOS: With Apple you need create Apple Account for yourself, and ain’t gonna lie really expensive (NOTE: 99$ to using it). IOS makes some sort of different with Android through you must be submitted through Apple upload methodology and you can’t do this step manually in Apple Portal.

Quote

With expo, I don’t have opportunity to release application Google Play, but with Testflight I have something want to share, but let go to app.json, you need to take a look some information to help you prevent error when upload

App Version

First thing, you need to notice about App Version parameter in app.json because Expo base on that value to assign value build for your both Android and IOS application, It means if you not make a change your next build won’t upload successfully to both platform

Can't upload in Google Play

Can't upload in Apple Connect

Warning

Therefore reason, app.json is placing you need to concerning every time to build and release your application because when you make a mistake, you need to try again and cost money to build (NOTE: Sometime 30 build-free times are not enough for a month) πŸ˜„

Take the look with App Versions part in documentation, you will figure out what parameter inside app.json need to replace

PropertyDescription
versionThe user-facing version visible in stores. On Android, it representsΒ versionNameΒ name inΒ android/app/build.gradle. On iOS, it representsΒ CFBundleShortVersionStringΒ inΒ Info.plist.
android.versionCodeThe developer-facing build version for Android. It representsΒ versionCodeΒ inΒ android/app/build.gradle.
ios.buildNumberThe developer-facing build version for iOS. It representsΒ CFBundleVersionΒ inΒ Info.plist.
app.json
{
  "expo": {
    "name": "ExampleApp",
    "slug": "example-app",
    "version": "1.0.0",
	...
    "ios": {
	  ...
      "buildNumber": "7",
      "config": {
        "usesNonExemptEncryption": false
      }
    },
    "android": {
	  ...
      "versionCode": 7
    }
}

Info

It means in one version - the big one, you need to specific unique or increment build version number buildNumber or versionCode to help your application to release successful corresponding to big version. When your application need to change new version - the big one, you can return to build version 1 for starting in new big version

But that action isn’t really need if you use expo version higher than 12.0, because in this version, Expo support user to use cli with remote mode instead of local mode, and It means you can try retrieve the build number Expo Cloud instead of from app.json. Read more at Remote version source and you can hang on through configuration

eas.json
{
  "cli": {
    "appVersionSource": "remote"
  },
  "build": {
    "development": {
    },
    "preview": {
    },
    "production": {
      "autoIncrement": true
    }
  }
}
 

As you can see set cli to remote because default will take local and in your profile build set autoIncrement to help you auto increase your app build, and your work is enjoying and expo will take care of all for you πŸ˜ƒ.

But It has some warning from expo, maybe you need to concern BTW

Warning

The remote version is initialized with the value from the local project. For example, if you haveΒ android.versionCodeΒ set toΒ 1Β in app config, when you create a new build using the remote version source, it will auto increment toΒ 2. However, if you do not have build versions set in your app config, the remote version will initialize withΒ 1Β when the first build is created.

One more thing, It will make sense your build from remotely, and you can safety removing your buildNumber or versionCode out of configuration inside app.json

In some other cases, you maybe need to concern to check out, really helpful with synchronize feature

Info

The big version - vesion won’t take effect from this feature, you need to manually change it inside your app.json

Or if you want to take around with local mode, the default option, come and take a look with Local version source but recommendation spend for remote with good behavior

App Encryption Compliance

When I first time to come up with Testflight, I wonder how the heck is this encryption because I don’t meet anything else with Android, actually this is not gonna App Signed, we will talk a bit on next part.

Therefore, try to google and you will figure out Complying with Encryption Export Regulations - A declaration the use of encryption in your app to streamline the app submission process.

Info

When you submit your app to TestFlight or the App Store, you upload your app to a server in the United States. If you distribute your app outside the U.S. or Canada, your app is subject to U.S. export laws, regardless of where your legal entity is based. If your app uses, accesses, contains, implements, or incorporates encryption, this is considered an export of encryption software, which means your app is subject to U.S. export compliance requirements, as well as the import compliance requirements of the countries where you distribute your app.

Every time you submit a new version of your app, App Store Connect asks you questions to guide you through a compliance review. You can bypass these questions and streamline the submission process by providing the required information in your app’sΒ Information Property ListΒ file.

For more information about export compliance, readΒ Export compliance overview.

It means you need to give documentation or doublecheck about encryption methodology because your application is outside the US. Maybe this article can give you best visualize about landscape problems

In this case, after you release app to testflight, It makes you costed little time to check the question of compliance, and that why expo or apple give us the methodology to reduce this step

Apple give us choose boolean for ITSAppUsesNonExemptEncryption inside expo configuration, to help you bypass this selection and reduce more time to access Apple Connect. Back to app.json, if you notice about usesNonExemptEncryption, It actually means for bypass encryption for application submission

app.json
{
  "expo": {
    "name": "ExampleApp",
    "slug": "example-app",
    "version": "1.0.0",
	...
    "ios": {
	  ...
      "buildNumber": "7",
      "config": {
        "usesNonExemptEncryption": false
      }
    },
    "android": {
	  ...
      "versionCode": 7
    }
}

Info

If don’t wanna set anything else about encryption, you just need to change that into false instead of true by default. After submission successfully, your application can directly gain permit for internal user accessible to our application

App Store Connect API

The story in this situation will not need to talk but it makes me cost little bit time and diligent to figure out what happening in Expo

With Apple Store Connect, they separate to multiple role and permission. Usually, when you try to get one Apple Account for yourself, you will stand on highest permission with Account Holder, and you will gently create Apple Store Connect API with zero (0) effort with submit command, and help you create a Apple Connect API Key right permission, and set to expo.dev. You should check out articles and documentations to figure out what you need to

In my situation, I am only stand App Manager, It means I can’t not create Apple Store Connect API Key for myself, and I need to request Admin or Account Holder to provide my API Key. But you must clarify twice type of Apple Store Connect API Key

  • Team Key - Required role:Β Account Holder orΒ Admin - this one actual thing you need to help expo connect to your Apple Store Connect, used across all the apps in your account, or you can assign them to only specific roles. (E.g - format: AuthKey_xxxxxxxx.p8)
  • Individual Key - Required role:Β Account Holder, Admin,Β App Manager,Β Customer Support, Developer, or Marketing - This one to help your application have permission to call API Service with only your account (E.g - format: AuthKey_xxxxxxxx.p8)

Therefore, you need to have Admin Key or higher to help your expo connect Apple Store Connect, and after that if your account not with Admin or Account Holder, please submit that key inside portal of expo.dev in credential of Application

center

Note

Remember Issuer Identifier can found in Admin or Admin Holder who one issue the ASC API Key for you, and Key Identifier usually the number behind your key, it mean xxxxxxxx on AuthKey-xxxxxxxx.p8

And now you can try to submit that with command

# Export EXPO_TOKEN
export EXPOT_TOKEN=<token>
 
# Get the build
eas build:view # View the nearest build
eas build:view --json # In json type
 
# Get the full list of build
eas build:list

Info

Now you will copy ID of build, It usually have format GUID

Submitting with command

eas submit -p ios --id Build-GUID

Note

Your profile will not configure anything, so expo will ask you couple question like Apple ID and Password, providing it for your shell and anything step will be taken by Expo

After successfully notification in your shell, you can get the result in your apple account, inΒ testflightΒ tab. With tester, you can invite them through testflight app in AppStore

Talk about automation story

Yeah I know you handle multiple step with expo with manually, so how about automation. When I try to relate you with some article about, let’s take the look again

Expo write a guide to help you provide secrets information through eas.json, and create a methodology to automation at all for your release. Read at Submitting your app using CI and following step

  • Provide the archive source (--latest,Β --id,Β --path, orΒ --url). Get this one for you
npx eas build:view --json | jq -r ".id"
  • Make sure that the iOS Bundle Identifier is present in yourΒ app config file. Actually, you will always push this stuff to your repositories

  • Set the ASC App ID (ascAppIdΒ inΒ eas.json). The ASC App ID is required to skip the Apple Developer log-in process, which will likely not be possible on CI due to the 2FA prompt. You must set apple id with non 2FA methodology to use itself on pipeline

  • Set up your App Store Connect API Key with EAS Servers. You can check the state of your credentials by runningΒ eas credentialsΒ or by runningΒ eas submit -p iosΒ interactively.

    1. App Store Connect API Key: Submitting in portal expo.dev, you don’t need configuration, unless you run expo in your local place
    ...
    "ios": {
    	"appleId": "john@turtle.com",
    	"ascAppId": "1234567890",
    	"appleTeamId": "AB12XYZ34S",
    	"ascApiKeyPath": "/path/to/asc/p8/key",
    	"ascApiKeyIssuerId": "AB12XYZ34S",
    	"ascApiKeyId": "AB12XYZ34S",
    	...
    }
    ...
    1. App Specific Password:Β Provide yourΒ passwordΒ and Apple ID Username by passing them in with theΒ EXPO_APPLE_APP_SPECIFIC_PASSWORDΒ environment variable andΒ appleIdΒ field inΒ eas.json, respectively.

With Expo, EAS_CLI actually support you through method to handling both build and submit in same time through build command

eas build --platform "$DEPLOY_PLATFORM" --non-interactive --no-wait --profile production --auto-submit

Fully CI/CD Pipeline write down in Github Action by Luca Zani, get the applause for him about useful and detailing pipeline 🀝

Conclusion

center

Success

That is @all for blog, hope you have time to take a look about artifact of Expo Build, and give you landscape to imagine step to help you distribute mobile application to Google Store and App Store. Expo is one great choice when I try to adapt pipeline, and automation with this platform, clear and make sense for all steps you need to completely. If you need your help, Expo is ready to listening and supporting inside their Github, Discord, X and Reddit

Quote

The week of mine come up with many thing, and I need to take care but yeah the weekend is time to stop, and try to write about the thing learn through journey. Therefore, stay safe, learn more and see yah on next weekend. Don’t forget check out new article Switch Role between AWS Accounts to hang out with AWS Cloud. Bye Bye πŸ™Œ