Closed jonathands closed 1 year ago
Run npx cap doctor:
npx cap doctor
Latest Dependencies:
@capacitor/cli: 4.7.1 @capacitor/core: 4.7.1 @capacitor/android: 4.7.1 @capacitor/ios: 4.7.1
Installed Dependencies:
@capacitor/cli: 4.7.0 @capacitor/core: 4.7.0 @capacitor/android: 4.7.0 @capacitor/ios: 4.7.0
Share dialog won't show Instagram , but shows WhatsApp , when I try to share the same image from withing email or WhatsApp instagram appears normally
Instagram should be displayed on the share dialog
Everything is default
call the share dialog in a phone with instagram installed
const handleShare = (m) => { async function share() { if (!url.match(/^[a-zA-Z]+:\/\//)) { url = "http://" + url; } let nurl = url.replace(/^(https?:\/\/)?(www\.)?/i, "$1www.") ; await fetch(nurl) .then(res => { return res.blob() }) .then(blob => { return blob.arrayBuffer(); }) .then(ab => { const uint8Array = new Uint8Array(ab); var chunkSize = 1024; var str = ''; for (var i = 0; i < uint8Array.length; i += chunkSize) { var chunk = uint8Array.subarray(i, i + chunkSize); str += String.fromCharCode.apply(null, chunk); } var base64String = btoa(str); FileSharer.share({ filename: name, contentType: "application/png", base64Data: base64String, }).catch(error => { //alert("File sharing failed" + error.message); console.error("File sharing failed", error.message); }); }) .catch((error) => { alert(error); }); } share(); }
I was using the wrong content type contentType: "application/png",
contentType: "application/png",
the correct mimetype would be image\png
image\png
Capacitor version:
Run
npx cap doctor
:Latest Dependencies:
@capacitor/cli: 4.7.1 @capacitor/core: 4.7.1 @capacitor/android: 4.7.1 @capacitor/ios: 4.7.1
Installed Dependencies:
@capacitor/cli: 4.7.0 @capacitor/core: 4.7.0 @capacitor/android: 4.7.0 @capacitor/ios: 4.7.0
Library version:
Your Plugin Configuration
Affected Platform(s):
Current Behavior
Share dialog won't show Instagram , but shows WhatsApp , when I try to share the same image from withing email or WhatsApp instagram appears normally
Expected Behavior
Instagram should be displayed on the share dialog
Sample Code or Sample Application Repo
Everything is default
Reproduction Steps
call the share dialog in a phone with instagram installed