-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
56 lines (47 loc) · 1.59 KB
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @flow
*/
import React from 'react';
import {StyleSheet, Text} from 'react-native';
import {initFirebase} from './moduleSrc/platform/firebase.native';
import {App as Application, appInit} from './moduleSrc/router/Flow.native';
import cnsole from 'loglevel';
import {CHAT_FONT_FAMILY} from './moduleSrc/constants/Constants';
import {checkForCodepushUpdateAsync} from './src/util/codepush';
import {setPushyNotificationListeners} from './moduleSrc/platform/pushy.native';
import {store} from './moduleSrc/router/store';
import {setupInternalStateFromLocal} from './moduleSrc/router/InternalState.native';
import {initBranch} from './moduleSrc/platform/Branch.native';
setPushyNotificationListeners();
cnsole.setLevel('info');
cnsole.info('****** App starting ********', new Date().getTime());
setupInternalStateFromLocal(store);
initFirebase();
checkForCodepushUpdateAsync();
appInit();
initBranch();
if (Platform.OS === 'android') {
const styles = StyleSheet.create({
defaultFontFamily: {
fontFamily: CHAT_FONT_FAMILY, // 'lucida grande',
}
});
const oldRender = Text.render;
if (!oldRender) {
cnsole.warn('Did not find Text.render');
} else {
cnsole.info('Found Text.render, overriding');
Text.render = function (...args) {
const origin = oldRender.call(this, ...args);
return React.cloneElement(origin, {
style: [styles.defaultFontFamily, origin.props.style]
});
};
}
}
export {
Application,
}