Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/farynam/cordova-fileassociation
File association plugin for cordova. Main purpose is to make possible to assciate cordova app with file types well known or custom made.
https://github.com/farynam/cordova-fileassociation
Last synced: 6 days ago
JSON representation
File association plugin for cordova. Main purpose is to make possible to assciate cordova app with file types well known or custom made.
- Host: GitHub
- URL: https://github.com/farynam/cordova-fileassociation
- Owner: farynam
- License: apache-2.0
- Created: 2016-03-16T20:41:29.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-04-05T19:23:26.000Z (over 8 years ago)
- Last Synced: 2024-08-09T22:36:12.953Z (3 months ago)
- Language: Java
- Size: 9.77 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cordova-fileAssociation
File association plugin for cordova. Main purpose is to make possible to associate cordova app with file types well known or custom made. Currently it is for Android only.How to use it
1.Clone from git git clone
2.Configure your AndroidManifest.xml activity for example for json file:....
......
.....
3.Add plugin to project by:
cordova plugin add /FileAssociation
4.Register listeners in your cordova app to be sure that plugin is available to use:
var fileAssociation = function () {
if (!window.plugins) {
console.log("plugins not defined");
return;
}window.plugins.fileAssociation.getAssociatedData(null,
function (success) {
try {
if (success != null) {
//handle your data here maybe ex. by promise
activityPromise.resolve(decoded);
}
} catch (e) {
activityPromise.reject(e);
}
}, function (error) {
activityPromise.reject(error);
});
};
//added to be sure that plgin is available
document.addEventListener("resume", function () {
fileAssociation();
}, false);document.addEventListener("deviceready", function () {
fileAssociation();
}, false);
5.Use well