fix stuck screen
This commit is contained in:
parent
00feb2f694
commit
ed42199ad8
|
@ -3,6 +3,7 @@ import EJSON from 'ejson';
|
||||||
import PushNotification from './push';
|
import PushNotification from './push';
|
||||||
import store from '../../lib/createStore';
|
import store from '../../lib/createStore';
|
||||||
import { deepLinkingOpen } from '../../actions/deepLinking';
|
import { deepLinkingOpen } from '../../actions/deepLinking';
|
||||||
|
import RNConfigReader from 'react-native-config-reader';
|
||||||
|
|
||||||
export const onNotification = (notification) => {
|
export const onNotification = (notification) => {
|
||||||
if (notification) {
|
if (notification) {
|
||||||
|
@ -37,8 +38,11 @@ export const onNotification = (notification) => {
|
||||||
export const getDeviceToken = () => PushNotification.getDeviceToken();
|
export const getDeviceToken = () => PushNotification.getDeviceToken();
|
||||||
export const setBadgeCount = count => PushNotification.setBadgeCount(count);
|
export const setBadgeCount = count => PushNotification.setBadgeCount(count);
|
||||||
export const initializePushNotifications = () => {
|
export const initializePushNotifications = () => {
|
||||||
|
const configValue = RNConfigReader.PLAY_BUILD;
|
||||||
|
if(configValue){
|
||||||
setBadgeCount();
|
setBadgeCount();
|
||||||
return PushNotification.configure({
|
return PushNotification.configure({
|
||||||
onNotification
|
onNotification
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
import { Client } from 'bugsnag-react-native';
|
import { Client } from 'bugsnag-react-native';
|
||||||
import firebase from 'react-native-firebase';
|
import firebase from 'react-native-firebase';
|
||||||
|
import RNConfigReader from 'react-native-config-reader';
|
||||||
import config from '../../config';
|
import config from '../../config';
|
||||||
|
|
||||||
|
const configValue = RNConfigReader.PLAY_BUILD;
|
||||||
const bugsnag = new Client(config.BUGSNAG_API_KEY);
|
const bugsnag = new Client(config.BUGSNAG_API_KEY);
|
||||||
|
|
||||||
export const { analytics } = firebase;
|
export const { analytics } = firebase;
|
||||||
|
@ -17,7 +19,9 @@ export const logServerVersion = (serverVersion) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const setCurrentScreen = (currentScreen) => {
|
export const setCurrentScreen = (currentScreen) => {
|
||||||
|
if(configValue){
|
||||||
analytics().setCurrentScreen(currentScreen);
|
analytics().setCurrentScreen(currentScreen);
|
||||||
|
}
|
||||||
leaveBreadcrumb(currentScreen, { type: 'navigation' });
|
leaveBreadcrumb(currentScreen, { type: 'navigation' });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,7 @@
|
||||||
"react-native-audio": "^4.3.0",
|
"react-native-audio": "^4.3.0",
|
||||||
"react-native-background-timer": "2.2.0",
|
"react-native-background-timer": "2.2.0",
|
||||||
"react-native-bootsplash": "2.2.4",
|
"react-native-bootsplash": "2.2.4",
|
||||||
|
"react-native-config-reader": "^4.1.1",
|
||||||
"react-native-console-time-polyfill": "^1.2.1",
|
"react-native-console-time-polyfill": "^1.2.1",
|
||||||
"react-native-device-info": "5.5.7",
|
"react-native-device-info": "5.5.7",
|
||||||
"react-native-document-picker": "3.3.3",
|
"react-native-document-picker": "3.3.3",
|
||||||
|
|
|
@ -11770,6 +11770,11 @@ react-native-bootsplash@2.2.4:
|
||||||
jimp "0.10.1"
|
jimp "0.10.1"
|
||||||
prompts "2.3.2"
|
prompts "2.3.2"
|
||||||
|
|
||||||
|
react-native-config-reader@^4.1.1:
|
||||||
|
version "4.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/react-native-config-reader/-/react-native-config-reader-4.1.1.tgz#478b69e32adcc2e9a14f6ef5fa2cbbe012b9a27e"
|
||||||
|
integrity sha512-f+I9DkmJS5UYE++vgSBIFG/TUxxCy9GSpcDFmVj7TDNW9w+Nozc98pdene/VYFzg9QRE7hejRoA6yV1Lv+QbCw==
|
||||||
|
|
||||||
react-native-console-time-polyfill@^1.2.1:
|
react-native-console-time-polyfill@^1.2.1:
|
||||||
version "1.2.1"
|
version "1.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/react-native-console-time-polyfill/-/react-native-console-time-polyfill-1.2.1.tgz#3bf9a1d1d1ce3a05325fe1f2e5c4e5a1c25d910f"
|
resolved "https://registry.yarnpkg.com/react-native-console-time-polyfill/-/react-native-console-time-polyfill-1.2.1.tgz#3bf9a1d1d1ce3a05325fe1f2e5c4e5a1c25d910f"
|
||||||
|
|
Loading…
Reference in New Issue