Closed tknight00 closed 12 months ago
Android 13 Capacitor 5 Ionic 5
Facing the same issue while trying to send the jpeg images. The gmail opens and is populated with data correctly but the application crashes. There is no exception/error thrown either.
But, when used an image of size 10KB it works! So this might be related to the size? Anyways, there is no size limit given in the documentation also. (works for pdf)
I would appreciate PR's for this. I currently only have the time to manage this plugin for my own usage and i don't use attachments. If anyone has enough native experience to debug and fix this, it would be highly appreciated 🙏🏼
We found out that this limitation exists within the Android OS. This exception is thrown in different scenarios, for example when you want to share data from a size of about 500kb between two apps .So no problem that can be solved with this plugin.
Read more: https://developer.android.com/reference/android/os/TransactionTooLargeException
To work around the problem, the data must be saved on the device beforehand. You can use https://capacitorjs.com/docs/apis/filesystem for this. The stored file can then be transferred to the email client via the path with EmailComposer.
@develmood thanks for your investigation! I will add a note in the readme docs. Thanks 😊
Android 12 Ionic 6 Capacitor 4
I'm taking a screenshot using Capacitor Screenshot, and attempting to email it via Capacitor Email Composer.
I'm using the following code
Gmail opens and I see the attached screenshot, and everything appears to of populated correctly for roughly 1 second before the app crashes. I can still send the email as all the data is correctly inserted. I don't see any console log errors. Removing the attached image prevents the crash.
----- Below is the DEBUG log generated by Android Studio -----
The screenshot image is only 693kb. Shouldn't this be a try/catch that generates a console.log? Also, how do I discover the file size limit? If it exceeds the limit, why is it still correctly populated in gmail?