cordova-plugin-document-viewer
cordova-plugin-document-viewer copied to clipboard
Optimize Plugin for iPhone X
Currently the document viewer has extra padding in the statusbar location of the iPhone X. This is not a breaking issue, but it may interfere with UI/UX
I have attached a screenshot. Note the top statusbar area:
Reproduction Steps:
Cordova Version: 7.0.1 Plugin Version: 0.9.7
- Install plugin
- Deploy to iPhone X
- Open a local file with mime type 'application/pdf'
- View statusbar
I am also facing the same issue with mime type 'application/pdf' in iPhone X
any updates on this issue?
We are currently not planing to add support for phones. The plugin mainly targets tablets.
Unfortunately it's one that does seem to work nicely.
Is this more an issue relating to the VFR Reader (which appears to be deprecated)?
Would you be considering moving from VFR to the UXReader PDF Framework for iOS? (https://github.com/vfr/UXReader-iOS)
@regnete You should fix this issue as it violates Apple's safe area constraints. When the new iPads are released, this UI issue will be present on those.
Any news? Would be highly appreciated!
Unfortunately it's one that does seem to work nicely.
Is this more an issue relating to the VFR Reader (which appears to be deprecated)?
Would you be considering moving from VFR to the UXReader PDF Framework for iOS? (https://github.com/vfr/UXReader-iOS)
I think that would be the right choice, would be very sad if apple declines the app to the app store because it violates Apple's safe area constraints
@CodingAnonymous
I can submit a PR and try and fix it when I have some extra time. Would only take a bit. My app got through the App Store review with this plugin. I didn’t fix the safe area as I didn’t have time (my project was time-sensitive).
@JRR-OSU
That would be awesome! Thank you very much in advance!
@JRR-OSU
If you have a version to test, I would like to help!
@CodingAnonymous Just fixed it for you :) Check out PR #132. That should do the trick. Note to fix without having to reinstall the plugin, just copy that raw file and paste in your iOS project -> Plugins -> cordova-plugin-document-viewer -> SDVReaderViewController.m
Thanks @JRR-OSU , I can't open any document now, is this happening to you, too?
@CodingAnonymous I'm still able to open documents.
@JRR-OSU I get following error:
Error in SitewaertsDocumentViewer.viewDocument():
"invalid file url 'function () {↵ if (this.nativeURL) {↵ return this.nativeURL;↵ }↵ /…"
I didn't change anything, it worked with the code perfectly before your fix :) it detects, that the file is already saved an the device now, too.
iOS 12.2, iPhone X
Following issue now occurs on android: "org.json.JSONException: No value for url↵ at org.json.JSONObject.get(JSONObject.java:389)↵ at org.js…"
@CodingAnonymous Can you reproduce in a small project and upload it as a zip or post on here?
If you actually look at my PR, literally none of the file reading code is touched. I only adjust view code. It works fine for me. I think what happened is you updated this plugin to a version which is not compatible with your file plugin.
Here's my sample package.json. Working fine for me.
{ "name": "MyApp", "version": "0.0.1", "description": "An Ionic project", "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/ionic-team/ionic-conference-app.git" }, "scripts": { "build": "ionic-app-scripts build", "clean": "ionic-app-scripts clean", "lint": "ionic-app-scripts lint", "ionic:build": "npm run build", "ionic:serve": "npm run serve", "ionic:lint": "npm run lint" }, "dependencies": { "@angular/common": "4.4.4", "@angular/compiler": "4.4.4", "@angular/compiler-cli": "4.4.4", "@angular/core": "4.4.4", "@angular/forms": "4.4.4", "@angular/http": "4.4.4", "@angular/platform-browser": "4.4.4", "@angular/platform-browser-dynamic": "4.4.4", "@ionic-native/browser-tab": "^4.9.0", "@ionic-native/calendar": "^4.9.0", "@ionic-native/call-number": "^4.7.0", "@ionic-native/core": "^4.3.1", "@ionic-native/document-viewer": "^4.9.0", "@ionic-native/email-composer": "^4.9.0", "@ionic-native/fcm": "^4.9.1", "@ionic-native/file": "^4.9.0", "@ionic-native/file-opener": "^4.9.0", "@ionic-native/in-app-browser": "^4.3.1", "@ionic-native/local-notifications": "^4.9.1", "@ionic-native/network": "^4.9.0", "@ionic-native/splash-screen": "^4.5.2", "@ionic-native/status-bar": "^4.9.0", "@ionic/storage": "^2.0.1", "call-number": "^1.0.1", "cordova-ios": "~4.5.4", "cordova-plugin-badge": "^0.8.7", "cordova-plugin-browsertab": "^0.2.0", "cordova-plugin-calendar": "^5.1.2", "cordova-plugin-compat": "^1.2.0", "cordova-plugin-crosswalk-webview": "^2.4.0", "cordova-plugin-device": "^1.1.7", "cordova-plugin-document-viewer": "^0.9.10", "cordova-plugin-email-composer": "^0.8.15", "cordova-plugin-fcm": "^2.1.2", "cordova-plugin-file": "^6.0.1", "cordova-plugin-file-opener2": "^2.0.19", "cordova-plugin-inappbrowser": "^1.7.2", "cordova-plugin-ionic-webview": "^1.2.1", "cordova-plugin-ionic-wkkeyboard": "^1.1.15", "cordova-plugin-local-notification": "^0.9.0-beta.2", "cordova-plugin-network-information": "^2.0.1", "cordova-plugin-splashscreen": "^4.1.0", "cordova-plugin-statusbar": "^2.4.2", "cordova-plugin-whitelist": "^1.3.3", "cordova-windows": "^5.0.0", "firebase": "^4.9.0", "ionic-angular": "nightly", "ionicons": "3.0.0", "mx.ferreyra.callnumber": "0.0.2", "rxjs": "5.4.3", "sw-toolbox": "3.6.0", "web": "0.0.2", "zone.js": "0.8.18" }, "devDependencies": { "@ionic/app-scripts": "nightly", "typescript": "^2.9.2" }, "config": { "ionic_aot_write_to_disk": true }, "cordova": { "platforms": [ "windows", "ios" ], "plugins": { "cordova-plugin-crosswalk-webview": { "XWALK_VERSION": "22+", "XWALK_LITEVERSION": "xwalk_core_library_canary:17+", "XWALK_COMMANDLINE": "--disable-pull-to-refresh-effect", "XWALK_MODE": "embedded", "XWALK_MULTIPLEAPK": "true" }, "cordova-plugin-device": {}, "cordova-plugin-inappbrowser": {}, "cordova-plugin-splashscreen": {}, "cordova-plugin-whitelist": {}, "cordova-plugin-ionic-webview": {}, "cordova-plugin-ionic-wkkeyboard": {}, "cordova-plugin-statusbar": {}, "cordova-plugin-fcm": {}, "mx.ferreyra.callnumber": {}, "cordova-plugin-document-viewer": {}, "cordova-plugin-email-composer": {}, "cordova-plugin-calendar": { "CALENDAR_USAGE_DESCRIPTION": " " }, "cordova-plugin-network-information": {}, "call-number": {}, "cordova-plugin-file-opener2": {}, "cordova-plugin-file": {}, "cordova-plugin-browsertab": {}, "cordova-plugin-local-notification": {} } } }
@JRR-OSU Works amazing, thank you very much!