3

I am trying to send to my phonegap application an image from the image gallery, using the 'share' feature.

  1. To display my app in the 'share' list, I have followed this post
  2. I have added the following in my AndroidManifest.xml

        <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="image/*" />
        </intent-filter>
    
  3. My app is now properly listed in the 'share' list

  4. I click on my app

  5. I am using cordova-webintent plugin to intercept the intent and get EXTRA( my image )

  6. I am using this code below to get my image

    window.plugins.webintent.getExtra(window.plugins.webintent.EXTRA_STREAM, 
         function(data) {
             console.log(data)
            }, function(e) {
                console.log(e)
                // There was no extra supplied.
            }
    );  
    
  7. The success callback is called, but 'data' contains 'true'

I was expecting to have either an url, or a base64 string of my image

FYI, i have also tried window.plugins.webintent.EXTRA_TEXT but i guess this is only for sharing link, text.

Any help would be greatly appreciated

Community
  • 1
  • 1
Florent Valdelievre
  • 1,546
  • 3
  • 20
  • 32

1 Answers1

0

We are also looking for same solution for Android and IOS. I tried to understand the Java code. I think it will work only for Maps, because the the code written regarding maps. Please let us know if there are any solutions.

thank you, Narendra

NKurapati
  • 590
  • 1
  • 6
  • 20
  • 1
    Hi Narendra, I have adjusted the code to make it work. Please check the forked repository: https://github.com/florentvaldelievre/virtualartifacts-webintent The plugin is for Android – Florent Valdelievre Nov 06 '14 at 21:06