darryncampbell-cordova-plugin-intent icon indicating copy to clipboard operation
darryncampbell-cordova-plugin-intent copied to clipboard

Feature/androidx ionic

Open cabaird opened this issue 5 years ago • 3 comments

I added code to my last hook in https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent/pull/85 to support Ionic v4, as their webview has an import to an old support library that breaks when androidx is enabled. This may not be something you want to take responsibility for in your plugin, and may rather leave this for the consumers of your plugin to handle considering you're not specifically an Ionic plugin.

I might suggest alternatively setting androidx support up as optional, and controlled by a variable at plugin install to allow for more users to be able to use it. This may be a safer option until Cordova and Ionic are fully switched over to androidx.

cabaird avatar Nov 22 '19 23:11 cabaird

Thank you @cabaird , rather than add a choice I would rather just have people who want Android X support use version 2.0.0 of this plugin. My question is that the code you added to this pull request compared to https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent/pull/85 seems to have implications beyond Ionic, will this have any negative knock-on effects to people developing with Cordova or Ionic apps that don't use the Webview? Sorry if that is a silly question but it has been a while since I did any real development with Cordova or Ionic.

darryncampbell avatar Nov 23 '19 22:11 darryncampbell

In theory, I think this replace, and many others could be added to generically handle some lingering support imports based on the class mappings here. I feel a little dirty adding code to this plugin that directly alters the source files from other plugins, though, and feel like it may lead you down a rabbit hole. Maybe as long as your README is clear, you can let the consumers of this plugin make sure they're in full support of androidx with other tools as they need, and use 1.3 if not. I for example, added this replace in a hook, knowing that I need it.

cabaird avatar Nov 25 '19 15:11 cabaird

Thank you for the quick response & contributions. I feel the same as you, it doesn't feel right to alter other plugins' source code from this plugin so I'll just leave this pull request open so others can benefit from the code if they need it for androidx compatibility

darryncampbell avatar Nov 25 '19 17:11 darryncampbell