Will not return to app after Email Send/Cancel


#1

Hi all, newbie here,

I am trying to debug my app through Xcode that will write a file and let the user send the file as an email attachment. Everything is working in Android build but in iOS, if there is more than one attachment, the email compose screen will stay on after any button click, i.e. Send, Save Draft, Delete Draft.

However, hitting send or save draft actually does what it supposed to do, I ended up having multiple drafts or receiving multiple emails. The only way I could get out of it is to force quit my app.

The only output I see from Xcode is CDVIonicKeyboard: updating frame when I focus on a text field/button.
And when I press save draft:

[App] if we’re in the real pre-commit handler we can’t actually add any new fences due to CA restriction.

The plugin I’m using for email is the social share.

cordova-plugin-device 2.0.2 “Device”
cordova-plugin-file 6.0.1 “File”
cordova-plugin-inappbrowser 3.0.0 “InAppBrowser”
cordova-plugin-ionic-keyboard 2.0.5 “cordova-plugin-ionic-keyboard”
cordova-plugin-ionic-webview 1.1.19 “cordova-plugin-ionic-webview”
cordova-plugin-splashscreen 5.0.2 “Splashscreen”
cordova-plugin-whitelist 1.3.3 “Whitelist”
cordova-plugin-x-socialsharing 5.4.0 “SocialSharing”
cordova-sqlite-storage 2.3.2 “Cordova sqlite storage plugin”
es6-promise-plugin 4.2.2 “Promise”

ionic --version is 3.20.0

iOS 11.2.6 and iOS 10.2 have the same behaviour.

The specific code that initiates sharing is as follow:

shareAllproject(finalResult){
this.socialSharing.canShareViaEmail().then(() => {
console.log(finalResult)
console.log(‘Sharing via email is possible’)
this.socialSharing.shareViaEmail('Shared on '+Date(), ‘Project’, null,null ,null , this.filelist).catch(function(e) {
console.log(e);
})
}).catch(() => {
console.log(‘Sharing via email is not possible’)
});
}

filelist is an array that looks like this in safari console. It doesn’t show the whole path, but the right file shows up in the email composer.

0 “file:///var/mobile/Containers/Data/Application/BD0D5FFA-B0D7-45E0-807E-0C87FE99095F/Library/NoCloud/Markit-Project_aed9d606-681b-4bf3-99bf-1…”
1 “file:///var/mobile/Containers/Data/Application/BD0D5FFA-B0D7-45E0-807E-0C87FE99095F/Library/NoCloud/Markit-Project_d315a168-8df2-4fc3-9a58-c…”

Let me know what else do you guys need to know. I’m puzzled.

Thanks,
Kevin


#2

Hi all, seems like the problem is I called social sharing more than once. Thanks for looking into it.