polarcape / polarcape-cordova-plugin-document-handler Goto Github PK
View Code? Open in Web Editor NEWThis project forked from ti8m/documenthandler
Polar Cape Cordova Plugin Document Handler
License: MIT License
This project forked from ti8m/documenthandler
Polar Cape Cordova Plugin Document Handler
License: MIT License
Hi i am unable to add plugin getting warning as in attached document file.
+-- UNMET PEER DEPENDENCY cordova-plugin-file@^3.0.0
`-- [email protected]
npm WARN [email protected] requires a peer of cordova-plugin-file@^3.0.0 but none was installed.
Kindly do the needful to help me
Thanks
Hello,
we use your plugin to handle links in our web app in our web app to download/open pdf documents.
This has worked fine for as long as we were on Android SDK target version 23. However, starting on the first of this month, Google imposed that all apps have to target Android SDK version 26. This is what we did, but unfortunately since then we get the following exception, when a user tries to open that link
android.os.FileUriExposedException: file:///data/user/0/$app-identifier/cache/$fileName.pdf exposed beyond app through Intent.getData()
According to this article, since Android 24 exposing file Uris via Intents is not supported. The article suggests a fix using the FileProvider API. Do you think it would be possible to change the way your library builds the Intent to use the FileProvider API?
Thanks!
I'm seeing the issue of when multiple open requests are fired, it only opens the first one.
e.g.
_.forEach(requests, function(request){
DocumentHandler.saveAndPreviewBase64File(...)//different filenames are passed in
})
Any help is appreciated!
Hello,
When installing this plugin, cordova fails with the following error:
Failed to install 'polarcape-cordova-plugin-document-handler': CordovaError: Uh oh! "[...] /platforms/android/res/xml/provider_paths.xml" already exists!
I found that both this plugin and cordova-plugin-camera
use this file.
Could you please prefix the file, if possible, to avoid collisions of this kind?
best regards
I want to open PDF document in Android Device.
I am using polarcape cordova pugin. My App am receiving Base64 string from the Server API, and I want to open the PDF intent using saveAndPreviewBase64File method of the plugin to achieve this.
I have set the target as Android-23, as suggested earlier, by the plugin development team.
It works for Android, 5.0 onwards.
But it is not working for device having Kitkat (Android 4.4.2)
Can someone help me in working for 4.4.2 Kitkat?
Hi,
Sorry, this is not actually pulg-ins issue, may be what I require is a way to use the plug-in as
<gap:plugin name="polarcape.cordova.plugin.document.handlerOR_THE_ACTUAL_NAME" version="SOMEVERSION" />
I followed the steps mentioned and created a test view with sample PDF files on device (SD Card)
I have the <gap:plugin name="org.apache.cordova.file" version="1.3.1" /> included in application's config.xml with couple of other plug-ins which depend on cordova.js.
Those things work as intended but the Document handler, what I see is a white blank view nothing happens. Tried with DxButton to load it in another view but same thing. What am I doing wrong?
May I request you to provide the gap build/version number or a way to use it in my Hybrid mobile app.
(FYI I am trying to use it with DevExtreme 15.2 - MVVM- KnockOut Approch)
Thank you guys.
1.0.14 changes the window object name from DocumentHandler to DocumentViewer.
readme #28
code that changed #26
But it is only versioned as a patch upgrade from 1.0.13 semver, meaning everyone that did a default install of this plugin, when reinstalling, got the 1.0.14 update, with the breaking changes.
I dont know if the change was intentional, as the plugin.xml still references DocumentHandler
<js-module src="www/DocumentHandler.js" name="DocumentHandler"> <clobbers target="DocumentHandler" /> </js-module>
This actually fooled me as window.DocumentHandler still exists, when trying to debug this.
My recommendation would be to remove 1.0.14.
Then if the codechanges really are needed, create a 1.0.15 which uses window.DocumentHandler or republish 1.0.14 as 2.0.0, so the plugin follows semver.
I'm trying to open a PDF and getting "JSON error" passed back to the error function. Not sure why this would happen. I checked the response headers and the content type is application/pdf.
I/chromium(29878): [INFO:CONSOLE(1685)] "Failed to open http://www.theoomf.com/docs/oomf_privacy_policy.pdf with error JSON error", source: file:///android_asset/www/js/oomf-app.98d867481b6592d8.js (1685)
if the file at remote url
how show loading.. message until file downloaded
angularJS v1.*
Ionic v1
built on iOS
The following code will successfully hit the alert but not set the $scope.loading variable to null.
Seems as if $scope is not accessible while viewing the Document Handler. Any ideas around this would be appreciated!
app.controller('CatalogController', function($scope, $firebaseArray, $firebaseObject, CatalogService, $localStorage, $window) {
$scope.$on('$ionicView.beforeEnter', function () {
$scope.loading = true;
$scope.screen = $window.innerWidth;
var issues = CatalogService.getIssues();
issues.$loaded().then(function(){
$scope.issues = issues;
$scope.loading = null;
});
});
$scope.viewIssue = function(issue) {
$scope.loading = true;
DocumentHandler.previewFileFromUrlOrPath(function() {
//success
alert('success');
$scope.loading = null;
}, function (error) {
//error
$scope.loading = null;
if (error) {
alert('There was a problem loading this issue. Please try again shortly or contact support at *[email protected].');
}
},
issue.content, issue.name + '-' + issue.serial);
};
});
package json define cordova-pungin-file as : "cordova-plugin-file": "^4.0.0". Can that but updated to 6.0.1. This will help the plugin mingle well with other updated plugins that depend on current releases of cordova-plugin-file
I've tested locally by changed the dependency, and it works with the examples in the README
I tried in most of the devices, they are working fine, but does not work with Android 7.0.
App simply stops and user get thrown out of App.
Does it tested with OS 7.0
In my project Android manifest I have set the target as 25
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="25" />
Can some one help me out in this?
The plugin is working amazing as long as the filename of the document doesnt have spaces.
1DOC.doc - good
2DOCX.docx - good
word test.docx - nothing happens at all
In DocumentHandler.m :
HandleDocumentWithURL(){
NSString* urlStr = dict[@"url"];
}
Please add the highlighted line
Is there anyway to set the title of the view controller?
In Example 1:
'http://www.axmag.com/download/pdfurl-guide.pdf', 'pdf-sample');
... suggests that 'pdf-sample' would be the view controllers title?
I tried using the method DocumentHandler.saveAndPreviewBase64File(), it does not work.
it gives error "ReferenceError: Promise is not defined"
Can some one look into it!
I want to open PDF document in Android Device.
I am using polarcape cordova pugin. My App am receiving Base64 string from the Server API, and I want to open the PDF intent using saveAndPreviewBase64File method of the plugin to achieve this.
I have set the target as Android-23, as suggested earlier, by the plugin development team.
But it is not working.
i have taken the same example which has been published in the github portal, only put alert statements for debugging purpose.
Can someone help me in running this...
PFB code
` function PDFBase64()
{
alert("PDFBase64() is called...");
try
{
window.DocumentHandler.saveAndPreviewBase64File(
function (success) {
alert("Inside Success");
alert(JSON.stringify(success));
},
function (error) {
alert("Inside error");
alert(JSON.stringify(error));
if (error == 53) {
console.log('No app that handles this file type.');
}
},
'JVBERi0xLjMKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZwovT3V0bGluZXMgMiAwIFIKL1BhZ2VzIDMgMCBSID4+CmVuZG9iagoyIDAgb2JqCjw8IC9UeXBl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KMDAwMDAwMDYxNiAwMDAwMCBuIAp0cmFpbGVyCjw8Ci9TaXplIDkKL1Jvb3QgMSAwIFIKL0luZm8gNSAwIFIKPj4Kc3RhcnR4cmVmCjcyNQolJUVPRgo='
,
'application/pdf',
cordova.file.externalApplicationStorageDirectory,
'test.pdf'
);
}
catch(e)
{
alert("Inside catch");
alert(JSON.stringify(e));
}
}`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.