Closed EinfachHans closed 2 years ago
I created the plugin like this because the naming of certain calls is not the same on every platform. For in the future I will create a generic method that will support this functionality.
It's been a while. Finally have a lot of time again to work on projects.
To revisit this issue, I came up with another solution that will make it easy to open IOS & android settings without having the check the platform.
This is the current solution. With this, you can map whichever options you wanna open on each platform. Would this satisfy your need? @EinfachHans
Would work but not the best solution, so users have to always add both options 🤔
It makes sense to me because both iOS and Android settings options are different so you can't unify them. This solution would mean I could skip the platform check (which was the OP's original issue) so I'm all for it 👍
The only way around it would be to map all the different options into a single unified list of options that the plugin. But I've not looked closely enough to know how much overlap there is and where the gaps are and how we'd handle them (perhaps by defaulting the gaps to the generic settings option).
Yes, personally i think thats a better solution
I do think having the seperate options does force the developer to consider their options though, rather than silently defaulting to the wrong place where Android offers a destination that iOS doesn't.
That, and as others have said, most of the options recently introduced for iOS in this plugin are using private APIs which Apple will probably reject, which leads to further confusion.
Remember the cordova plugin was made in older versions of iOS with APIs that are now no longer usable. Notice how the cordova plugin readme specifies iOS 10 and below only and has several issues talking about Apple rejecting their app in higher versions.
I will have to agree with @alexcroox here. Pretty much everything you said is exactly what I was gonna say. Gonna start working on this. Will have a draft out soon.
Draft has been up for a bit now. Android is done. Waiting on @dennisameling for iOS.
@dennisameling wait you for iOS :)
Just added the iOS code: https://github.com/RaphaelWoude/capacitor-native-settings/pull/19
Sorry for the delay!
Merged. New version coming out this week.
Is there a reason you seperate the Methode in a openIos and openAndroid? I don't like that as i always have to add a platform detection before Plugin Call.
Why did you decide to do it like this and not like jn the Cordova one?