DEL: Remove Emulator check

This commit is contained in:
Marcos Rodriguez Vélez 2020-08-25 12:19:47 -04:00 committed by Overtorment
parent 330515b475
commit 79bd72bd38

View file

@ -1,7 +1,7 @@
import PushNotificationIOS from '@react-native-community/push-notification-ios';
import { Alert, Platform } from 'react-native';
import Frisbee from 'frisbee';
import { getApplicationName, getVersion, getSystemName, isEmulatorSync, getSystemVersion } from 'react-native-device-info';
import { getApplicationName, getVersion, getSystemName, getSystemVersion } from 'react-native-device-info';
import AsyncStorage from '@react-native-community/async-storage';
import loc from '../loc';
const PushNotification = require('react-native-push-notification');
@ -128,10 +128,6 @@ const configureNotifications = async function () {
* @returns {Promise<boolean>} TRUE if permissions were obtained, FALSE otherwise
*/
const tryToObtainPermissions = async function () {
if (isEmulatorSync() && Platform.OS === 'ios') {
console.log('Running inside iOS emulator. Exiting Push Notification configuration...');
return false;
}
if (await getPushToken()) {
// we already have a token, no sense asking again, just configure pushes to register callbacks and we are done
if (!alreadyConfigured) configureNotifications(); // no await so it executes in background while we return TRUE and use token