Receiving a send intent in Ionic via Capacitor

Active3 hr before
Viewed126 times

6 Answers


Will the objection have any effect? ,I have an Ionic React project. This comes with Capacitor as bridge. I now want to receive "SEND" intents from other Apps to my Ionic app but I don't find anything suitable in Capacitor. The only solution I can think of is creating a custom plugin in Capacitor that will be triggered when I receive the intent in native code. Can anyone suggest a more direct solution?,Theoretical Computer Science

 Pretag team - issue, fix, solve, resolve

Accessing Called Data,Each plugin method receives an instance of com.getcapacitor.PluginCall containing all the information of the plugin method invocation from the client.,After generating a plugin, right click the Java plugin class in Android Studio and select the “Convert Java file to Kotlin file” option from the menu. Android Studio will walk you through configuring the project for Kotlin support. Once this is completed, right click the Java class again and re-select the conversion option to convert it to a Kotlin class.

 Pretag team - issue, fix, solve, resolve

This Plugin provides a general purpose shim layer for the Android intent mechanism, exposing various ways to handle sending and receiving intents.,If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.,For usage information please refer to the plugin's Github repo.

import {
} from '@ionic-native/web-intent/ngx';

constructor(private webIntent: WebIntent) {}


   const options = {
      action: this.webIntent.ACTION_VIEW,
      url: 'path/to/file',
      type: 'application/'

this.webIntent.startActivity(options).then(onSuccess, onError);

Next, install the plugin:,Interface: IonicAuthOptions,If you have not already setup Ionic Enterprise in your app, follow the one-time setup steps.

npm install @ionic - enterprise / auth
Using React ? Also install : npm install @ionic - enterprise / auth - react
npx cap sync
load more v

I get the same error with capacitor and I have 1.1.7 version. In startActivity instead of registerBroadcastReceiver.,If you want to test it yourself, with an already existing project, start here:, Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

D / Cordova Intents Shim: Action: registerBroadcastReceiver
E / PluginManager: Uncaught exception from plugin
java.lang.ClassCastException: de.test.example.MainActivity cannot be cast to org.apache.cordova.CordovaActivity
at com.darryncampbell.cordova.plugin.intent.IntentShim.execute( 118)
at org.apache.cordova.CordovaPlugin.execute( 98)
at org.apache.cordova.PluginManager.exec( 132)
at com.getcapacitor.MessageHandler.callCordovaPluginMethod( 73)
at com.getcapacitor.MessageHandler.postMessage( 46)
at android.os.MessageQueue.nativePollOnce(Native Method)
at 323)
at android.os.Looper.loop( 136)
at 61)
load more v

To send push notifications to your users with Ionic and Capacitor you don’t need a specific service, but you need to configure a bunch of things upfront to make it work. ,If you did everything correctly before you should now see a push notification on your device!, How to Cache API Responses with Ionic & Capacitor

 Pretag team - issue, fix, solve, resolve

Other "receiving-undefined" queries related to "Receiving a send intent in Ionic via Capacitor"