miroslavvojtus commented on issue #1159: URL: https://github.com/apache/cordova-ios/issues/1159#issuecomment-940361897
Well, it is more convenience than necessity. I write a plugin which has some parts implemented on broswer, electron, windows, ios. Some behavior does not make sense to implement native but makes native related decisions, thus having js proxy would be convenient. Browser JS consumes exposed cordova API. Platform specific code regardless if native or not implements it. In windows I am able to do that 😒 Either write and use WinJS solely or write runtimeComponent. Iknow it is different from platfom to platform but now I either write common js module bridge to be able to pick a proxy first, or i write platform coditions dierectly in common js module what is discouraged. But if you consider it as nonlegitimate I understand if you close this. Nevertheless I do not get why there is such an option on windows (and more or less on electron). Dňa po 11. 10. 2021, 16:02 Norman Breau ***@***.***> napÃsal(a): > I'm failing to understand what you're really trying to do. It sounds like > there might be a misunderstanding of the Cordova's architecture here. > > I have some logic which is iOS specific but I do not want to write it in > native source code. > > The exec function is for communicating with native, if you don't need to > call onto native, then don't use the function. > > If you need platform-specific behaviour, you can use the pre-existing > cordova.platform, or you can use the `cordova-plugin-device > <https://cordova.apache.org/docs/en/10.x/reference/cordova-plugin-device/> > package for better insight of the environment, (e.g. os version) the code > is currently in to determine when to enter platform-specific logic. > > The exec method is mainly used by cordova plugins to call onto native > side. > > Can you explain why this is necessary? > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/apache/cordova-ios/issues/1159#issuecomment-940060140>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AABS3MV4J7C3TMT4SWF35RTUGLU7FANCNFSM5FXZMB4Q> > . > Triage notifications on the go with GitHub Mobile for iOS > <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> > or Android > <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>. > > -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
