fix stuck screen

This commit is contained in:
GOVINDDIXIT 2020-07-07 20:52:42 +05:30
parent 00feb2f694
commit ed42199ad8
4 changed files with 20 additions and 6 deletions

View File

@ -3,6 +3,7 @@ import EJSON from 'ejson';
import PushNotification from './push';
import store from '../../lib/createStore';
import { deepLinkingOpen } from '../../actions/deepLinking';
import RNConfigReader from 'react-native-config-reader';
export const onNotification = (notification) => {
if (notification) {
@ -37,8 +38,11 @@ export const onNotification = (notification) => {
export const getDeviceToken = () => PushNotification.getDeviceToken();
export const setBadgeCount = count => PushNotification.setBadgeCount(count);
export const initializePushNotifications = () => {
setBadgeCount();
return PushNotification.configure({
onNotification
});
const configValue = RNConfigReader.PLAY_BUILD;
if(configValue){
setBadgeCount();
return PushNotification.configure({
onNotification
});
}
};

View File

@ -1,7 +1,9 @@
import { Client } from 'bugsnag-react-native';
import firebase from 'react-native-firebase';
import RNConfigReader from 'react-native-config-reader';
import config from '../../config';
const configValue = RNConfigReader.PLAY_BUILD;
const bugsnag = new Client(config.BUGSNAG_API_KEY);
export const { analytics } = firebase;
@ -17,7 +19,9 @@ export const logServerVersion = (serverVersion) => {
};
export const setCurrentScreen = (currentScreen) => {
analytics().setCurrentScreen(currentScreen);
if(configValue){
analytics().setCurrentScreen(currentScreen);
}
leaveBreadcrumb(currentScreen, { type: 'navigation' });
};

View File

@ -16,7 +16,7 @@
"generate-source-maps-ios": "react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ios-release.bundle --sourcemap-output ios-release.bundle.map",
"generate-source-maps-android": "bugsnag-sourcemaps",
"postinstall": "patch-package && jetify",
"play": "npx react-native run-android --variant=playDebug",
"play": "npx react-native run-android --variant=playDebug",
"foss": "npx react-native run-android --variant=fossDebug"
},
"husky": {
@ -67,6 +67,7 @@
"react-native-audio": "^4.3.0",
"react-native-background-timer": "2.2.0",
"react-native-bootsplash": "2.2.4",
"react-native-config-reader": "^4.1.1",
"react-native-console-time-polyfill": "^1.2.1",
"react-native-device-info": "5.5.7",
"react-native-document-picker": "3.3.3",

View File

@ -11770,6 +11770,11 @@ react-native-bootsplash@2.2.4:
jimp "0.10.1"
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:
version "1.2.1"
resolved "https://registry.yarnpkg.com/react-native-console-time-polyfill/-/react-native-console-time-polyfill-1.2.1.tgz#3bf9a1d1d1ce3a05325fe1f2e5c4e5a1c25d910f"