Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Joannes_P_
Beginner
98 Views

"Open With" menu to attached file in email client

I'm trying to open a .txt file it could pop up a menu as "Open with..." and my app should be in the list inside of Gmail or some email client app.

I had success with file manager but not other explorers such as download folder, etc.

There is a screenshot, my app called TESTP it worked fine.




In email client, it won't show my app in the menu:



Here is my part of build.xml



 

        <intent-filter>
        <action android:name="android.intent.action.VIEW"></action>
        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="android.intent.category.DEFAULT"></category>
        <category android:name="android.intent.category.BROWSABLE"></category>
        <data android:scheme="content"/>
        <data android:host="*" />
        <data android:mimeType="application/octet-stream"/>
        <!-- <data android:mimeType="application/vnd.google-earth.kml+xml" /> -->
        <data android:pathPattern=".*\\.txt" />
        </intent-filter>



Also I'm looking a snippet for iOS devices and the solution.



Thanks.


 

Tags (2)
0 Kudos
1 Reply
Anthony_H_Intel
Employee
98 Views

Hi Joannes-

I think you are almost there, but some of the details in your intent filter are not right.
Specifically, I think you need scheme to be "file" instead of "content", but you might need to change some other details...
Take a look at this tutorial for Android:
How to list your cordova app in "open with" menu in Android and handle the intent event
If you want more background information, also take a look at the official documentation:
Allowing Other Apps to Start Your Activity

For iOS, I wasn't able to find a tutorial, but the README for the Intent plugin referred to in the Android tutorial has iOS instructions.
You can use the custom-config plugin referred to in the previous tutorial to add the section you need to your info.plist.

Hope this helps!
Tony

 

Reply