Commit e76b6dd0 authored by Guy Carmeli's avatar Guy Carmeli

update example app to RN 0.57

parent a4ff26dc
[ignore] [ignore]
; We fork some components by platform
# We fork some components by platform.
.*/*[.]android.js .*/*[.]android.js
# Ignore templates with `@flow` in header ; Ignore "BUCK" generated dirs
.*/local-cli/generator.*
# Ignore malformed json
.*/node_modules/y18n/test/.*\.json
# Ignore the website subdir
<PROJECT_ROOT>/website/.*
# Ignore BUCK generated dirs
<PROJECT_ROOT>/\.buckd/ <PROJECT_ROOT>/\.buckd/
# Ignore unexpected extra @providesModule ; Ignore unexpected extra "@providesModule"
.*/node_modules/commoner/test/source/widget/share.js .*/node_modules/.*/node_modules/fbjs/.*
# Ignore duplicate module providers ; 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 ; 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/React.js
.*/Libraries/react-native/ReactNative.js
.*/node_modules/jest-runtime/build/__tests__/.* ; Ignore polyfills
.*/Libraries/polyfills/.*
; Ignore metro
.*/node_modules/metro/.*
[include] [include]
[libs] [libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow node_modules/react-native/flow/
flow/ node_modules/react-native/flow-github/
[options] [options]
module.system=haste emoji=true
esproposal.class_static_fields=enable esproposal.optional_chaining=enable
esproposal.class_instance_fields=enable esproposal.nullish_coalescing=enable
experimental.strict_type_args=true module.system=haste
module.system.haste.use_name_reducers=true
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .ios suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
munge_underscores=true munge_underscores=true
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
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' 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'
module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js
suppress_type=$FlowIssue suppress_type=$FlowIssue
suppress_type=$FlowFixMe suppress_type=$FlowFixMe
suppress_type=$FixMe suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-2]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-2]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
unsafe.enable_getters_and_setters=true
[version] [version]
^0.32.0 ^0.78.0
...@@ -22,20 +22,35 @@ DerivedData ...@@ -22,20 +22,35 @@ DerivedData
*.xcuserstate *.xcuserstate
project.xcworkspace project.xcworkspace
# Android/IJ # Android/IntelliJ
# #
*.iml build/
.idea .idea
.gradle .gradle
local.properties local.properties
*.iml
# node.js # node.js
# #
node_modules/ node_modules/
npm-debug.log npm-debug.log
yarn-error.log
# BUCK # BUCK
buck-out/ buck-out/
\.buckd/ \.buckd/
android/app/libs *.keystore
android/keystores/debug.keystore
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
# Bundle artifact
*.jsbundle
...@@ -23,6 +23,17 @@ android { ...@@ -23,6 +23,17 @@ android {
} }
} }
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion "26.1.0"
}
}
}
}
dependencies { dependencies {
// compile fileTree(dir: 'libs', include: ['*.jar']) // compile fileTree(dir: 'libs', include: ['*.jar'])
......
package com.wix.reactnativenotifications.app; package com.wix.reactnativenotifications.app;
import android.annotation.TargetApi;
import android.content.Intent;
import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.provider.Settings;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.Toolbar; import android.widget.Toolbar;
...@@ -16,8 +12,6 @@ import static android.os.Build.VERSION.SDK_INT; ...@@ -16,8 +12,6 @@ import static android.os.Build.VERSION.SDK_INT;
public class MainActivity extends ReactActivity { public class MainActivity extends ReactActivity {
private static final int OVERLAY_PERMISSION_REQ_CODE = 1234;
private ReactRootView mReactRootView; private ReactRootView mReactRootView;
@Override @Override
...@@ -27,7 +21,7 @@ public class MainActivity extends ReactActivity { ...@@ -27,7 +21,7 @@ public class MainActivity extends ReactActivity {
ViewGroup layout; ViewGroup layout;
if (SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
layout = (ViewGroup) getLayoutInflater().inflate(R.layout.activity_main, null); layout = (ViewGroup) getLayoutInflater().inflate(R.layout.activity_main, null);
Toolbar toolbar = (Toolbar) layout.findViewById(R.id.toolbar); Toolbar toolbar = layout.findViewById(R.id.toolbar);
setActionBar(toolbar); setActionBar(toolbar);
} else { } else {
layout = (ViewGroup) getLayoutInflater().inflate(R.layout.activity_main_prelollipop, null); layout = (ViewGroup) getLayoutInflater().inflate(R.layout.activity_main_prelollipop, null);
...@@ -37,24 +31,7 @@ public class MainActivity extends ReactActivity { ...@@ -37,24 +31,7 @@ public class MainActivity extends ReactActivity {
setContentView(layout); setContentView(layout);
if (SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(this)) { startReactApplication();
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + getPackageName()));
startActivityForResult(intent, OVERLAY_PERMISSION_REQ_CODE);
} else {
startReactApplication();
}
}
@TargetApi(Build.VERSION_CODES.M)
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == OVERLAY_PERMISSION_REQ_CODE) {
if (Settings.canDrawOverlays(this)) {
startReactApplication();
} else {
finish();
}
}
} }
private void startReactApplication() { private void startReactApplication() {
......
...@@ -32,7 +32,7 @@ function onNotificationReceived(notification) { ...@@ -32,7 +32,7 @@ function onNotificationReceived(notification) {
} }
// It's highly recommended to keep listeners registration at global scope rather than at screen-scope seeing that // It's highly recommended to keep listeners registration at global scope rather than at screen-scope seeing that
// component mount and unmount lifecycle tend to be asymmetric! // component mount and unmount lifecycle tends to be asymmetric!
NotificationsAndroid.setRegistrationTokenUpdateListener(onPushRegistered); NotificationsAndroid.setRegistrationTokenUpdateListener(onPushRegistered);
NotificationsAndroid.setNotificationOpenedListener(onNotificationOpened); NotificationsAndroid.setNotificationOpenedListener(onNotificationOpened);
NotificationsAndroid.setNotificationReceivedListener(onNotificationReceived); NotificationsAndroid.setNotificationReceivedListener(onNotificationReceived);
......
...@@ -6,14 +6,8 @@ ...@@ -6,14 +6,8 @@
"start": "node node_modules/react-native/local-cli/cli.js start" "start": "node node_modules/react-native/local-cli/cli.js start"
}, },
"dependencies": { "dependencies": {
"babel-preset-react-native-stage-0": "^1.0.1", "react": "16.6.0-alpha.8af6728",
"react": "16.0.0", "react-native": "^0.57.4",
"react-native": "0.51.0", "react-native-notifications": "latest"
"react-native-notifications": "../"
},
"babel": {
"presets": [
"react-native-stage-0"
]
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment