Skip to content

kimho/react-native-mail-app-launcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-mail-app-launcher

Launch mail app from react-native application. forked from react-native-mail-launcher

Getting started

$ npm install react-native-mail-app-launcher --save

Mostly automatic installation

$ react-native link react-native-mail-app-launcher

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import net.kimho.RNMailAppLauncherPackage; to the imports at the top of the file
  • Add new RNMailAppLauncherPackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-mail-app-launcher'
    project(':react-native-mail-app-launcher').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-mail-app-launcher/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-mail-app-launcher')
    

iOS

We do not need a native module for iOS

Usage

import * as React from "react";
import { View, Button } from "react-native";
import { runMailApp } from "react-native-mail-app-launcher";

export default class Example extends React.Component {
  openMail = () => {
    runMailApp();
  };

  render() {
    return (
      <View>
        <Button onPress={this.openMail}>Go to mail client</Button>
      </View>
    );
  }
}

About

Forked from react-native-mail-launcher. Launch mail app from react-native application.

Resources

Stars

Watchers

Forks

Packages

No packages published