iOS -> iOS is working fine but when trying iOS -> Android, there seem to be an issue with the MIME body.
See the last line of the iOS -> Android logs.
iOS -> iOS
14:52:49.704‖ SyncVerbose: CBLMultipartDocumentReader[_id="(null)"]: has attachments, multipart/related; boundary="BE74265D-EA91-4E72-9012-C656345A6010"
14:52:49.706‖ SyncVerbose: CBLMultipartDocumentReader[_id="9177F8B0-21BA-4DFB-9C70-1E0DA287574E"]: Starting attachment #1...
14:52:49.712‖ SyncVerbose: CBLMultipartDocumentReader[_id="9177F8B0-21BA-4DFB-9C70-1E0DA287574E"]: Finished attachment #1: len=992k, digest=md5-pb4Bsi5wJVh5g31FK7oxzg==, SHA1=<9d5ca469 0d090388 94ef2a14 a13e0068 7d282e7a>
14:52:49.712‖ SyncVerbose: CBLMultipartDocumentReader[_id="9177F8B0-21BA-4DFB-9C70-1E0DA287574E"]: Finished loading (1 attachments)
Android -> iOS
14:51:20.892‖ SyncVerbose: CBLMultipartDocumentReader[_id="(null)"]: has attachments, multipart/related; boundary=OalAA-wjlkk89YgRsqIqIyIHVGk5Q2xMpV
14:51:20.892‖ SyncVerbose: CBLMultipartDocumentReader[_id="3ca1940f-6e96-4522-9b55-d6c54d7ea8c5"]: Starting attachment #1...
14:51:20.894‖ SyncVerbose: CBLMultipartDocumentReader[_id="3ca1940f-6e96-4522-9b55-d6c54d7ea8c5"]: Finished attachment #1: len=172k, digest=md5-XWjbA9IQHHJ/tzKADJB87A==, SHA1=<8eda6ee2 fda825ab fe7a59af d91afd4e 7548d84a>
14:51:20.894‖ SyncVerbose: CBLMultipartDocumentReader[_id="3ca1940f-6e96-4522-9b55-d6c54d7ea8c5"]: Finished loading (1 attachments)
14:51:20.894‖ WARNING: CBLMultipartDocumentReader[_id="3ca1940f-6e96-4522-9b55-d6c54d7ea8c5"]: Attachment 'photo' does not appear in a MIME body
I’m not sure what the MIME body is referencing to?
In the Android app, I’m saving attachments like so:
for (Parcelable path : uris) {
Bitmap image = BitmapFactory.decodeFile(path.toString());
Document document = database.createDocument();
UnsavedRevision revision = document.createRevision();
ByteArrayOutputStream out = new ByteArrayOutputStream();
image.compress(Bitmap.CompressFormat.JPEG, 50, out);
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
revision.setAttachment("photo", "application/octet-stream", in);
try {
revision.save();
} catch (CouchbaseLiteException e) {
e.printStackTrace();
}
}