Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
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;
}