Making Sending a URL to my ionic app with web intent to work without crashing

Good evening, I’ve been struggling with getting web intents to work without the app crashing, I thought it would be straight forward but its not seeming to work.

I first attempted to use the plugin:

ionic plugin add https://github.com/Initsogar/cordova-webintent

and then removed the plugin and i also tried a more recently updated fork:

ionic plugin add https://github.com/fluentstream/cordova-webintent

In my app.js file I putting the following code:

.run(function($ionicPlatform, $rootScope, $ionicHistory, $state) { 
  $ionicPlatform.ready(function() {
    window.plugins.webintent.getExtra(window.plugins.webintent.EXTRA_TEXT,
    function(url) {
      incomingURL = url;
      //alert(incomingURL);
      console.log(incomingURL);
    }, function() {
      incomingURL = false;
      //alert("no url");
      console.log("no url");
    });
  });
})

I also tried:

.run(function($ionicPlatform, $rootScope, $ionicHistory, $state) { 
  $ionicPlatform.ready(function() {
    window.plugins.webintent.getUri(function(url) {
      if(url !== "") {
          alert(url);//url is the url the intent was launched with
      }
    }); 
  });
})

In the file config.xml I would put:

<plugin name="WebIntent" value="com.borismus.webintent.WebIntent"/>

In the AndroidManifest.xml I would manually put in:

<activity android:name="ShareActivity">
    <intent-filter>
        <action android:name="android.intent.action.SEND" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="text/plain" />
    </intent-filter>
</activity>

The app runs, but when I go to chrome and click the share button, and then choose my app, the app shuts down the following android message appears:

Unfortunately, MyAppName has stopped.

Can anybody suggest a plugin that can work with the ionic 1.1.0 and work…or am i forgetting something and doing something wrong.

Thank you!

Fixed. It was an issue I was having with the android manifest. I was creating a separate activity for my intent…so don’t do that.

I wrote the full answer on stack overflow.

Would love to have some tutorials about modifying the android manifest and the ins and outs with ionic.

Thanks!

window.plugins.webintent.getExtra(window.plugins.webintent.EXTRA_STREAM,
    function(url) {
        // url is the value of EXTRA_STREAM
    }, function() {
        // There was no extra supplied.
    }
);

I am using the above code in Ionic 4,In gallery,I am trying to share any image to my ionic app it is receiving null in success function.can any one please respond,is it correct or not