Important! A new Community experience launched on September 26, 2017. Read more about it here or continue to Base Camp.
Voting: 
Vote up!
0 Votes
1 Replies
Unanswered

kony.phone.openEmail fails to attach file on Android devices

Question asked by Ganesh kelam on Mar 21, 2017 10:18 EDT

I have developed a Kony Android custom camera FFI - which sends captured image as base64 string to js layer. I am succesfully converting that base64 to rawBytes using kony.convertToRawBytes API. But when I try to share rawBytes image as attachment to email, it is throwing " Couldn't attach file." error toast.  My Code var rawBytes = kony.convertToRawBytes(imageBase64); // "imageBase64" is valid base64 image returned from my FFI.  kony.phone.openEmail([], [], [], "Kony email subjet"," ", false, [ { mimetype : "image/*",  attachment : rawBytes }]); From below link, it should work. Same kony.phone.openEmail API call is working fine in iOS. http://developer.kony.com/twiki/pub/Portal/Docs/API_Reference/Content/Phone.htm#phone.op2 is this a bug in Android? Am I refering to wrong documentation? is there anyway to achieve this? Note: base64 image and converted rawBytes are valid, I check by writing to external SD card.    

Kony Answered Certificate
Vote up!
0 votes
Vote down!

Hi Ganesh,

If you check our document link,

Raw bytes received only from the kony.camera (only public access mode) or kony.phone.openMediaGallery APIs. To attach raw bytes received from other sources, you need to follow the  Sharing a File in Android with other Apps procedure. Please check the below link for more details.

http://docs.kony.com/konylibrary/visualizer/viz_api_dev_guide/Default.htm#sharefilesandroid.htm

http://docs.kony.com/konylibrary/visualizer/viz_api_dev_guide/Default.htm#kony.phone_functions.htm#phone.op2%3FTocPath%3DReferences%7Ckony.phone%2520Namespace%7CFunctions%7C_____4

Thanks

 

Answered by: Mar 22, 2017 06:46 EDT
Bronze