plugins
plugins copied to clipboard
composing email with attachments fails on Android (fix provided)
@nativescript/Email v2.0.5
Error Calling email.compose with array 'attachments' fails with this error: JS: 'Error in email.compose: TypeError: Cannot read property 'indexOf' of undefined'
Problem The problem is that 'compose' in "index.android.js" parses attachments using a "for-in" loop. My array created via brackets in JS has a 'move' method by default, and so this for-in loop parses 'attachments[move]' which fails.
Fix The fix is simply to change it to a "for-of" loop, as is the case in "index.ios.js". Replace this... for (const a in arg.attachments) { const attachment = arg.attachments[a]; with this... for (const attachment of arg.attachments) {