Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open pdf on android - ionic using react. Getting the below error #30

Closed
melvinotieno opened this issue Jul 4, 2021 · 1 comment

Comments

@melvinotieno
Copy link

melvinotieno commented Jul 4, 2021

Error: The old format of this exec call has been removed (deprecated since 2.1). Change to: cordova.exec(null, null, 'Service', 'action', [ arg1, arg2 ]);
at capacitorExec (capacitor-runtime.js:1975)
at execProxy (capacitor-runtime.js:2111)
at PreviewAnyFile.previewPath (capacitor-runtime.js:2760)
at callCordovaPlugin (common.ts:277)
at common.ts:53
at common.ts:14
at new Promise ()
at tryNativePromise (common.ts:13)
at getPromise (common.ts:37)
at wrapPromise (common.ts:42)
at common.ts:374
at cordova (cordova.ts:5)
at PreviewAnyFileOriginal.previewPath (index.ts:86)
at openPDF (index.tsx:27)
at onClick (index.tsx:51)
at HTMLUnknownElement.callCallback (react-dom.development.js:3945)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3994)
at invokeGuardedCallback (react-dom.development.js:4056)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4070)
at executeDispatch (react-dom.development.js:8243)
at processDispatchQueueItemsInOrder (react-dom.development.js:8275)
at processDispatchQueue (react-dom.development.js:8288)
at dispatchEventsForPlugins (react-dom.development.js:8299)
at react-dom.development.js:8508
at batchedEventUpdates$1 (react-dom.development.js:22396)
at batchedEventUpdates (react-dom.development.js:3745)
at dispatchEventForPluginEventSystem (react-dom.development.js:8507)
at attemptToDispatchEvent (react-dom.development.js:6005)
at dispatchEvent (react-dom.development.js:5924)
at unstable_runWithPriority (scheduler.development.js:468)
at runWithPriority$1 (react-dom.development.js:11276)
at discreteUpdates$1 (react-dom.development.js:22413)
at discreteUpdates (react-dom.development.js:3756)
at dispatchDiscreteEvent (react-dom.development.js:5889)

@mostafa-mansour1
Copy link
Owner

you have to use the plugin directly without the use of ionic native, until the merge my pull request there

window.PreviewAnyFile.previewBase64(
        win => console.log("open status",win),
        error => console.error("open failed", error),
        'JVBERi0xLjMKJcTl8uXr.....',{mimeType:'application/pdf'}
    );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants