Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion 26
buildToolsVersion "26.0.3"

defaultConfig {
minSdkVersion 16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.content.FileProvider;
import android.text.Html;
import android.text.Spanned;
import android.util.Base64;
Expand Down Expand Up @@ -35,7 +37,7 @@


public class RNMailComposeModule extends ReactContextBaseJavaModule {
private static final int ACTIVITY_SEND = 129382;
private static final int ACTIVITY_SEND = 29382;

private Promise mPromise;

Expand Down Expand Up @@ -123,7 +125,16 @@ private void addAttachments(Intent intent, ReadableArray attachments) {
}

if (tempFile != null) {
uris.add(Uri.fromFile(tempFile));
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
Uri apkURI = FileProvider.getUriForFile(
getReactApplicationContext(),
getReactApplicationContext().getApplicationContext()
.getPackageName() + ".provider", tempFile);
intent.setDataAndType(apkURI, "image/*");
uris.add(apkURI);
} else {
uris.add(Uri.fromFile(tempFile));
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions ios/RNMailCompose/RNMailCompose.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,10 @@ class RNMailCompose: NSObject, MFMailComposeViewControllerDelegate {
}
return false
}

@objc
static func requiresMainQueueSetup() -> Bool {
return false
}
}