On an iOS device and all simulators, the application works fine, but when adding it to the App Store, it was rejected by answering:
2.1: Apps that crash will be rejected
We found your app crashed on review.
We have attached detailed crash logs for your reference.
It makes it necessary to revise your app.
If you’re interested in technical support. If you have crash logs, symbolicate crash logs before contacting Apple Developer Technical Support.
If you have difficulty reproducing this workflow, you can try testing the workflow with Xcode's Archive feature.