tabris-js
tabris-js copied to clipboard
Is there anyway to make tabris app open file with specific extension?
I googled any cordova plugins but all of then are outdated, Is there anyway tabris.js could register a file extension and when user chose the file in the file manager app so they could open it within the tabris app?. Thanks
I have not used it, but there's https://github.com/farynam/cordova-fileAssociation
Other research suggests you can edit your AndroidManifest.xml as this is not Cordova-specific: https://stackoverflow.com/a/61331776
@cookieguru Hi :smile: I used the following code:
<config-file parent="application" target="AndroidManifest.xml">
<activity android:label="Show in app" android:name="app_name">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE"/>
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:scheme="content" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:scheme="ftp" />
<data android:host="*" />
<data android:pathPattern=".*\\.my_extension " />
<data android:mimeType="*/*" />
</intent-filter>
</activity>
</config-file>
How to handle the intent when user tap the file from file explorer. So I can handle the file within my app? Thank you.
@mpost?
I would also look into plugins like the mentioned https://github.com/farynam/cordova-fileAssociation. It has a snippet on how to handle the described configuration.