Closed redwolf2 closed 5 years ago
Merged
Can you please release a new binary. Version 1.1.2 is the latest version, that does not have the fix ATM.
Sorry, it completely slipped my mind. 1.1.3 has now been posted to npm: https://www.npmjs.com/package/com-darryncampbell-cordova-plugin-intent
I get the same error with capacitor and I have 1.1.7 version. In startActivity instead of registerBroadcastReceiver.
2019-07-14 22:51:19.696 7882-7952/io.ionic.starter D/Cordova Intents Shim: Action: startActivity
2019-07-14 22:51:19.698 7882-7952/io.ionic.starter E/PluginManager: Uncaught exception from plugin
java.lang.ClassCastException: io.ionic.starter.MainActivity cannot be cast to org.apache.cordova.CordovaActivity
at com.darryncampbell.cordova.plugin.intent.IntentShim.startActivity(IntentShim.java:420)
at com.darryncampbell.cordova.plugin.intent.IntentShim.execute(IntentShim.java:83)
at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
at com.getcapacitor.MessageHandler.callCordovaPluginMethod(MessageHandler.java:73)
at com.getcapacitor.MessageHandler.postMessage(MessageHandler.java:46)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:323)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
I created a pull request: #77
This fixes the error for me using Capacitor, but I cannot test it using Cordova.
Thank you :)
It works if I replace all
((CordovaActivity)this.cordova.getActivity())
withthis.cordova.getActivity()
Created a pull request here: https://github.com/darryncampbell/darryncampbell-cordova-plugin-intent/pull/65
If you want to test it yourself, with an already existing project, start here: https://capacitor.ionicframework.com/docs/getting-started/with-ionic