How to “share to” a mobile Meteor app

I’d like to register my Meteor app to allow the user to share photos to my app. That is, the app should appear in the list of apps to which he can share his pic, along with Slack, Facebook, and whatever else is installed.

I’m hoping this is a simple mobile-config.js line. If not, then do I need some Cordova plugin, maybe?

You’ll need a plugin to handle intents.

yes but there’s no one that working.

1 Like

I am using https://github.com/markmarijnissen/cordova-plugin-share with success.

Yes, so are we. This does not answer the question.

As stated:
We need to register the app to allow the user to share photos to my app. That is, the app should appear in the list of apps to which he can share his pic, along with Slack, Facebook, and whatever else is installed.

Mh, I can only show you how we handle it by sharing “Text/Links” to our own app. We are using

com.napolitano.cordova.plugin.intent

In AndroidManifest.xml:

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

And handling the “shared” link in startup.js:

   const handleIntent = function (intent) {
            convertStore.url.set(intent.clipItems[0].text);
    };

    // If users shares a link via another app
    window.plugins.intent.setNewIntentHandler(handleIntent);
    window.plugins.intent.getCordovaIntent(handleIntent);
2 Likes