Skip to content

Commit

Permalink
Prevent running notifications on a simulator/emulator
Browse files Browse the repository at this point in the history
  • Loading branch information
kunall17 committed Jul 2, 2017
1 parent f89eec8 commit 878a2f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/MainScreenContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import React from 'react';
import { connect } from 'react-redux';
import isEqual from 'lodash.isequal';
import DeviceInfo from 'react-native-device-info';

import config from '../config';
import boundActions from '../boundActions';
Expand All @@ -17,7 +18,9 @@ import { initializeNotifications } from '../utils/notifications';
class MainScreenContainer extends React.Component {
componentWillMount() {
const { auth, saveTokenPush, switchNarrow } = this.props;
initializeNotifications(auth, saveTokenPush, switchNarrow);
if (!DeviceInfo.isEmulator()) {
initializeNotifications(auth, saveTokenPush, switchNarrow);
}
}

componentWillReceiveProps(nextProps) {
Expand Down

0 comments on commit 878a2f0

Please sign in to comment.