microbiomedata / nmdc-field-notes

Mobile app for metadata collection on the go
https://fieldnotes.microbiomedata.org/
Other
1 stars 0 forks source link

Publish iOS app to Apple TestFlight (for beta testing) #114

Closed eecavanna closed 2 months ago

eecavanna commented 3 months ago

References

eecavanna commented 3 months ago

One of the prerequisites of putting the app on TestFlight is to Set the app category. I propose we go with the "Productivity" category.

image

When I chose a category in Xcode, the category appeared in the two INFOPLIST_KEY_LSApplicationCategoryType lines in ios/App/App.xcodeproj:

INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.productivity";
eecavanna commented 3 months ago

Another one of the prerequisites is to Set the version number and build string. We already have a version identifier in package.json and we display that on the "Settings" screen. I want to keep that consistent with the version number we use for the iOS app here.

The version number and build string are expected to be in the format [Major].[Minor].[Patch] where Patch is a maintenance release, as in 10.14.1. Both keys are required by the App Store.

When I specified a value in Xcode, the value appeared in the two MARKETING_VERSION lines in ios/App/App.xcodeproj:

MARKETING_VERSION = 0.0.1;

The "Build" string is already set to 1. As an experiment, I changed it to 123 via Xcode in order to see how that would affect the code base. I found that changing the value in Xcode causes the two CURRENT_PROJECT_VERSION lines in ios/App/App.xcodeproj to change:

CURRENT_PROJECT_VERSION = 1;

Maybe we can manage some of these things via GitHub Actions. See https://www.npmjs.com/package/capacitor-set-version

eecavanna commented 3 months ago

Here are some screenshots of Xcode to go along with the previous two comments.

image image
eecavanna commented 3 months ago

I was able to build an archive, but when I clicked "Validate App" (rather than clicking "Distribute App" already), I got an error.

image

The error logs included this line (among others):

[DVTAppStoreConnect.ServiceBackendError(context: DVTAppStoreConnect.ServiceFailureContext(errorDescription: "Error Creating App Record", failureReason: "Xcode failed to create an app record with App Store Connect."), wrappedError: Unexpected Status Code: 500

For that reason, I will try creating an app record manually via App Store Connect.

eecavanna commented 3 months ago

Here's how I tried to manually create the app on App Store Connect (note: I am an "admin" there):

  1. Go to https://appstoreconnect.apple.com
  2. Scroll to the bottom of the page and click on "Developer," which leads to https://appstoreconnect.apple.com/apps
  3. Click the "Add apps" button

At that point, I got this error message:

image

The Users and Access page on App Store Connect does indicate who the "Account Holder" is. I will send her an email.

image

eecavanna commented 3 months ago

We are still blocked on this. This Issue can be moved to the next sprint.

eecavanna commented 2 months ago

The app is on TestFlight now!

image

It is currently only available for "Internal Testing." Next sprint, I'll work on making it available for "External Testing" also. With that in mind, I'll move this ticket to the next sprint.