RaphaelWoude / capacitor-native-settings

Capacitor plugin to open native settings screens for android and iOS
MIT License
95 stars 30 forks source link

Only one Open Method #7

Closed EinfachHans closed 2 years ago

EinfachHans commented 3 years ago

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?

RaphaelWoude commented 3 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.

RaphaelWoude commented 3 years ago

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.

image

This is the current solution. With this, you can map whichever options you wanna open on each platform. Would this satisfy your need? @EinfachHans

EinfachHans commented 3 years ago

Would work but not the best solution, so users have to always add both options 🤔

alexcroox commented 3 years ago

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 👍

alexcroox commented 3 years ago

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).

EinfachHans commented 3 years ago

Yes, personally i think thats a better solution

alexcroox commented 3 years ago

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.

RaphaelWoude commented 3 years ago

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.

RaphaelWoude commented 3 years ago

Draft has been up for a bit now. Android is done. Waiting on @dennisameling for iOS.

reslear commented 2 years ago

@dennisameling wait you for iOS :)

dennisameling commented 2 years ago

Just added the iOS code: https://github.com/RaphaelWoude/capacitor-native-settings/pull/19

Sorry for the delay!

RaphaelWoude commented 2 years ago

Merged. New version coming out this week.