Hello. Anyone for whom the following code doesn't ...
# ios
t
Hello. Anyone for whom the following code doesn't work on iOS 18? It only opens "Apps" settings and not the actual app settings. It works well on iOS 15.
Copy code
val settingsUrl = NSURL.URLWithString(UIApplicationOpenSettingsURLString)
settingsUrl?.let {
    UIApplication.sharedApplication.openURL(it, emptyMap<Any?, Any?>(), null)
}
m
Did you test in a real device or simulator?
m
In my application I have
Copy code
NSURL.URLWithString(UIApplicationOpenSettingsURLString)
        ?.let { sharedApplication.openURL(it, emptyMap<Any?, String>()) { _ -> } }
and it seems to work properly
t
@Mateus Bauer simulator. Is that expected behavior on a simulator ?
@Marek Niedbach ok then it should be working. I don't have a recent device on iOS 18+.
m
@Thierry Kh yes, it also happens with me in simulator. I think it's because simulator actually doesn't have that screen. (At least mine don't). Sorry for the delay to answer.
🙏 1
t
@Mateus Bauer no worries. thanks for the input. on my simulators, i have the detailed app settings but the link will only open the list of apps. still haven't tried on a real recent devices but it's no big deal, i'll do with it.
❤️ 1