My app requires access to the user's media library. My question relates tho the following scenario:
MPMediaLibrary.requestAuthorization()
I pop up an alert dialog explaining issue and providing button to open the app's iOS Settings.
UIApplication.shared.open(URL(string:UIApplicationOpenSettingsURLString)!)
This works fine as long as the iOS Settings app/screen is not open. The iOS Settings app launches and opens my app's newly created settings.
If iOS Settings app/screen is open ( not to my app, just open somewhere ), the iOS Settings app appears and is positioned where ever it was. Not what I want. If I switch back to my app, pop up the dialog, and do the open URL a second time, the iOS setting are opened for my app.
Is this normal behavior? How do I correct it?
Stackoverflow does a good job of presenting links to existing questions that may be the answer I'm looking for, but no go.
Mac Mini
Mojave 10.14.4
Xcode 10.2
Xcode - Project - IOS Deployment Target = 11.0
Xcode - Target - Deployment Targets = 12.1
Xcode - Swift v5
Physical devices:
- iPhone 6plus ios 12.1.3
- iPhone X iOS 12.1.4
Behavior:
- installation on Xcode Simulator results in: * icon appears as it should with initial installation.(multiple devices tested) - installation on physical devices by Xcode side-loading via debugger results in: * after initial installation, icon is missing. * app runs as expected. * ios settings entry exists. * ios iPhone storage entry exists. * 2nd debug run, icon appears. (2nd run can be immediate or after device disconnected/reconnected or Xcode restarted) - installation of ipa on physical devices by Xcode -> Window -> Devices & Simulators results in: * after initial installation, icon is missing. * (of course app cannot be run without icon) * ios settings entry exists. * ios iPhone storage entry exists. * 2nd ipa installation, icon appears. (2nd run can be immediate or after device disconnected/reconnected or Xcode restarted)
Note: I have recreated and re-generated my icons by several different tools. No change in behavior.
Note: I have downloaded a couple of simple technology demonstration Xcode projects from GitHub. They do not contain any icons. They rely on the ios default icon. Same behavior as my app.
Any insights or outright guesses would be appreciated.
For what it's worth..... I submitted the app to Apple for review. It was approved and is on the app store (Song Announcer). The ipa that I uploaded to App Store Connect exhibited the same "no app icon when initially installed" behavior when installed on my devices via Xcode. When downloaded from the App Store, the icon appears as expected.
Go figure.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.