requested changes
This commit is contained in:
parent
0bf4716ad8
commit
36595d00d0
|
@ -1,10 +1,10 @@
|
||||||
def taskRequests = getGradle().getStartParameter().getTaskRequests().toString()
|
def taskRequests = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase()
|
||||||
def isPlay = !(taskRequests.contains("Foss") || taskRequests.contains("foss"))
|
def isPlay = !taskRequests.contains("foss")
|
||||||
|
|
||||||
apply plugin: "com.android.application"
|
apply plugin: "com.android.application"
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
|
|
||||||
if(isPlay){
|
if (isPlay) {
|
||||||
apply plugin: "io.fabric"
|
apply plugin: "io.fabric"
|
||||||
apply plugin: "com.google.firebase.firebase-perf"
|
apply plugin: "com.google.firebase.firebase-perf"
|
||||||
apply plugin: 'com.bugsnag.android.gradle'
|
apply plugin: 'com.bugsnag.android.gradle'
|
||||||
|
@ -271,6 +271,6 @@ task copyDownloadableDepsToLibs(type: Copy) {
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
||||||
if(isPlay) {
|
if (isPlay) {
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class MainApplication extends Application implements ReactApplication, IN
|
||||||
protected List<ReactPackage> getPackages() {
|
protected List<ReactPackage> getPackages() {
|
||||||
@SuppressWarnings("UnnecessaryLocalVariable")
|
@SuppressWarnings("UnnecessaryLocalVariable")
|
||||||
List<ReactPackage> packages = new PackageList(this).getPackages();
|
List<ReactPackage> packages = new PackageList(this).getPackages();
|
||||||
if(BuildConfig.PLAY_BUILD) {
|
if (BuildConfig.PLAY_BUILD) {
|
||||||
packages.add(new RNFirebaseCrashlyticsPackage());
|
packages.add(new RNFirebaseCrashlyticsPackage());
|
||||||
packages.add(new RNFirebaseAnalyticsPackage());
|
packages.add(new RNFirebaseAnalyticsPackage());
|
||||||
packages.add(new RNFirebasePerformancePackage());
|
packages.add(new RNFirebasePerformancePackage());
|
||||||
|
|
|
@ -18,10 +18,11 @@ buildscript {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def taskRequests = getGradle().getStartParameter().getTaskRequests().toString()
|
def taskRequests = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase()
|
||||||
def isPlay = !(taskRequests.contains("Foss") || taskRequests.contains("foss"))
|
def isPlay = !taskRequests.contains("foss")
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
if(isPlay){
|
if (isPlay) {
|
||||||
classpath 'com.google.gms:google-services:4.2.0'
|
classpath 'com.google.gms:google-services:4.2.0'
|
||||||
classpath 'io.fabric.tools:gradle:1.28.1'
|
classpath 'io.fabric.tools:gradle:1.28.1'
|
||||||
classpath 'com.google.firebase:perf-plugin:1.2.1'
|
classpath 'com.google.firebase:perf-plugin:1.2.1'
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
import RNConfigReader from 'react-native-config-reader';
|
||||||
|
|
||||||
|
export const isGooglePlayBuild = RNConfigReader.PLAY_BUILD;
|
12
app/index.js
12
app/index.js
|
@ -6,7 +6,6 @@ import RNUserDefaults from 'rn-user-defaults';
|
||||||
import { KeyCommandsEmitter } from 'react-native-keycommands';
|
import { KeyCommandsEmitter } from 'react-native-keycommands';
|
||||||
import RNScreens from 'react-native-screens';
|
import RNScreens from 'react-native-screens';
|
||||||
import { SafeAreaProvider, initialWindowMetrics } from 'react-native-safe-area-context';
|
import { SafeAreaProvider, initialWindowMetrics } from 'react-native-safe-area-context';
|
||||||
import RNConfigReader from 'react-native-config-reader';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
defaultTheme,
|
defaultTheme,
|
||||||
|
@ -37,12 +36,11 @@ import Toast from './containers/Toast';
|
||||||
import InAppNotification from './containers/InAppNotification';
|
import InAppNotification from './containers/InAppNotification';
|
||||||
import { ActionSheetProvider } from './containers/ActionSheet';
|
import { ActionSheetProvider } from './containers/ActionSheet';
|
||||||
import debounce from './utils/debounce';
|
import debounce from './utils/debounce';
|
||||||
|
import { isGooglePlayBuild } from './constants/environment';
|
||||||
|
|
||||||
|
|
||||||
RNScreens.enableScreens();
|
RNScreens.enableScreens();
|
||||||
|
|
||||||
const isPlayBuild = RNConfigReader.PLAY_BUILD;
|
|
||||||
|
|
||||||
const parseDeepLinking = (url) => {
|
const parseDeepLinking = (url) => {
|
||||||
if (url) {
|
if (url) {
|
||||||
url = url.replace(/rocketchat:\/\/|https:\/\/go.rocket.chat\//, '');
|
url = url.replace(/rocketchat:\/\/|https:\/\/go.rocket.chat\//, '');
|
||||||
|
@ -61,7 +59,9 @@ export default class Root extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.init();
|
this.init();
|
||||||
this.initCrashReport();
|
if (isGooglePlayBuild) {
|
||||||
|
this.initCrashReport();
|
||||||
|
}
|
||||||
const { width, height, scale } = Dimensions.get('window');
|
const { width, height, scale } = Dimensions.get('window');
|
||||||
this.state = {
|
this.state = {
|
||||||
theme: defaultTheme(),
|
theme: defaultTheme(),
|
||||||
|
@ -163,9 +163,7 @@ export default class Root extends React.Component {
|
||||||
if (!allowCrashReport) {
|
if (!allowCrashReport) {
|
||||||
loggerConfig.autoNotify = false;
|
loggerConfig.autoNotify = false;
|
||||||
loggerConfig.registerBeforeSendCallback(() => false);
|
loggerConfig.registerBeforeSendCallback(() => false);
|
||||||
if (isPlayBuild) {
|
analytics().setAnalyticsCollectionEnabled(false);
|
||||||
analytics().setAnalyticsCollectionEnabled(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import EJSON from 'ejson';
|
import EJSON from 'ejson';
|
||||||
import RNConfigReader from 'react-native-config-reader';
|
|
||||||
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 { isGooglePlayBuild } from '../../constants/environment';
|
||||||
|
|
||||||
export const onNotification = (notification) => {
|
export const onNotification = (notification) => {
|
||||||
if (notification) {
|
if (notification) {
|
||||||
|
@ -37,8 +37,7 @@ 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 isPlayBuild = RNConfigReader.PLAY_BUILD;
|
if (isGooglePlayBuild) {
|
||||||
if (isPlayBuild) {
|
|
||||||
setBadgeCount();
|
setBadgeCount();
|
||||||
return PushNotification.configure({
|
return PushNotification.configure({
|
||||||
onNotification
|
onNotification
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
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 { isGooglePlayBuild } from '../constants/environment';
|
||||||
import config from '../../config';
|
import config from '../../config';
|
||||||
|
|
||||||
const isPlayBuild = RNConfigReader.PLAY_BUILD;
|
|
||||||
const bugsnag = new Client(config.BUGSNAG_API_KEY);
|
const bugsnag = new Client(config.BUGSNAG_API_KEY);
|
||||||
|
|
||||||
export const { analytics } = firebase != null;
|
export const analytics = isGooglePlayBuild ? firebase.analytics : ({
|
||||||
|
logEvent: () => { }
|
||||||
|
});
|
||||||
|
|
||||||
export const loggerConfig = bugsnag.config;
|
export const loggerConfig = bugsnag.config;
|
||||||
export const { leaveBreadcrumb } = bugsnag;
|
export const { leaveBreadcrumb } = bugsnag;
|
||||||
|
|
||||||
|
@ -19,7 +21,7 @@ export const logServerVersion = (serverVersion) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const setCurrentScreen = (currentScreen) => {
|
export const setCurrentScreen = (currentScreen) => {
|
||||||
if (isPlayBuild) {
|
if (isGooglePlayBuild) {
|
||||||
analytics().setCurrentScreen(currentScreen);
|
analytics().setCurrentScreen(currentScreen);
|
||||||
}
|
}
|
||||||
leaveBreadcrumb(currentScreen, { type: 'navigation' });
|
leaveBreadcrumb(currentScreen, { type: 'navigation' });
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { isIOS } from './deviceInfo';
|
||||||
import I18n from '../i18n';
|
import I18n from '../i18n';
|
||||||
import { showErrorAlert } from './info';
|
import { showErrorAlert } from './info';
|
||||||
import { STORE_REVIEW_LINK } from '../constants/links';
|
import { STORE_REVIEW_LINK } from '../constants/links';
|
||||||
|
import { isGooglePlayBuild } from '../constants/environment';
|
||||||
|
|
||||||
const store = isIOS ? 'App Store' : 'Play Store';
|
const store = isIOS ? 'App Store' : 'Play Store';
|
||||||
|
|
||||||
|
@ -75,7 +76,7 @@ const tryReview = async() => {
|
||||||
|
|
||||||
// if ask me later was pressed earlier, we can ask for review only after {{numberOfDays}} days
|
// if ask me later was pressed earlier, we can ask for review only after {{numberOfDays}} days
|
||||||
// if there's no review and it wasn't dismissed by the user
|
// if there's no review and it wasn't dismissed by the user
|
||||||
if (daysBetween(lastReviewDate, new Date()) >= numberOfDays && !doneReview) {
|
if (daysBetween(lastReviewDate, new Date()) >= numberOfDays && !doneReview && isGooglePlayBuild) {
|
||||||
setTimeout(askReview, reviewDelay);
|
setTimeout(askReview, reviewDelay);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,7 +5,6 @@ import {
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import equal from 'deep-equal';
|
import equal from 'deep-equal';
|
||||||
import RNConfigReader from 'react-native-config-reader';
|
|
||||||
|
|
||||||
import { analytics } from '../utils/log';
|
import { analytics } from '../utils/log';
|
||||||
import sharedStyles from './Styles';
|
import sharedStyles from './Styles';
|
||||||
|
@ -18,8 +17,7 @@ import FormContainer, { FormContainerInner } from '../containers/FormContainer';
|
||||||
import TextInput from '../containers/TextInput';
|
import TextInput from '../containers/TextInput';
|
||||||
import { loginRequest as loginRequestAction } from '../actions/login';
|
import { loginRequest as loginRequestAction } from '../actions/login';
|
||||||
import LoginServices from '../containers/LoginServices';
|
import LoginServices from '../containers/LoginServices';
|
||||||
|
import { isGooglePlayBuild } from '../constants/environment';
|
||||||
const configValue = RNConfigReader.PLAY_BUILD;
|
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
registerDisabled: {
|
registerDisabled: {
|
||||||
|
@ -124,7 +122,7 @@ class LoginView extends React.Component {
|
||||||
const { loginRequest } = this.props;
|
const { loginRequest } = this.props;
|
||||||
Keyboard.dismiss();
|
Keyboard.dismiss();
|
||||||
loginRequest({ user, password });
|
loginRequest({ user, password });
|
||||||
if (configValue) {
|
if (isGooglePlayBuild) {
|
||||||
analytics().logEvent('login');
|
analytics().logEvent('login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import {
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import AsyncStorage from '@react-native-community/async-storage';
|
import AsyncStorage from '@react-native-community/async-storage';
|
||||||
import RNConfigReader from 'react-native-config-reader';
|
|
||||||
|
|
||||||
import { logout as logoutAction } from '../../actions/login';
|
import { logout as logoutAction } from '../../actions/login';
|
||||||
import { selectServerRequest as selectServerRequestAction } from '../../actions/server';
|
import { selectServerRequest as selectServerRequestAction } from '../../actions/server';
|
||||||
|
@ -36,8 +35,8 @@ import { appStart as appStartAction, ROOT_LOADING } from '../../actions/app';
|
||||||
import { onReviewPress } from '../../utils/review';
|
import { onReviewPress } from '../../utils/review';
|
||||||
import { getUserSelector } from '../../selectors/login';
|
import { getUserSelector } from '../../selectors/login';
|
||||||
import SafeAreaView from '../../containers/SafeAreaView';
|
import SafeAreaView from '../../containers/SafeAreaView';
|
||||||
|
import { isGooglePlayBuild } from '../../constants/environment';
|
||||||
|
|
||||||
const isPlayBuild = RNConfigReader.PLAY_BUILD;
|
|
||||||
|
|
||||||
const SectionSeparator = React.memo(({ theme }) => (
|
const SectionSeparator = React.memo(({ theme }) => (
|
||||||
<View
|
<View
|
||||||
|
@ -118,7 +117,7 @@ class SettingsView extends React.Component {
|
||||||
const { toggleCrashReport } = this.props;
|
const { toggleCrashReport } = this.props;
|
||||||
toggleCrashReport(value);
|
toggleCrashReport(value);
|
||||||
loggerConfig.autoNotify = value;
|
loggerConfig.autoNotify = value;
|
||||||
if (isPlayBuild) {
|
if (isGooglePlayBuild) {
|
||||||
analytics().setAnalyticsCollectionEnabled(value);
|
analytics().setAnalyticsCollectionEnabled(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,14 +252,18 @@ class SettingsView extends React.Component {
|
||||||
theme={theme}
|
theme={theme}
|
||||||
/>
|
/>
|
||||||
<Separator theme={theme} />
|
<Separator theme={theme} />
|
||||||
<ListItem
|
{isGooglePlayBuild ? (
|
||||||
title={I18n.t('Review_this_app')}
|
<>
|
||||||
showActionIndicator
|
<ListItem
|
||||||
onPress={onReviewPress}
|
title={I18n.t('Review_this_app')}
|
||||||
testID='settings-view-review-app'
|
showActionIndicator
|
||||||
right={this.renderDisclosure}
|
onPress={onReviewPress}
|
||||||
theme={theme}
|
testID='settings-view-review-app'
|
||||||
/>
|
right={this.renderDisclosure}
|
||||||
|
theme={theme}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
<Separator theme={theme} />
|
<Separator theme={theme} />
|
||||||
<ListItem
|
<ListItem
|
||||||
title={I18n.t('Share_this_app')}
|
title={I18n.t('Share_this_app')}
|
||||||
|
@ -339,17 +342,21 @@ class SettingsView extends React.Component {
|
||||||
</>
|
</>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<ListItem
|
{isGooglePlayBuild ? (
|
||||||
title={I18n.t('Send_crash_report')}
|
<>
|
||||||
testID='settings-view-crash-report'
|
<ListItem
|
||||||
right={() => this.renderCrashReportSwitch()}
|
title={I18n.t('Send_crash_report')}
|
||||||
theme={theme}
|
testID='settings-view-crash-report'
|
||||||
/>
|
right={() => this.renderCrashReportSwitch()}
|
||||||
<Separator theme={theme} />
|
theme={theme}
|
||||||
<ItemInfo
|
/>
|
||||||
info={I18n.t('Crash_report_disclaimer')}
|
<Separator theme={theme} />
|
||||||
theme={theme}
|
<ItemInfo
|
||||||
/>
|
info={I18n.t('Crash_report_disclaimer')}
|
||||||
|
theme={theme}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
|
||||||
<Separator theme={theme} />
|
<Separator theme={theme} />
|
||||||
<ListItem
|
<ListItem
|
||||||
|
|
Loading…
Reference in New Issue