This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {AppRegistry} from 'react-native'; | |
- import App from './App'; | |
+ import AppWrappedInCodePush from './AppWrappedInCodePush'; | |
import {name as appName} from './app.json'; | |
- AppRegistry.registerComponent(appName, () => App); | |
+ AppRegistry.registerComponent(appName, () => AppWrappedInCodePush); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// android/settings.gradle | |
rootProject.name = 'myapp' | |
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) | |
- include ':app' | |
+ include ':app', ':react-native-code-push' | |
+ project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- android/app/src/main/res/values/strings.xml --> | |
<resources> | |
<string name="app_name">myapp</string> | |
+ <string moduleConfig="true" name="CodePushDeploymentKey">Jbach1Qk_achQarrrhNOA9zwVlJnruLsa9jsr</string> | |
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File: android/app/src/main/java/com/myapp/MainApplication.java | |
import com.facebook.soloader.SoLoader; | |
import java.lang.reflect.InvocationTargetException; | |
import java.util.List; | |
+ import com.microsoft.codepush.react.CodePush; // 1. CodePush | |
public class MainApplication extends MultiDexApplication implements ReactApplication { | |
private final ReactNativeHost mReactNativeHost = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// file: android/app/build.gradle | |
apply from: "../../node_modules/react-native/react.gradle" | |
+ apply from: "../../node_modules/react-native-code-push/android/codepush.gradle" // CodePush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import App from './App'; | |
import codePush from 'react-native-code-push'; | |
class AppWrappedInCodePush extends Component { | |
render() { | |
return <App />; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interpolation: { | |
escapeValue: false, | |
format: function (value: any, format?: string, lng?: string) { | |
switch (format) { | |
case 'flags': | |
if ( | |
typeof value !== 'number' || | |
value < 1 || | |
!Number.isInteger(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
TouchableOpacity, | |
Dimensions, | |
} from 'react-native'; | |
import {useTranslation} from 'react-i18next'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import i18n, { | |
LanguageDetectorAsyncModule, | |
Services, | |
InitOptions, | |
} from 'i18next'; | |
import {initReactI18next} from 'react-i18next'; | |
import AsyncStorage from '@react-native-community/async-storage'; | |
import * as RNLocalize from 'react-native-localize'; | |
import en from './en'; | |
import hi from './hi'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
ok: 'OK', | |
cancel: 'Cancel', | |
}; |