Expo Unimodule for interfacing with Firebase Invites

Read more: https://gist.github.com/brentvatne/9038b16b4f42a21cea40ad5c35fdb74c
Last updated 2 years ago by sjchmiela .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install expo-firebase-invites 
SYNC missed versions from official npm registry.


expo-firebase is still in RC and therefore subject to breaking changings. Be sure to run yarn upgrade and cd ios; pod install when upgrading.

expo-firebase-invites provides a built-in solution for app referrals and sharing via email or SMS.

Full documentation


Make sure to install and setup expo-firebase-links before proceeding.

Now, you need to install the package from npm registry.

npm install expo-firebase-invites or yarn add expo-firebase-invites



If you're using Cocoapods, add the dependency to your Podfile:

pod 'EXFirebaseInvites', path: '../node_modules/expo-firebase-invites/ios'

and run pod install.

Common Setup

Now follow the setup instructions in the docs.

Invites will only work on iOS if the user is authenticated with Google.

Update AppDelegate.m

Replace the EXFirebaseLinks import with EXFirebaseInvites at the top of your ios/[App Name]/AppDelegate.m:

#import "EXFirebaseInvites.h"

Replace the EXFirebaseLinks methods with EXFirebaseInvites as follows:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<NSString *, id> *)options {
  return [[EXFirebaseInvites instance] application:application openURL:url options:options];

- (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *))restorationHandler {
  return [[EXFirebaseInvites instance] application:application continueUserActivity:userActivity restorationHandler:restorationHandler];


  1. Append the following lines to android/settings.gradle:

    include ':expo-firebase-invites'
    project(':expo-firebase-invites').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-invites/android')

    and if not already included

    include ':expo-core'
    project(':expo-core').projectDir = new File(rootProject.projectDir, '../node_modules/expo-core/android')
    include ':expo-firebase-app'
    project(':expo-firebase-app').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-app/android')
     include ':expo-firebase-links'
    project(':expo-firebase-links').projectDir = new File(rootProject.projectDir, '../node_modules/expo-firebase-links/android')
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:

    api project(':expo-firebase-invites')

    and if not already included

    api project(':expo-core')
    api project(':expo-firebase-app')
    api project(':expo-firebase-links')
  3. Now follow the setup instructions in the docs.

  4. Include the module in your expo packages: ./android/app/src/main/java/host/exp/exponent/MainActivity.java

    * At the top of the file.
    * This is automatically imported with Android Studio, but if you are in any other editor you will need to manually import the module.
    import expo.modules.firebase.app.FirebaseAppPackage; // This should be here for all Expo Firebase features.
    import expo.modules.firebase.invites.FirebaseInvitesPackage;
    // Later in the file...
    public List<Package> expoPackages() {
      // Here you can add your own packages.
      return Arrays.<Package>asList(
        new FirebaseAppPackage(), // This should be here for all Expo Firebase features.
        new FirebaseInvitesPackage() // Include this.


import React from 'react';
import { View } from 'react-native';
import firebase from 'expo-firebase-app';

// API can be accessed with: firebase.invites();

export default class DemoView extends React.Component {
  async componentDidMount() {
    // ... initialize firebase app

    const invitation = new firebase.invites.Invitation('Title', 'Message');

    try {
      // send the invitation
      const invitationIds = await firebase.invites().sendInvitation(invitation);
    } catch ({ message }) {
      // An Error was thrown.
  render() {
    return <View />;

Trouble Shooting

If you run into issues installing the ios Pod, you may want to update GoogleSignIn. You can do this with: pod update GoogleSignIn

Current Tags

  • 2.0.0                                ...           latest (2 years ago)
  • 2.0.0-rc.2                                ...           next (2 years ago)

10 Versions

  • 2.0.0 [deprecated]           ...           2 years ago
  • 2.0.0-rc.2                                ...           2 years ago
  • 2.0.0-rc.1                                ...           2 years ago
  • 2.0.0-rc.0                                ...           2 years ago
  • 1.0.0-rc.5                                ...           2 years ago
  • 1.0.0 [deprecated]           ...           2 years ago
  • 1.0.0-rc.3                                ...           2 years ago
  • 1.0.0-rc.2                                ...           2 years ago
  • 1.0.0-rc.1                                ...           2 years ago
  • 1.0.0-rc.0                                ...           2 years ago
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (1)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |