How to “share to” a mobile Meteor app


#1

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?


#2

You’ll need a plugin to handle intents.


#3

yes but there’s no one that working.


#4

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


#5

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.


#6

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);