How to use the react-native-branch.default function in react-native-branch

To help you get started, we’ve selected a few react-native-branch examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github expo / expo / apps / native-component-list / src / screens / ExpoApisScreen.tsx View on Github external
import React from 'react';
import { Notifications } from 'expo';
import { Alert, Platform } from 'react-native';
import { EventSubscription } from 'fbemitter';
import ComponentListScreen from './ComponentListScreen';
import { Screens } from '../navigation/ExpoApis';

try {
  require('react-native-branch').default.subscribe((bundle: any) => {
    if (bundle && bundle.params && !bundle.error) {
      Alert.alert('Opened Branch link', JSON.stringify(bundle.params, null, 2));
    }
  });
} catch (e) {
  // Branch is not available, do nothing
}

export default class ExpoApisScreen extends React.Component {
  static path = '';

  static navigationOptions = {
    title: 'APIs in Expo SDK',
  };

  _notificationSubscription?: EventSubscription;
github expo / expo / apps / native-component-list / src / screens / BranchScreen.tsx View on Github external
import React from 'react';
import { Alert, Button, StyleSheet, Text, View, Platform } from 'react-native';
import Constants from 'expo-constants';

let Branch = null;
if (Platform.OS !== 'web') {
  try {
    Branch = require('react-native-branch').default;
  } catch (e) {
    console.log('Branch is not supported on this platform.', e);
  }
}

export default class BranchScreen extends React.Component {
  static navigationOptions = {
    title: 'Branch',
  };

  _branchUniversalObject?: any;

  async _getOrCreateBranchObjectAsync() {
    if (this._branchUniversalObject) {
      return this._branchUniversalObject;
    }

react-native-branch

Branch Metrics React Native SDK

MIT
Latest version published 2 months ago

Package Health Score

87 / 100
Full package analysis