Sync master (#721)
4
.babelrc
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"presets": ["react-native"],
|
"presets": ["module:metro-react-native-babel-preset"],
|
||||||
"plugins": ["transform-decorators-legacy"],
|
"plugins": [["@babel/plugin-proposal-decorators", { "legacy": true }]],
|
||||||
"env": {
|
"env": {
|
||||||
"production": {
|
"production": {
|
||||||
"plugins": ["transform-remove-console"]
|
"plugins": ["transform-remove-console"]
|
||||||
|
|
|
@ -14,36 +14,39 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
|
||||||
|
- restore_cache:
|
||||||
|
key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }}
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Install NPM modules
|
name: Install NPM modules
|
||||||
command: |
|
command: |
|
||||||
npm install
|
yarn
|
||||||
# npm install codecov
|
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Lint
|
name: Lint
|
||||||
command: |
|
command: |
|
||||||
npm run lint
|
yarn lint
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Test
|
name: Test
|
||||||
command: |
|
command: |
|
||||||
npm test
|
yarn test
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Codecov
|
name: Codecov
|
||||||
command: |
|
command: |
|
||||||
npx codecov
|
yarn codecov
|
||||||
|
|
||||||
android-build:
|
- save_cache:
|
||||||
<<: *defaults
|
key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }}
|
||||||
docker:
|
paths:
|
||||||
- image: circleci/android:api-26-alpha
|
- ./node_modules
|
||||||
|
|
||||||
|
e2e-test:
|
||||||
|
macos:
|
||||||
|
xcode: "10.1.0"
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError"
|
|
||||||
JVM_OPTS: -Xmx4096m
|
|
||||||
TERM: dumb
|
|
||||||
BASH_ENV: "~/.nvm/nvm.sh"
|
BASH_ENV: "~/.nvm/nvm.sh"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -54,15 +57,58 @@ jobs:
|
||||||
command: |
|
command: |
|
||||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
|
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
|
||||||
source ~/.nvm/nvm.sh
|
source ~/.nvm/nvm.sh
|
||||||
|
# https://github.com/creationix/nvm/issues/1394
|
||||||
|
set +e
|
||||||
nvm install 8
|
nvm install 8
|
||||||
|
|
||||||
- restore_cache:
|
- run:
|
||||||
key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "package.json" }}
|
name: Install appleSimUtils
|
||||||
|
command: |
|
||||||
|
brew update
|
||||||
|
brew tap wix/brew
|
||||||
|
brew install wix/brew/applesimutils
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Install NPM modules
|
name: Install NPM modules
|
||||||
command: |
|
command: |
|
||||||
npm install
|
yarn global add detox-cli
|
||||||
|
yarn
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Build
|
||||||
|
command: |
|
||||||
|
detox build --configuration ios.sim.release
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Test
|
||||||
|
command: |
|
||||||
|
detox test --configuration ios.sim.release --cleanup
|
||||||
|
|
||||||
|
- store_artifacts:
|
||||||
|
path: /tmp/screenshots
|
||||||
|
|
||||||
|
android-build:
|
||||||
|
<<: *defaults
|
||||||
|
docker:
|
||||||
|
- image: circleci/android:api-28-node8-alpha
|
||||||
|
|
||||||
|
environment:
|
||||||
|
# GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError"
|
||||||
|
GRADLE_OPTS: -Xmx2048m -Dorg.gradle.daemon=false
|
||||||
|
JVM_OPTS: -Xmx4096m
|
||||||
|
TERM: dumb
|
||||||
|
BASH_ENV: "~/.nvm/nvm.sh"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
|
||||||
|
- restore_cache:
|
||||||
|
key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }}
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Install NPM modules
|
||||||
|
command: |
|
||||||
|
yarn
|
||||||
|
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: android-{{ checksum ".circleci/config.yml" }}-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }}
|
key: android-{{ checksum ".circleci/config.yml" }}-{{ checksum "android/build.gradle" }}-{{ checksum "android/app/build.gradle" }}
|
||||||
|
@ -73,6 +119,7 @@ jobs:
|
||||||
cd android
|
cd android
|
||||||
|
|
||||||
echo -e "" > ./gradle.properties
|
echo -e "" > ./gradle.properties
|
||||||
|
echo -e "android.enableAapt2=false" >> ./gradle.properties
|
||||||
|
|
||||||
if [[ $KEYSTORE ]]; then
|
if [[ $KEYSTORE ]]; then
|
||||||
echo $KEYSTORE_BASE64 | base64 --decode > ./app/$KEYSTORE
|
echo $KEYSTORE_BASE64 | base64 --decode > ./app/$KEYSTORE
|
||||||
|
@ -84,9 +131,11 @@ jobs:
|
||||||
|
|
||||||
echo -e "VERSIONCODE=$CIRCLE_BUILD_NUM" >> ./gradle.properties
|
echo -e "VERSIONCODE=$CIRCLE_BUILD_NUM" >> ./gradle.properties
|
||||||
|
|
||||||
echo -e "" > ./app/fabric.properties
|
if [[ $FABRIC_KEY ]]; then
|
||||||
echo -e "apiKey=$FABRIC_KEY" >> ./app/fabric.properties
|
echo -e "" > ./app/fabric.properties
|
||||||
echo -e "apiSecret=$FABRIC_SECRET" >> ./app/fabric.properties
|
echo -e "apiKey=$FABRIC_KEY" >> ./app/fabric.properties
|
||||||
|
echo -e "apiSecret=$FABRIC_SECRET" >> ./app/fabric.properties
|
||||||
|
fi
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Install Android Depedencies
|
name: Install Android Depedencies
|
||||||
|
@ -112,7 +161,7 @@ jobs:
|
||||||
path: /tmp/build/outputs
|
path: /tmp/build/outputs
|
||||||
|
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "package.json" }}
|
key: node-modules-{{ checksum ".circleci/config.yml" }}-{{ checksum "yarn.lock" }}
|
||||||
paths:
|
paths:
|
||||||
- ./node_modules
|
- ./node_modules
|
||||||
|
|
||||||
|
@ -123,7 +172,7 @@ jobs:
|
||||||
|
|
||||||
ios-build:
|
ios-build:
|
||||||
macos:
|
macos:
|
||||||
xcode: "9.0"
|
xcode: "10.1.0"
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
BASH_ENV: "~/.nvm/nvm.sh"
|
BASH_ENV: "~/.nvm/nvm.sh"
|
||||||
|
@ -150,18 +199,15 @@ jobs:
|
||||||
- run:
|
- run:
|
||||||
name: Install NPM modules
|
name: Install NPM modules
|
||||||
command: |
|
command: |
|
||||||
rm -rf node_modules
|
yarn
|
||||||
# npm install --save react-native@0.51
|
|
||||||
npm install
|
|
||||||
# npm install react-native
|
|
||||||
|
|
||||||
- run:
|
# - run:
|
||||||
name: Fix known build error
|
# name: Fix known build error
|
||||||
command: |
|
# command: |
|
||||||
# Fix error https://github.com/facebook/react-native/issues/14382
|
# # Fix error https://github.com/facebook/react-native/issues/14382
|
||||||
cd node_modules/react-native/scripts/
|
# cd node_modules/react-native/scripts/
|
||||||
curl https://raw.githubusercontent.com/facebook/react-native/5c53f89dd86160301feee024bce4ce0c89e8c187/scripts/ios-configure-glog.sh > ios-configure-glog.sh
|
# curl https://raw.githubusercontent.com/facebook/react-native/5c53f89dd86160301feee024bce4ce0c89e8c187/scripts/ios-configure-glog.sh > ios-configure-glog.sh
|
||||||
chmod +x ios-configure-glog.sh
|
# chmod +x ios-configure-glog.sh
|
||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Fastlane Build
|
name: Fastlane Build
|
||||||
|
@ -170,7 +216,10 @@ jobs:
|
||||||
cd ios
|
cd ios
|
||||||
agvtool new-version -all $CIRCLE_BUILD_NUM
|
agvtool new-version -all $CIRCLE_BUILD_NUM
|
||||||
/usr/libexec/PlistBuddy -c "Set Fabric:APIKey $FABRIC_KEY" ./RocketChatRN/Info.plist
|
/usr/libexec/PlistBuddy -c "Set Fabric:APIKey $FABRIC_KEY" ./RocketChatRN/Info.plist
|
||||||
echo -e "./Fabric.framework/run $FABRIC_KEY $FABRIC_SECRET" > ./RocketChatRN/Fabric.sh
|
|
||||||
|
if [[ $FABRIC_KEY ]]; then
|
||||||
|
echo -e > "./Fabric.framework/run $FABRIC_KEY $FABRIC_SECRET" > ./RocketChatRN/Fabric.sh
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $MATCH_KEYCHAIN_NAME ]]; then
|
if [[ $MATCH_KEYCHAIN_NAME ]]; then
|
||||||
fastlane ios release
|
fastlane ios release
|
||||||
|
@ -191,7 +240,7 @@ jobs:
|
||||||
|
|
||||||
ios-testflight:
|
ios-testflight:
|
||||||
macos:
|
macos:
|
||||||
xcode: "9.0"
|
xcode: "10.1.0"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
@ -217,21 +266,20 @@ workflows:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
jobs:
|
jobs:
|
||||||
- lint-testunit
|
- lint-testunit
|
||||||
|
- e2e-test:
|
||||||
|
requires:
|
||||||
|
- lint-testunit
|
||||||
|
|
||||||
- ios-build:
|
- ios-build:
|
||||||
requires:
|
requires:
|
||||||
- lint-testunit
|
- lint-testunit
|
||||||
- ios-testflight:
|
- ios-hold-testflight:
|
||||||
|
type: approval
|
||||||
requires:
|
requires:
|
||||||
- ios-build
|
- ios-build
|
||||||
filters:
|
- ios-testflight:
|
||||||
branches:
|
requires:
|
||||||
only:
|
- ios-hold-testflight
|
||||||
- develop
|
|
||||||
- master
|
|
||||||
# - ios-testflight:
|
|
||||||
# requires:
|
|
||||||
# - ios-hold-testflight
|
|
||||||
|
|
||||||
- android-build:
|
- android-build:
|
||||||
requires:
|
requires:
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
__tests__
|
__tests__
|
||||||
node_modules
|
node_modules
|
||||||
coverage
|
coverage
|
||||||
|
e2e
|
||||||
|
android
|
||||||
|
ios
|
|
@ -13,7 +13,8 @@ module.exports = {
|
||||||
"ecmaVersion": 2017,
|
"ecmaVersion": 2017,
|
||||||
"ecmaFeatures": {
|
"ecmaFeatures": {
|
||||||
"experimentalObjectRestSpread" : true,
|
"experimentalObjectRestSpread" : true,
|
||||||
"jsx": true
|
"jsx": true,
|
||||||
|
"legacyDecorators": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
|
@ -65,6 +66,7 @@ module.exports = {
|
||||||
"no-dupe-args": 2,
|
"no-dupe-args": 2,
|
||||||
"no-dupe-class-members": 2,
|
"no-dupe-class-members": 2,
|
||||||
"no-duplicate-case": 2,
|
"no-duplicate-case": 2,
|
||||||
|
"no-else-return": [0, {allowElseIf: true}],
|
||||||
"no-empty": 2,
|
"no-empty": 2,
|
||||||
"no-empty-character-class": 2,
|
"no-empty-character-class": 2,
|
||||||
"no-ex-assign": 2,
|
"no-ex-assign": 2,
|
||||||
|
@ -125,7 +127,10 @@ module.exports = {
|
||||||
"object-shorthand": 2,
|
"object-shorthand": 2,
|
||||||
"consistent-return": 0,
|
"consistent-return": 0,
|
||||||
"global-require": "off",
|
"global-require": "off",
|
||||||
"react/prop-types": [0, { skipUndeclared: true }]
|
"react-native/no-unused-styles": 2,
|
||||||
|
"react/jsx-one-expression-per-line": 0,
|
||||||
|
"require-await": 2,
|
||||||
|
"func-names": 0
|
||||||
},
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
"__DEV__": true
|
"__DEV__": true
|
||||||
|
|
45
.flowconfig
|
@ -1,45 +0,0 @@
|
||||||
[ignore]
|
|
||||||
; We fork some components by platform
|
|
||||||
.*/*[.]android.js
|
|
||||||
|
|
||||||
; Ignore "BUCK" generated dirs
|
|
||||||
<PROJECT_ROOT>/\.buckd/
|
|
||||||
|
|
||||||
; Ignore unexpected extra "@providesModule"
|
|
||||||
.*/node_modules/.*/node_modules/fbjs/.*
|
|
||||||
|
|
||||||
; Ignore duplicate module providers
|
|
||||||
; For RN Apps installed via npm, "Libraries" folder is inside
|
|
||||||
; "node_modules/react-native" but in the source repo it is in the root
|
|
||||||
.*/Libraries/react-native/React.js
|
|
||||||
.*/Libraries/react-native/ReactNative.js
|
|
||||||
|
|
||||||
[include]
|
|
||||||
|
|
||||||
[libs]
|
|
||||||
node_modules/react-native/Libraries/react-native/react-native-interface.js
|
|
||||||
node_modules/react-native/flow
|
|
||||||
flow/
|
|
||||||
|
|
||||||
[options]
|
|
||||||
emoji=true
|
|
||||||
|
|
||||||
module.system=haste
|
|
||||||
|
|
||||||
munge_underscores=true
|
|
||||||
|
|
||||||
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
|
|
||||||
|
|
||||||
suppress_type=$FlowIssue
|
|
||||||
suppress_type=$FlowFixMe
|
|
||||||
suppress_type=$FixMe
|
|
||||||
|
|
||||||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
|
|
||||||
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
|
|
||||||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
|
|
||||||
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
|
|
||||||
|
|
||||||
unsafe.enable_getters_and_setters=true
|
|
||||||
|
|
||||||
[version]
|
|
||||||
^0.49.1
|
|
|
@ -1,19 +1,6 @@
|
||||||
Before writing an issue, please make sure you're talking about the native application and not the Cordova one. If you are looking to open an issue to the Cordova application, go to this URL: https://github.com/RocketChat/Rocket.Chat.Cordova.
|
- Your Rocket.Chat Experimental app version: ####
|
||||||
|
|
||||||
- Your Rocket.Chat.Android app version: ####
|
|
||||||
<!-- Make sure you are running the latest version (which can be found on the hostname screen or by opening the side menu and then clicking on the chevron alongside username -->
|
|
||||||
|
|
||||||
- Your Rocket.Chat.iOS app version: ####
|
|
||||||
<!-- Make sure you are running the latest version (which can be found on the hostname screen or by opening the side menu and then clicking on the chevron alongside username -->
|
|
||||||
|
|
||||||
- Your Rocket.Chat server version: ####
|
- Your Rocket.Chat server version: ####
|
||||||
|
- Device (or Simulator) you're running with: ####
|
||||||
- Device model (or emulator) you're running with: ####
|
|
||||||
<!-- e.g. For android : Nexus 7 - Android 6.0.1 -->
|
|
||||||
<!-- e.g. For iOS : iPhone 6 - iOS 11.2
|
|
||||||
|
|
||||||
- Steps to reproduce:
|
|
||||||
<!-- Stack traces may help too. -->
|
|
||||||
|
|
||||||
**The app isn't connecting to your server?**
|
**The app isn't connecting to your server?**
|
||||||
Make sure your server supports WebSocket. These are the minimum requirements for Apache 2.4 and Nginx 1.3 or greater.
|
Make sure your server supports WebSocket. These are the minimum requirements for Apache 2.4 and Nginx 1.3 or greater.
|
||||||
|
|
|
@ -28,7 +28,6 @@ build/
|
||||||
.idea
|
.idea
|
||||||
.gradle
|
.gradle
|
||||||
local.properties
|
local.properties
|
||||||
fabric.properties
|
|
||||||
*.iml
|
*.iml
|
||||||
|
|
||||||
# node.js
|
# node.js
|
||||||
|
|
22
.snyk
|
@ -1,5 +1,5 @@
|
||||||
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
|
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
|
||||||
version: v1.7.1
|
version: v1.12.0
|
||||||
ignore: {}
|
ignore: {}
|
||||||
# patches apply the minimum changes required to fix a vulnerability
|
# patches apply the minimum changes required to fix a vulnerability
|
||||||
patch:
|
patch:
|
||||||
|
@ -24,3 +24,23 @@ patch:
|
||||||
patched: '2017-09-29T23:29:20.238Z'
|
patched: '2017-09-29T23:29:20.238Z'
|
||||||
- realm > extract-zip > debug:
|
- realm > extract-zip > debug:
|
||||||
patched: '2017-09-29T23:29:20.238Z'
|
patched: '2017-09-29T23:29:20.238Z'
|
||||||
|
'npm:lodash:20180130':
|
||||||
|
- react-native > plist > xmlbuilder > lodash:
|
||||||
|
patched: '2018-07-02T23:20:39.933Z'
|
||||||
|
'npm:hoek:20180212':
|
||||||
|
- realm > node-pre-gyp > hawk > hoek:
|
||||||
|
patched: '2018-06-22T03:39:40.096Z'
|
||||||
|
- realm > node-pre-gyp > hawk > boom > hoek:
|
||||||
|
patched: '2018-06-22T03:39:40.096Z'
|
||||||
|
- realm > node-pre-gyp > hawk > sntp > hoek:
|
||||||
|
patched: '2018-06-22T03:39:40.096Z'
|
||||||
|
- realm > node-pre-gyp > hawk > cryptiles > boom > hoek:
|
||||||
|
patched: '2018-06-22T03:39:40.096Z'
|
||||||
|
- realm > node-pre-gyp > request > hawk > hoek:
|
||||||
|
patched: '2018-06-22T03:39:40.096Z'
|
||||||
|
- realm > node-pre-gyp > request > hawk > boom > hoek:
|
||||||
|
patched: '2018-06-22T03:39:40.096Z'
|
||||||
|
- realm > node-pre-gyp > request > hawk > sntp > hoek:
|
||||||
|
patched: '2018-06-22T03:39:40.096Z'
|
||||||
|
- realm > node-pre-gyp > request > hawk > cryptiles > boom > hoek:
|
||||||
|
patched: '2018-06-22T03:39:40.096Z'
|
||||||
|
|
48
.travis.yml
|
@ -1,48 +0,0 @@
|
||||||
branches:
|
|
||||||
only:
|
|
||||||
- develop
|
|
||||||
- master
|
|
||||||
- "/^\\d+\\.\\d+\\.\\d+(-rc\\.\\d+)?$/"
|
|
||||||
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- os: linux
|
|
||||||
dist: trusty
|
|
||||||
sudo: false
|
|
||||||
language: android
|
|
||||||
before_install:
|
|
||||||
- openssl aes-256-cbc -K $encrypted_985c748be78d_key -iv $encrypted_985c748be78d_iv -in key.keystore.enc -out android/app/key.keystore -d
|
|
||||||
|
|
||||||
- mkdir -p ~/.gradle
|
|
||||||
- echo -e "ROCKETCHAT_RN_RELEASE_STORE_FILE=$ROCKETCHAT_RN_RELEASE_STORE_FILE" > ~/.gradle/gradle.properties
|
|
||||||
- echo -e "ROCKETCHAT_RN_RELEASE_STORE_PASSWORD=$ROCKETCHAT_RN_RELEASE_STORE_PASSWORD" >> ~/.gradle/gradle.properties
|
|
||||||
- echo -e "ROCKETCHAT_RN_RELEASE_KEY_ALIAS=$ROCKETCHAT_RN_RELEASE_KEY_ALIAS" >> ~/.gradle/gradle.properties
|
|
||||||
- echo -e "ROCKETCHAT_RN_RELEASE_KEY_PASSWORD=$ROCKETCHAT_RN_RELEASE_KEY_PASSWORD" >> ~/.gradle/gradle.properties
|
|
||||||
- nvm install 8
|
|
||||||
- node --version
|
|
||||||
install:
|
|
||||||
- npm install -g codecov
|
|
||||||
- npm install
|
|
||||||
android:
|
|
||||||
components:
|
|
||||||
- tools
|
|
||||||
- build-tools-23.0.1
|
|
||||||
- build-tools-25.0.1
|
|
||||||
- build-tools-26.0.1
|
|
||||||
- android-23
|
|
||||||
- android-25
|
|
||||||
- android-26
|
|
||||||
- extra-android-m2repository
|
|
||||||
- extra-google-google_play_services
|
|
||||||
- extra-google-m2repository
|
|
||||||
- addon-google_apis-google-16
|
|
||||||
script:
|
|
||||||
- npm run ci
|
|
||||||
- cd android && ./gradlew assembleRelease
|
|
||||||
|
|
||||||
- os: osx
|
|
||||||
osx_image: xcode8.3
|
|
||||||
language: node_js
|
|
||||||
node_js: 8
|
|
||||||
script:
|
|
||||||
- npm run ci
|
|
222
README.md
|
@ -1,60 +1,216 @@
|
||||||
# Rocket.Chat React Native Mobile
|
# Rocket.Chat React Native Mobile
|
||||||
|
|
||||||
[![Greenkeeper badge](https://badges.greenkeeper.io/RocketChat/Rocket.Chat.ReactNative.svg)](https://greenkeeper.io/)
|
[![Greenkeeper badge](https://badges.greenkeeper.io/RocketChat/Rocket.Chat.ReactNative.svg)](https://greenkeeper.io/)
|
||||||
|
|
||||||
[![Build Status](https://img.shields.io/travis/RocketChat/Rocket.Chat.ReactNative/master.svg)](https://travis-ci.org/RocketChat/Rocket.Chat.ReactNative)
|
[![Build Status](https://img.shields.io/travis/RocketChat/Rocket.Chat.ReactNative/master.svg)](https://travis-ci.org/RocketChat/Rocket.Chat.ReactNative)
|
||||||
[![Project Dependencies](https://david-dm.org/RocketChat/Rocket.Chat.ReactNative.svg)](https://david-dm.org/RocketChat/Rocket.Chat.ReactNative)
|
[![Project Dependencies](https://david-dm.org/RocketChat/Rocket.Chat.ReactNative.svg)](https://david-dm.org/RocketChat/Rocket.Chat.ReactNative)
|
||||||
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bb15e2392a71473ea59d3f634f35c54e)](https://www.codacy.com/app/RocketChat/Rocket.Chat.ReactNative?utm_source=github.com&utm_medium=referral&utm_content=RocketChat/Rocket.Chat.ReactNative&utm_campaign=badger)
|
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/bb15e2392a71473ea59d3f634f35c54e)](https://www.codacy.com/app/RocketChat/Rocket.Chat.ReactNative?utm_source=github.com&utm_medium=referral&utm_content=RocketChat/Rocket.Chat.ReactNative&utm_campaign=badger)
|
||||||
[![codecov](https://codecov.io/gh/RocketChat/Rocket.Chat.ReactNative/branch/master/graph/badge.svg)](https://codecov.io/gh/RocketChat/Rocket.Chat.ReactNative)
|
[![codecov](https://codecov.io/gh/RocketChat/Rocket.Chat.ReactNative/branch/master/graph/badge.svg)](https://codecov.io/gh/RocketChat/Rocket.Chat.ReactNative)
|
||||||
[![CodeFactor](https://www.codefactor.io/repository/github/rocketchat/rocket.chat.reactnative/badge)](https://www.codefactor.io/repository/github/rocketchat/rocket.chat.reactnative)
|
[![CodeFactor](https://www.codefactor.io/repository/github/rocketchat/rocket.chat.reactnative/badge)](https://www.codefactor.io/repository/github/rocketchat/rocket.chat.reactnative)
|
||||||
[![Known Vulnerabilities](https://snyk.io/test/github/rocketchat/rocket.chat.reactnative/badge.svg)](https://snyk.io/test/github/rocketchat/rocket.chat.reactnative)
|
|
||||||
[![BCH compliance](https://bettercodehub.com/edge/badge/RocketChat/Rocket.Chat.ReactNative?branch=master)](https://bettercodehub.com/)
|
|
||||||
|
|
||||||
**Supported Server Versions:** 0.58.0+ (We are working to support earlier versions)
|
**Supported Server Versions:** 0.66.0+
|
||||||
|
|
||||||
# Installing dependencies
|
## Download
|
||||||
|
<a href="https://play.google.com/store/apps/details?id=chat.rocket.reactnative">
|
||||||
|
<img alt="Download on Google Play" src="https://play.google.com/intl/en_us/badges/images/badge_new.png" height=43>
|
||||||
|
</a>
|
||||||
|
<a href="https://itunes.apple.com/us/app/rocket-chat-experimental/id1272915472">
|
||||||
|
<img alt="Download on App Store" src="https://user-images.githubusercontent.com/7317008/43209852-4ca39622-904b-11e8-8ce1-cdc3aee76ae9.png" height=43>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
## Beta Access
|
||||||
|
|
||||||
|
### TestFlight
|
||||||
|
|
||||||
|
You can signup to our TestFlight builds by acessing this link: https://testflight.apple.com/join/7I3dLCNT.
|
||||||
|
|
||||||
|
### Google Play beta
|
||||||
|
|
||||||
|
You can subscribe to Google Play Beta program and download latest versions: https://play.google.com/store/apps/details?id=chat.rocket.reactnative
|
||||||
|
|
||||||
|
## Reporting an Issue
|
||||||
|
|
||||||
|
[Github Issues](https://github.com/RocketChat/Rocket.Chat.ReactNative/issues) are used to track todos, bugs, feature requests, and more.
|
||||||
|
|
||||||
|
Also check the [#react-native](https://open.rocket.chat/channel/react-native) community on [open.rocket.chat](https://open.rocket.chat). We'd like to help.
|
||||||
|
|
||||||
|
## Installing dependencies
|
||||||
|
|
||||||
Follow the [React Native Getting Started Guide](https://facebook.github.io/react-native/docs/getting-started.html) for detailed instructions on setting up your local machine for development.
|
Follow the [React Native Getting Started Guide](https://facebook.github.io/react-native/docs/getting-started.html) for detailed instructions on setting up your local machine for development.
|
||||||
|
|
||||||
# How to run
|
## How to run
|
||||||
- Clone repository and install dependencies:
|
- Clone repository and install dependencies:
|
||||||
```bash
|
```bash
|
||||||
$ git clone git@github.com:RocketChat/Rocket.Chat.ReactNative.git
|
$ git clone git@github.com:RocketChat/Rocket.Chat.ReactNative.git
|
||||||
$ cd Rocket.Chat.ReactNative
|
$ cd Rocket.Chat.ReactNative
|
||||||
$ npm install -g react-native-cli
|
$ yarn global add react-native-cli
|
||||||
$ yarn
|
$ yarn
|
||||||
```
|
```
|
||||||
- Configuration
|
|
||||||
```bash
|
|
||||||
$ yarn fabric-ios --key="YOUR_API_KEY" --secret="YOUR_API_SECRET"
|
|
||||||
$ yarn fabric-android --key="YOUR_API_KEY" --secret="YOUR_API_SECRET"
|
|
||||||
```
|
|
||||||
|
|
||||||
- Run application
|
- Run application
|
||||||
```bash
|
```bash
|
||||||
$ yarn ios
|
$ react-native run-ios
|
||||||
```
|
```
|
||||||
```bash
|
```bash
|
||||||
$ yarn android
|
$ react-native run-android
|
||||||
```
|
```
|
||||||
|
|
||||||
# Storybook
|
### Running single server
|
||||||
- General requirements
|
If you don't need multiple servers, there is a branch `single-server` just for that.
|
||||||
- Install storybook
|
Readme will guide you on how to config.
|
||||||
```bash
|
|
||||||
$ npm i -g @storybook/cli
|
|
||||||
```
|
|
||||||
|
|
||||||
- Running storybook
|
## Current priorities
|
||||||
- Run storybook application
|
1) [NEW] Jitsi integration ([#711][i711])
|
||||||
```bash
|
2) [NEW] Federation ([#706][i706])
|
||||||
$ npm run storybook
|
3) [NEW] Threads ([#707][i707])
|
||||||
```
|
4) [NEW] Record video ([#712][i712])
|
||||||
- Run application in other shell
|
5) [NEW] Slash Commands ([#405][i405])
|
||||||
```bash
|
6) [NEW] Draft message per room ([#708][i708])
|
||||||
$ react-native run-ios
|
7) [NEW] Share extension ([#391][i391])
|
||||||
```
|
|
||||||
- Running storybook on browser to help stories navigation
|
[i711]: https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/711
|
||||||
```
|
[i706]: https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/706
|
||||||
open http://localhost:7007/
|
[i707]: https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/707
|
||||||
```
|
[i712]: https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/712
|
||||||
|
[i708]: https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/708
|
||||||
|
[i391]: https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/391
|
||||||
|
[i405]: https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/405
|
||||||
|
|
||||||
|
## Features
|
||||||
|
| Feature | Status |
|
||||||
|
|--------------------------------------------------------------- |-------- |
|
||||||
|
| Jitsi Integration | ❌ |
|
||||||
|
| Federation (Directory) | ❌ |
|
||||||
|
| Threads | ❌ |
|
||||||
|
| Record Audio | ✅ |
|
||||||
|
| Record Video | ❌ |
|
||||||
|
| Commands | ❌ |
|
||||||
|
| Draft message per room | ❌ |
|
||||||
|
| Share Extension | ❌ |
|
||||||
|
| Notifications Preferences | ✅ |
|
||||||
|
| Edited status | ✅ |
|
||||||
|
| Upload video | ❌ |
|
||||||
|
| Grouped messages | ✅ |
|
||||||
|
| Mark room as read | ❌ |
|
||||||
|
| Mark room as unread | ❌ |
|
||||||
|
| Tablet Support | ❌ |
|
||||||
|
| Read receipt | ❌ |
|
||||||
|
| Broadbast Channel | ✅ |
|
||||||
|
| Authentication via SAML | ❌ |
|
||||||
|
| Authentication via CAS | ❌ |
|
||||||
|
| Custom Fields on Signup | ❌ |
|
||||||
|
| Report message | ❌ |
|
||||||
|
| Theming | ❌ |
|
||||||
|
| Settings -> Review the App | ❌ |
|
||||||
|
| Settings -> Default Browser | ❌ |
|
||||||
|
| Admin panel | ❌ |
|
||||||
|
| Reply message from notification | ❌ |
|
||||||
|
| Unread counter banner on message list | ✅ |
|
||||||
|
| E2E | ❌ |
|
||||||
|
| Join a Protected Room | ❌ |
|
||||||
|
| Optional Analytics | ❌ |
|
||||||
|
| Settings -> About us | ❌ |
|
||||||
|
| Settings -> Contact us | ❌ |
|
||||||
|
| Settings -> Update App Icon | ❌ |
|
||||||
|
| Settings -> Share | ❌ |
|
||||||
|
| Accessibility (Medium) | ❌ |
|
||||||
|
| Accessibility (Advanced) | ❌ |
|
||||||
|
| Authentication via Meteor | ❌ |
|
||||||
|
| Authentication via Wordpress | ❌ |
|
||||||
|
| Authentication via Custom OAuth | ❌ |
|
||||||
|
| Add user to the room | ✅ |
|
||||||
|
| Send message | ✅ |
|
||||||
|
| Authentication via Email | ✅ |
|
||||||
|
| Authentication via Username | ✅ |
|
||||||
|
| Authentication via LDAP | ✅ |
|
||||||
|
| Message format: Markdown | ✅ |
|
||||||
|
| Message format: System messages (Welcome, Message removed...) | ✅ |
|
||||||
|
| Message format: links | ✅ |
|
||||||
|
| Message format: images | ✅ |
|
||||||
|
| Message format: replies | ✅ |
|
||||||
|
| Message format: alias with custom message (title & text) | ✅ |
|
||||||
|
| Messages list: day separation | ✅ |
|
||||||
|
| Messages list: load more on scroll | ✅ |
|
||||||
|
| Messages list: receive new messages via subscription | ✅ |
|
||||||
|
| Subscriptions list | ✅ |
|
||||||
|
| Segmented subscriptions list: Favorites | ✅ |
|
||||||
|
| Segmented subscriptions list: Unreads | ✅ |
|
||||||
|
| Segmented subscriptions list: DMs | ✅ |
|
||||||
|
| Segmented subscriptions list: Channels | ✅ |
|
||||||
|
| Subscriptions list: update user status via subscription | ✅ |
|
||||||
|
| Numbers os messages unread in the Subscriptions list | ✅ |
|
||||||
|
| Status change | ✅ |
|
||||||
|
| Upload image | ✅ |
|
||||||
|
| Take picture & upload it | ✅ |
|
||||||
|
| 2FA | ✅ |
|
||||||
|
| Signup | ✅ |
|
||||||
|
| Autocomplete with usernames | ✅ |
|
||||||
|
| Autocomplete with @all & @here | ✅ |
|
||||||
|
| Autocomplete room/channel name | ✅ |
|
||||||
|
| Upload audio | ✅ |
|
||||||
|
| Forgot your password | ✅ |
|
||||||
|
| Login screen: terms of service | ✅ |
|
||||||
|
| Login screen: privacy policy | ✅ |
|
||||||
|
| Authentication via Google | ✅ |
|
||||||
|
| Authentication via Facebook | ✅ |
|
||||||
|
| Authentication via Twitter | ✅ |
|
||||||
|
| Authentication via GitHub | ✅ |
|
||||||
|
| Authentication via GitLab | ✅ |
|
||||||
|
| Authentication via LinkedIn | ✅ |
|
||||||
|
| Create channel | ✅ |
|
||||||
|
| Search Local | ✅ |
|
||||||
|
| Search in the API | ✅ |
|
||||||
|
| Settings -> License | ✅ |
|
||||||
|
| Settings -> App version | ✅ |
|
||||||
|
| Autocomplete emoji | ✅ |
|
||||||
|
| Upload file (documents, PDFs, spreadsheets, zip files, etc) | ✅ |
|
||||||
|
| Copy message | ✅ |
|
||||||
|
| Pin message | ✅ |
|
||||||
|
| Unpin message | ✅ |
|
||||||
|
| Channel Info screen -> Members | ✅ |
|
||||||
|
| Channel Info screen -> Pinned | ✅ |
|
||||||
|
| Channel Info screen -> Starred | ✅ |
|
||||||
|
| Channel Info screen -> Uploads | ✅ |
|
||||||
|
| Star message | ✅ |
|
||||||
|
| Unstar message | ✅ |
|
||||||
|
| Channel Info screen -> Topic | ✅ |
|
||||||
|
| Channel Info screen -> Description | ✅ |
|
||||||
|
| Star a channel | ✅ |
|
||||||
|
| Message format: videos | ✅ |
|
||||||
|
| Message format: audios | ✅ |
|
||||||
|
| Edit message | ✅ |
|
||||||
|
| Delete a message | ✅ |
|
||||||
|
| Reply message | ✅ |
|
||||||
|
| Quote message | ✅ |
|
||||||
|
| Muted state | ✅ |
|
||||||
|
| Offline reading | ✅ |
|
||||||
|
| Offline writing | ✅ |
|
||||||
|
| Edit profile | ✅ |
|
||||||
|
| Reactions | ✅ |
|
||||||
|
| Custom emojis | ✅ |
|
||||||
|
| Accessibility (Basic) | ✅ |
|
||||||
|
| Tap notification, go to the channel | ✅ |
|
||||||
|
| Deep links: Authentication | ✅ |
|
||||||
|
| Deep links: Rooms | ✅ |
|
||||||
|
| Full name setting | ✅ |
|
||||||
|
| Read only rooms | ✅ |
|
||||||
|
| Typing status | ✅ |
|
||||||
|
| Create channel/group | ✅ |
|
||||||
|
| Disable registration setting | ✅ |
|
||||||
|
| Unread red line indicator on message list | ✅ |
|
||||||
|
| Search Messages in Channel | ✅ |
|
||||||
|
| Mentions List | ✅ |
|
||||||
|
| Attachment List | ✅ |
|
||||||
|
| Join a Room | ✅ |
|
||||||
|
|
||||||
|
## Detox (end-to-end tests)
|
||||||
|
- Build your app
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ detox build --configuration ios.sim.release
|
||||||
|
```
|
||||||
|
|
||||||
|
- Run tests
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ detox test --configuration ios.sim.release
|
||||||
|
```
|
|
@ -0,0 +1 @@
|
||||||
|
module.exports = 'test-file-stub';
|
|
@ -0,0 +1,5 @@
|
||||||
|
export default {
|
||||||
|
getModel: () => '',
|
||||||
|
getReadableVersion: () => '',
|
||||||
|
getBundleId: () => ''
|
||||||
|
};
|
|
@ -0,0 +1,4 @@
|
||||||
|
export const RectButton = () => 'View';
|
||||||
|
export const State = () => 'View';
|
||||||
|
export const LongPressGestureHandler = () => 'View';
|
||||||
|
export const BorderlessButton = () => 'View';
|
|
@ -0,0 +1,7 @@
|
||||||
|
// @flow
|
||||||
|
/* eslint-disable */
|
||||||
|
import I18nJs from 'i18n-js';
|
||||||
|
|
||||||
|
I18nJs.locale = 'en'; // a locale from your available translations
|
||||||
|
export const getLanguages = (): Promise<string[]> => Promise.resolve(['en']);
|
||||||
|
export default I18nJs;
|
|
@ -1,4 +1,17 @@
|
||||||
export const Navigation = {
|
class Events {
|
||||||
registerComponent: () => {},
|
registerAppLaunchedListener = () => {}
|
||||||
startSingleScreenApp: () => {}
|
}
|
||||||
|
const events = new Events();
|
||||||
|
class NavigationClass {
|
||||||
|
registerComponent = () => {}
|
||||||
|
|
||||||
|
setRoot = () => {}
|
||||||
|
|
||||||
|
events = () => events
|
||||||
|
}
|
||||||
|
|
||||||
|
const Navigation = new NavigationClass();
|
||||||
|
|
||||||
|
export {
|
||||||
|
Navigation
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
export default function() {
|
||||||
|
return {
|
||||||
|
show: () => {}
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
export default {
|
||||||
|
hide: () => ''
|
||||||
|
};
|
|
@ -0,0 +1 @@
|
||||||
|
export default () => 'View';
|
|
@ -0,0 +1 @@
|
||||||
|
export default () => 'View';
|
|
@ -3,7 +3,7 @@ import { Provider } from 'react-redux';
|
||||||
|
|
||||||
import { createStore, combineReducers } from 'redux';
|
import { createStore, combineReducers } from 'redux';
|
||||||
|
|
||||||
const reducers = combineReducers({login:() => ({user: {}}), settings:() => ({})});
|
const reducers = combineReducers({login:() => ({user: {}}), settings:() => ({}), meteor: () => ({ connected: true })});
|
||||||
const store = createStore(reducers);
|
const store = createStore(reducers);
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
@ -12,30 +12,29 @@ import RoomItem from '../app/presentation/RoomItem';
|
||||||
// Note: test renderer must be required after react-native.
|
// Note: test renderer must be required after react-native.
|
||||||
import renderer from 'react-test-renderer';
|
import renderer from 'react-test-renderer';
|
||||||
|
|
||||||
const date = new Date(2017, 10, 10, 10);
|
const date = '2017-10-10T10:00:00Z';
|
||||||
|
const onPress = () => {};
|
||||||
jest.mock('react-native-img-cache', () => { return { CachedImage: 'View' } });
|
|
||||||
|
|
||||||
it('renders correctly', () => {
|
it('renders correctly', () => {
|
||||||
expect(renderer.create(<Provider store={store}><View><RoomItem type="d" _updatedAt={date} name="name" /></View></Provider>).toJSON()).toMatchSnapshot();
|
expect(renderer.create(<Provider store={store}><View><RoomItem onPress={onPress} type="d" _updatedAt={date} name="name" baseUrl="baseUrl" /></View></Provider>).toJSON()).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('render unread', () => {
|
it('render unread', () => {
|
||||||
expect(renderer.create(<Provider store={store}><View><RoomItem type="d" _updatedAt={date} name="name" unread={1} /></View></Provider>).toJSON()).toMatchSnapshot();
|
expect(renderer.create(<Provider store={store}><View><RoomItem onPress={onPress} type="d" _updatedAt={date} name="name" unread={1} /></View></Provider>).toJSON()).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('render unread +999', () => {
|
it('render unread +999', () => {
|
||||||
expect(renderer.create(<Provider store={store}><View><RoomItem type="d" _updatedAt={date} name="name" unread={1000} /></View></Provider>).toJSON()).toMatchSnapshot();
|
expect(renderer.create(<Provider store={store}><View><RoomItem onPress={onPress} type="d" _updatedAt={date} name="name" unread={1000} /></View></Provider>).toJSON()).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('render no icon', () => {
|
it('render no icon', () => {
|
||||||
expect(renderer.create(<Provider store={store}><View><RoomItem type="X" _updatedAt={date} name="name" /></View></Provider>).toJSON()).toMatchSnapshot();
|
expect(renderer.create(<Provider store={store}><View><RoomItem onPress={onPress} type="X" _updatedAt={date} name="name" /></View></Provider>).toJSON()).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('render private group', () => {
|
it('render private group', () => {
|
||||||
expect(renderer.create(<Provider store={store}><View><RoomItem type="g" _updatedAt={date} name="private-group" /> </View></Provider>).toJSON()).toMatchSnapshot();
|
expect(renderer.create(<Provider store={store}><View><RoomItem onPress={onPress} type="g" _updatedAt={date} name="private-group" /> </View></Provider>).toJSON()).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('render channel', () => {
|
it('render channel', () => {
|
||||||
expect(renderer.create(<Provider store={store}><View><RoomItem type="c" _updatedAt={date} name="general" /></View></Provider>).toJSON()).toMatchSnapshot();
|
expect(renderer.create(<Provider store={store}><View><RoomItem onPress={onPress} type="c" _updatedAt={date} name="general" /></View></Provider>).toJSON()).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
|
@ -72,6 +72,11 @@ import com.android.build.OutputFile
|
||||||
* ]
|
* ]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
project.ext.react = [
|
||||||
|
entryFile: "index.js",
|
||||||
|
iconFontNames: [ 'custom.ttf' ]
|
||||||
|
]
|
||||||
|
|
||||||
apply from: "../../node_modules/react-native/react.gradle"
|
apply from: "../../node_modules/react-native/react.gradle"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,19 +95,25 @@ def enableSeparateBuildPerCPUArchitecture = false
|
||||||
def enableProguardInReleaseBuilds = false
|
def enableProguardInReleaseBuilds = false
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 25
|
compileSdkVersion 28
|
||||||
buildToolsVersion "25.0.1"
|
buildToolsVersion "28.0.3"
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "chat.rocket.reactnative"
|
applicationId "chat.rocket.reactnative"
|
||||||
minSdkVersion 16
|
minSdkVersion 21
|
||||||
targetSdkVersion 22
|
targetSdkVersion 28
|
||||||
versionCode VERSIONCODE as Integer
|
versionCode VERSIONCODE as Integer
|
||||||
versionName "1.1"
|
versionName "1.10.0"
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "x86"
|
abiFilters "armeabi-v7a", "x86"
|
||||||
}
|
}
|
||||||
|
vectorDrawables.useSupportLibrary = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
packagingOptions {
|
||||||
|
pickFirst '**/libjsc.so'
|
||||||
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
release {
|
release {
|
||||||
if (project.hasProperty('KEYSTORE')) {
|
if (project.hasProperty('KEYSTORE')) {
|
||||||
|
@ -123,8 +134,11 @@ android {
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
// shrinkResources enableProguardInReleaseBuilds
|
||||||
|
// zipAlignEnabled enableProguardInReleaseBuilds
|
||||||
|
// useProguard enableProguardInReleaseBuilds
|
||||||
minifyEnabled enableProguardInReleaseBuilds
|
minifyEnabled enableProguardInReleaseBuilds
|
||||||
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
setProguardFiles([getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'])
|
||||||
signingConfig signingConfigs.release
|
signingConfig signingConfigs.release
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,27 +178,43 @@ repositories {
|
||||||
maven { url 'https://maven.fabric.io/public' }
|
maven { url 'https://maven.fabric.io/public' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
configurations.all {
|
||||||
|
resolutionStrategy {
|
||||||
|
force 'org.webkit:android-jsc:r225067'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(':react-native-fabric')
|
implementation project(':react-native-orientation-locker')
|
||||||
compile project(':react-native-audio')
|
implementation project(':react-native-splash-screen')
|
||||||
compile project(":reactnativekeyboardinput")
|
implementation project(':react-native-screens')
|
||||||
compile project(':react-native-splash-screen')
|
implementation project(':react-native-action-sheet')
|
||||||
compile project(':react-native-video')
|
implementation project(':react-native-device-info')
|
||||||
compile project(':react-native-push-notification')
|
implementation project(':react-native-gesture-handler')
|
||||||
compile project(':react-native-svg')
|
implementation project(':react-native-image-crop-picker')
|
||||||
compile project(':react-native-image-picker')
|
implementation project(':react-native-i18n')
|
||||||
compile project(':react-native-vector-icons')
|
implementation project(':react-native-fabric')
|
||||||
compile project(':react-native-fetch-blob')
|
implementation project(':react-native-audio')
|
||||||
compile project(':react-native-zeroconf')
|
implementation project(":reactnativekeyboardinput")
|
||||||
compile project(':react-native-toast')
|
implementation project(':react-native-video')
|
||||||
compile project(':realm')
|
implementation project(':react-native-vector-icons')
|
||||||
compile fileTree(dir: "libs", include: ["*.jar"])
|
implementation project(':rn-fetch-blob')
|
||||||
compile "com.android.support:appcompat-v7:23.0.1"
|
implementation project(':@remobile/react-native-toast')
|
||||||
compile 'com.android.support:customtabs:23.0.1'
|
implementation project(':react-native-fast-image')
|
||||||
compile "com.facebook.react:react-native:+" // From node_modules
|
implementation project(':realm')
|
||||||
compile 'com.facebook.fresco:fresco:1.7.1'
|
implementation project(':reactnativenotifications')
|
||||||
compile 'com.facebook.fresco:animated-gif:1.7.1'
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||||
compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
|
implementation "com.android.support:appcompat-v7:27.1.1"
|
||||||
|
implementation "com.android.support:support-v4:27.1.1"
|
||||||
|
implementation 'com.android.support:customtabs:27.1.1'
|
||||||
|
implementation 'com.android.support:design:27.1.1'
|
||||||
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
||||||
|
implementation 'com.facebook.fresco:fresco:1.10.0'
|
||||||
|
implementation 'com.facebook.fresco:animated-gif:1.10.0'
|
||||||
|
implementation 'com.facebook.fresco:animated-webp:1.10.0'
|
||||||
|
implementation 'com.facebook.fresco:webpsupport:1.10.0'
|
||||||
|
implementation 'com.google.android.gms:play-services-gcm:16.1.0'
|
||||||
|
implementation('com.crashlytics.sdk.android:crashlytics:2.9.5@aar') {
|
||||||
transitive = true;
|
transitive = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,4 +225,3 @@ task copyDownloadableDepsToLibs(type: Copy) {
|
||||||
from configurations.compile
|
from configurations.compile
|
||||||
into 'libs'
|
into 'libs'
|
||||||
}
|
}
|
||||||
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
|
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
apiKey=ef3f46fdf18479fd3e1b9b78d0ec73751a255e14
|
||||||
|
apiSecret=e8e3d04c28bc04acd009484da5bb9d1440c4f53851564e9f95c3225ec8b0bc76
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
# Disabling obfuscation is useful if you collect stack traces from production crashes
|
# Disabling obfuscation is useful if you collect stack traces from production crashes
|
||||||
# (unless you are using a system that supports de-obfuscate the stack traces).
|
# (unless you are using a system that supports de-obfuscate the stack traces).
|
||||||
-dontobfuscate
|
# -dontobfuscate
|
||||||
|
|
||||||
# React Native
|
# React Native
|
||||||
|
|
||||||
|
@ -49,6 +49,7 @@
|
||||||
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
|
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
|
||||||
|
|
||||||
-dontwarn com.facebook.react.**
|
-dontwarn com.facebook.react.**
|
||||||
|
-keep,includedescriptorclasses class com.facebook.react.bridge.** { *; }
|
||||||
|
|
||||||
# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
|
# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
|
||||||
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
|
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
|
||||||
|
@ -68,3 +69,30 @@
|
||||||
-dontwarn java.nio.file.*
|
-dontwarn java.nio.file.*
|
||||||
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
|
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
|
||||||
-dontwarn okio.**
|
-dontwarn okio.**
|
||||||
|
|
||||||
|
# Fresco
|
||||||
|
# Keep our interfaces so they can be used by other ProGuard rules.
|
||||||
|
# See http://sourceforge.net/p/proguard/bugs/466/
|
||||||
|
-keep,allowobfuscation @interface com.facebook.soloader.DoNotOptimize
|
||||||
|
|
||||||
|
# Do not strip any method/class that is annotated with @DoNotOptimize
|
||||||
|
-keep @com.facebook.soloader.DoNotOptimize class *
|
||||||
|
-keepclassmembers class * {
|
||||||
|
@com.facebook.soloader.DoNotOptimize *;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Keep native methods
|
||||||
|
-keepclassmembers class * {
|
||||||
|
native <methods>;
|
||||||
|
}
|
||||||
|
|
||||||
|
# For Fabric to properly de-obfuscate your crash reports, you need to remove this line from your ProGuard config:
|
||||||
|
# -printmapping mapping.txt
|
||||||
|
-keepattributes SourceFile,LineNumberTable
|
||||||
|
-keep public class * extends java.lang.Exception
|
||||||
|
-keep class com.crashlytics.** { *; }
|
||||||
|
-dontwarn com.crashlytics.**
|
||||||
|
|
||||||
|
|
||||||
|
-dontwarn javax.annotation.**
|
||||||
|
-dontwarn com.facebook.infer.**
|
||||||
|
|
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 35 KiB |
|
@ -0,0 +1 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="primary_dark">#660B0B0B</color> </resources>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<resources>
|
||||||
|
<string name="app_name">[DEVELOP] RocketChatRN</string>
|
||||||
|
|
||||||
|
<string name="no_browser_found">No Browser Found</string>
|
||||||
|
</resources>
|
|
@ -0,0 +1,9 @@
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<!-- Base application theme. -->
|
||||||
|
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
<item name="android:colorEdgeEffect">#aaaaaa</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</resources>
|
|
@ -1,65 +1,52 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="chat.rocket.reactnative"
|
package="chat.rocket.reactnative">
|
||||||
android:versionCode="1"
|
|
||||||
android:versionName="1.0">
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission-sdk-23 android:name="android.permission.VIBRATE"/>
|
||||||
<uses-permission android:name="android.permission.VIBRATE"/>
|
|
||||||
|
|
||||||
<permission
|
<permission
|
||||||
android:name="${applicationId}.permission.C2D_MESSAGE"
|
android:name="${applicationId}.permission.C2D_MESSAGE"
|
||||||
android:protectionLevel="signature" />
|
android:protectionLevel="signature" />
|
||||||
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
|
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
|
||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="16"
|
android:minSdkVersion="21"
|
||||||
android:targetSdkVersion="22" />
|
android:targetSdkVersion="27" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".MainApplication"
|
android:name=".MainApplication"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme"
|
||||||
<activity
|
android:resizeableActivity="true">
|
||||||
android:name=".MainActivity"
|
<activity
|
||||||
android:label="@string/app_name"
|
android:name=".MainActivity"
|
||||||
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
android:label="@string/app_name"
|
||||||
android:windowSoftInputMode="adjustResize">
|
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
||||||
<intent-filter>
|
android:launchMode="singleTask"
|
||||||
<action android:name="android.intent.action.MAIN" />
|
android:windowSoftInputMode="adjustResize">
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<intent-filter>
|
||||||
</intent-filter>
|
<action android:name="android.intent.action.MAIN" />
|
||||||
</activity>
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
</intent-filter>
|
||||||
|
<intent-filter android:label="@string/app_name">
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
<data android:scheme="https" android:host="go.rocket.chat" />
|
||||||
|
<data android:scheme="rocketchat" android:host="room" />
|
||||||
|
<data android:scheme="rocketchat" android:host="auth" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
||||||
|
|
||||||
|
<meta-data android:name="com.wix.reactnativenotifications.gcmSenderId" android:value="673693445664\0"/>
|
||||||
|
</application>
|
||||||
<receiver
|
|
||||||
android:name="com.google.android.gms.gcm.GcmReceiver"
|
|
||||||
android:exported="true"
|
|
||||||
android:permission="com.google.android.c2dm.permission.SEND" >
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
|
|
||||||
<category android:name="${applicationId}" />
|
|
||||||
</intent-filter>
|
|
||||||
</receiver>
|
|
||||||
|
|
||||||
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
|
|
||||||
<service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationRegistrationService"/>
|
|
||||||
<service
|
|
||||||
android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
|
|
||||||
android:exported="false" >
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
|
|
||||||
</intent-filter>
|
|
||||||
</service>
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
package chat.rocket.reactnative;
|
||||||
|
|
||||||
|
import android.app.Notification;
|
||||||
|
import android.app.NotificationChannel;
|
||||||
|
import android.app.NotificationManager;
|
||||||
|
import android.app.PendingIntent;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.Resources;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.media.AudioManager;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.provider.Settings.System;
|
||||||
|
import android.media.RingtoneManager;
|
||||||
|
|
||||||
|
import com.wix.reactnativenotifications.core.AppLaunchHelper;
|
||||||
|
import com.wix.reactnativenotifications.core.AppLifecycleFacade;
|
||||||
|
import com.wix.reactnativenotifications.core.JsIOHelper;
|
||||||
|
import com.wix.reactnativenotifications.core.notification.PushNotification;
|
||||||
|
|
||||||
|
public class CustomPushNotification extends PushNotification {
|
||||||
|
public CustomPushNotification(Context context, Bundle bundle, AppLifecycleFacade appLifecycleFacade, AppLaunchHelper appLaunchHelper, JsIOHelper jsIoHelper) {
|
||||||
|
super(context, bundle, appLifecycleFacade, appLaunchHelper, jsIoHelper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Notification.Builder getNotificationBuilder(PendingIntent intent) {
|
||||||
|
final Resources res = mContext.getResources();
|
||||||
|
String packageName = mContext.getPackageName();
|
||||||
|
|
||||||
|
Bundle bundle = mNotificationProps.asBundle();
|
||||||
|
int smallIconResId = res.getIdentifier("ic_notification", "mipmap", packageName);
|
||||||
|
int largeIconResId = res.getIdentifier("ic_launcher", "mipmap", packageName);
|
||||||
|
String title = bundle.getString("title");
|
||||||
|
String message = bundle.getString("message");
|
||||||
|
|
||||||
|
String CHANNEL_ID = "rocketchatrn_channel_01";
|
||||||
|
String CHANNEL_NAME = "All";
|
||||||
|
|
||||||
|
final Notification.Builder notification = new Notification.Builder(mContext)
|
||||||
|
.setSmallIcon(smallIconResId)
|
||||||
|
.setContentIntent(intent)
|
||||||
|
.setContentTitle(title)
|
||||||
|
.setContentText(message)
|
||||||
|
.setStyle(new Notification.BigTextStyle().bigText(message))
|
||||||
|
.setPriority(Notification.PRIORITY_HIGH)
|
||||||
|
.setDefaults(Notification.DEFAULT_ALL)
|
||||||
|
.setAutoCancel(true);
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||||
|
notification.setColor(mContext.getColor(R.color.notification_text));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
NotificationChannel channel = new NotificationChannel(CHANNEL_ID,
|
||||||
|
CHANNEL_NAME,
|
||||||
|
NotificationManager.IMPORTANCE_DEFAULT);
|
||||||
|
|
||||||
|
final NotificationManager notificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
|
||||||
|
notificationManager.createNotificationChannel(channel);
|
||||||
|
|
||||||
|
notification.setChannelId(CHANNEL_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
Bitmap largeIconBitmap = BitmapFactory.decodeResource(res, largeIconResId);
|
||||||
|
notification.setLargeIcon(largeIconBitmap);
|
||||||
|
|
||||||
|
return notification;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package chat.rocket.reactnative;
|
||||||
|
|
||||||
|
import com.facebook.react.ReactActivityDelegate;
|
||||||
|
import com.facebook.react.ReactRootView;
|
||||||
|
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import com.facebook.react.ReactFragmentActivity;
|
||||||
|
import org.devio.rn.splashscreen.SplashScreen;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
|
||||||
|
public class MainActivity extends ReactFragmentActivity {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
SplashScreen.show(this);
|
||||||
|
super.onCreate(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the name of the main component registered from JavaScript.
|
||||||
|
* This is used to schedule rendering of the component.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected String getMainComponentName() {
|
||||||
|
return "RocketChatRN";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected ReactActivityDelegate createReactActivityDelegate() {
|
||||||
|
return new ReactActivityDelegate(this, getMainComponentName()) {
|
||||||
|
@Override
|
||||||
|
protected ReactRootView createRootView() {
|
||||||
|
return new RNGestureHandlerEnabledRootView(MainActivity.this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
|
super.onConfigurationChanged(newConfig);
|
||||||
|
Intent intent = new Intent("onConfigurationChanged");
|
||||||
|
intent.putExtra("newConfig", newConfig);
|
||||||
|
this.sendBroadcast(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,105 @@
|
||||||
|
package chat.rocket.reactnative;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
|
||||||
|
import com.facebook.react.ReactApplication;
|
||||||
|
import org.wonday.orientation.OrientationPackage;
|
||||||
|
import org.devio.rn.splashscreen.SplashScreenReactPackage;
|
||||||
|
import com.facebook.react.ReactNativeHost;
|
||||||
|
import com.facebook.react.ReactPackage;
|
||||||
|
import com.facebook.react.shell.MainReactPackage;
|
||||||
|
import com.facebook.soloader.SoLoader;
|
||||||
|
|
||||||
|
import com.AlexanderZaytsev.RNI18n.RNI18nPackage;
|
||||||
|
import com.reactnative.ivpusic.imagepicker.PickerPackage;
|
||||||
|
import com.RNFetchBlob.RNFetchBlobPackage;
|
||||||
|
import com.brentvatne.react.ReactVideoPackage;
|
||||||
|
import com.crashlytics.android.Crashlytics;
|
||||||
|
import com.dylanvann.fastimage.FastImageViewPackage;
|
||||||
|
import com.oblador.vectoricons.VectorIconsPackage;
|
||||||
|
import com.remobile.toast.RCTToastPackage;
|
||||||
|
import com.rnim.rn.audio.ReactNativeAudioPackage;
|
||||||
|
import com.smixx.fabric.FabricPackage;
|
||||||
|
import com.wix.reactnativekeyboardinput.KeyboardInputPackage;
|
||||||
|
import com.wix.reactnativenotifications.RNNotificationsPackage;
|
||||||
|
import com.wix.reactnativenotifications.core.AppLaunchHelper;
|
||||||
|
import com.wix.reactnativenotifications.core.AppLifecycleFacade;
|
||||||
|
import com.wix.reactnativenotifications.core.JsIOHelper;
|
||||||
|
import com.wix.reactnativenotifications.core.notification.INotificationsApplication;
|
||||||
|
import com.wix.reactnativenotifications.core.notification.IPushNotification;
|
||||||
|
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
|
||||||
|
import com.learnium.RNDeviceInfo.RNDeviceInfo;
|
||||||
|
import com.actionsheet.ActionSheetPackage;
|
||||||
|
import io.fabric.sdk.android.Fabric;
|
||||||
|
import io.realm.react.RealmReactPackage;
|
||||||
|
import com.swmansion.rnscreens.RNScreensPackage;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MainApplication extends Application implements ReactApplication, INotificationsApplication {
|
||||||
|
|
||||||
|
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
|
||||||
|
@Override
|
||||||
|
public boolean getUseDeveloperSupport() {
|
||||||
|
return BuildConfig.DEBUG;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<ReactPackage> getPackages() {
|
||||||
|
return Arrays.<ReactPackage>asList(
|
||||||
|
new MainReactPackage(),
|
||||||
|
new OrientationPackage(),
|
||||||
|
new SplashScreenReactPackage(),
|
||||||
|
new RNGestureHandlerPackage(),
|
||||||
|
new RNScreensPackage(),
|
||||||
|
new ActionSheetPackage(),
|
||||||
|
new RNDeviceInfo(),
|
||||||
|
new PickerPackage(),
|
||||||
|
new VectorIconsPackage(),
|
||||||
|
new RNFetchBlobPackage(),
|
||||||
|
new RealmReactPackage(),
|
||||||
|
new ReactVideoPackage(),
|
||||||
|
new RCTToastPackage(),
|
||||||
|
new ReactNativeAudioPackage(),
|
||||||
|
new KeyboardInputPackage(MainApplication.this),
|
||||||
|
new RocketChatNativePackage(),
|
||||||
|
new FabricPackage(),
|
||||||
|
new FastImageViewPackage(),
|
||||||
|
new RNI18nPackage(),
|
||||||
|
new RNNotificationsPackage(MainApplication.this)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getJSMainModuleName() {
|
||||||
|
return "index";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ReactNativeHost getReactNativeHost() {
|
||||||
|
return mReactNativeHost;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
Fabric.with(this, new Crashlytics());
|
||||||
|
SoLoader.init(this, /* native exopackage */ false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPushNotification getPushNotification(Context context, Bundle bundle, AppLifecycleFacade defaultFacade, AppLaunchHelper defaultAppLaunchHelper) {
|
||||||
|
return new CustomPushNotification(
|
||||||
|
context,
|
||||||
|
bundle,
|
||||||
|
defaultFacade,
|
||||||
|
defaultAppLaunchHelper,
|
||||||
|
new JsIOHelper()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,26 +0,0 @@
|
||||||
package chat.rocket.reactnative;
|
|
||||||
|
|
||||||
import android.os.Bundle;
|
|
||||||
import com.facebook.react.ReactActivity;
|
|
||||||
import org.devio.rn.splashscreen.SplashScreen;
|
|
||||||
import com.crashlytics.android.Crashlytics;
|
|
||||||
import io.fabric.sdk.android.Fabric;
|
|
||||||
|
|
||||||
public class MainActivity extends ReactActivity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the name of the main component registered from JavaScript.
|
|
||||||
* This is used to schedule rendering of the component.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
protected String getMainComponentName() {
|
|
||||||
return "RocketChatRN";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
SplashScreen.show(this);
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
Fabric.with(this, new Crashlytics());
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,67 +0,0 @@
|
||||||
package chat.rocket.reactnative;
|
|
||||||
|
|
||||||
import android.app.Application;
|
|
||||||
|
|
||||||
import com.facebook.react.ReactApplication;
|
|
||||||
import com.horcrux.svg.SvgPackage;
|
|
||||||
import com.imagepicker.ImagePickerPackage;
|
|
||||||
import com.oblador.vectoricons.VectorIconsPackage;
|
|
||||||
import com.RNFetchBlob.RNFetchBlobPackage;
|
|
||||||
import com.balthazargronon.RCTZeroconf.ZeroconfReactPackage;
|
|
||||||
import io.realm.react.RealmReactPackage;
|
|
||||||
import com.facebook.react.ReactNativeHost;
|
|
||||||
import com.facebook.react.ReactPackage;
|
|
||||||
import com.facebook.react.shell.MainReactPackage;
|
|
||||||
import com.facebook.soloader.SoLoader;
|
|
||||||
import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
|
|
||||||
import com.brentvatne.react.ReactVideoPackage;
|
|
||||||
import com.remobile.toast.RCTToastPackage;
|
|
||||||
import com.wix.reactnativekeyboardinput.KeyboardInputPackage;
|
|
||||||
import com.rnim.rn.audio.ReactNativeAudioPackage;
|
|
||||||
import com.smixx.fabric.FabricPackage;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import org.devio.rn.splashscreen.SplashScreenReactPackage;
|
|
||||||
|
|
||||||
public class MainApplication extends Application implements ReactApplication {
|
|
||||||
|
|
||||||
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
|
|
||||||
@Override
|
|
||||||
public boolean getUseDeveloperSupport() {
|
|
||||||
return BuildConfig.DEBUG;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected List<ReactPackage> getPackages() {
|
|
||||||
return Arrays.<ReactPackage>asList(
|
|
||||||
new MainReactPackage(),
|
|
||||||
new SvgPackage(),
|
|
||||||
new ImagePickerPackage(),
|
|
||||||
new VectorIconsPackage(),
|
|
||||||
new RNFetchBlobPackage(),
|
|
||||||
new ZeroconfReactPackage(),
|
|
||||||
new RealmReactPackage(),
|
|
||||||
new ReactNativePushNotificationPackage(),
|
|
||||||
new ReactVideoPackage(),
|
|
||||||
new SplashScreenReactPackage(),
|
|
||||||
new RCTToastPackage(),
|
|
||||||
new ReactNativeAudioPackage(),
|
|
||||||
new KeyboardInputPackage(MainApplication.this),
|
|
||||||
new RocketChatNativePackage(),
|
|
||||||
new FabricPackage()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ReactNativeHost getReactNativeHost() {
|
|
||||||
return mReactNativeHost;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate() {
|
|
||||||
super.onCreate();
|
|
||||||
SoLoader.init(this, /* native exopackage */ false);
|
|
||||||
}
|
|
||||||
}
|
|
After Width: | Height: | Size: 508 B |
After Width: | Height: | Size: 132 B |
After Width: | Height: | Size: 187 B |
After Width: | Height: | Size: 638 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 797 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 484 B |
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 134 B |
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 942 B |
Before Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 370 B |
After Width: | Height: | Size: 114 B |
After Width: | Height: | Size: 147 B |
After Width: | Height: | Size: 498 B |
After Width: | Height: | Size: 914 B |
After Width: | Height: | Size: 995 B |
After Width: | Height: | Size: 928 B |
After Width: | Height: | Size: 595 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 774 B |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 6.5 KiB |
After Width: | Height: | Size: 351 B |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 100 B |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 987 B |
After Width: | Height: | Size: 597 B |
After Width: | Height: | Size: 550 B |
After Width: | Height: | Size: 138 B |
After Width: | Height: | Size: 227 B |
After Width: | Height: | Size: 775 B |