diff --git a/android/build.gradle b/android/build.gradle index 2e6be9d5..546af6d2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -5,10 +5,13 @@ def safeExtGet(prop, fallback) { } android { - compileSdkVersion safeExtGet('compileSdkVersion', 27) + compileSdkVersion safeExtGet('compileSdkVersion', 34) + + namespace 'cn.jiguang.plugins.push' + defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', 16) - targetSdkVersion safeExtGet('targetSdkVersion', 27) + minSdkVersion safeExtGet('minSdkVersion', 23) + targetSdkVersion safeExtGet('targetSdkVersion', 34) versionCode 1 versionName "1.0" @@ -17,5 +20,5 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'com.facebook.react:react-native:0.63.0' + implementation 'com.facebook.react:react-native:+' } diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index a496043a..77bb2294 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + > /\.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 -node_modules/react-native/Libraries/react-native/React.js - -; Ignore polyfills -node_modules/react-native/Libraries/polyfills/.* - -; These should not be required directly -; require from fbjs/lib instead: require('fbjs/lib/warning') -node_modules/warning/.* - -; Flow doesn't support platforms -.*/Libraries/Utilities/HMRLoadingView.js - -[untyped] -.*/node_modules/@react-native-community/cli/.*/.* - -[include] - -[libs] -node_modules/react-native/Libraries/react-native/react-native-interface.js -node_modules/react-native/flow/ - -[options] -emoji=true - -esproposal.optional_chaining=enable -esproposal.nullish_coalescing=enable - -module.file_ext=.js -module.file_ext=.json -module.file_ext=.ios.js - -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.whitelist=/node_modules/react-native/Libraries/.* -module.system.haste.paths.whitelist=/node_modules/react-native/RNTester/.* -module.system.haste.paths.whitelist=/node_modules/react-native/IntegrationTests/.* -module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/react-native/react-native-implementation.js -module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/Animated/src/polyfills/.* - -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=$FlowFixMeProps -suppress_type=$FlowFixMeState - -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+ -suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError - -[lints] -sketchy-null-number=warn -sketchy-null-mixed=warn -sketchy-number=warn -untyped-type-import=warn -nonstrict-import=warn -deprecated-type=warn -unsafe-getters-setters=warn -inexact-spread=warn -unnecessary-invariant=warn -signature-verification-failure=warn -deprecated-utility=error - -[strict] -deprecated-type -nonstrict-import -sketchy-null -unclear-type -unsafe-getters-setters -untyped-import -untyped-type-import - -[version] -^0.98.0 diff --git a/example/.gitattributes b/example/.gitattributes deleted file mode 100644 index d42ff183..00000000 --- a/example/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.pbxproj -text diff --git a/example/.gitignore b/example/.gitignore index 828cc884..d5ae4566 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -20,7 +20,7 @@ DerivedData *.hmap *.ipa *.xcuserstate -project.xcworkspace +**/.xcode.env.local # Android/IntelliJ # @@ -29,6 +29,10 @@ build/ .gradle local.properties *.iml +*.hprof +.cxx/ +*.keystore +!debug.keystore # node.js # @@ -36,11 +40,6 @@ node_modules/ npm-debug.log yarn-error.log -# BUCK -buck-out/ -\.buckd/ -*.keystore - # fastlane # # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the @@ -48,12 +47,28 @@ buck-out/ # For more information about the recommended setup visit: # https://docs.fastlane.tools/best-practices/source-control/ -*/fastlane/report.xml -*/fastlane/Preview.html -*/fastlane/screenshots +**/fastlane/report.xml +**/fastlane/Preview.html +**/fastlane/screenshots +**/fastlane/test_output # Bundle artifact *.jsbundle -# CocoaPods -/ios/Pods/ +# Ruby / CocoaPods +**/Pods/ +/vendor/bundle/ + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* + +# testing +/coverage + +# Yarn +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions diff --git a/example/.prettierrc.js b/example/.prettierrc.js index 5c4de1a4..2b540746 100644 --- a/example/.prettierrc.js +++ b/example/.prettierrc.js @@ -1,6 +1,7 @@ module.exports = { + arrowParens: 'avoid', + bracketSameLine: true, bracketSpacing: false, - jsxBracketSameLine: true, singleQuote: true, trailingComma: 'all', }; diff --git a/example/.watchmanconfig b/example/.watchmanconfig index 9e26dfee..0967ef42 100644 --- a/example/.watchmanconfig +++ b/example/.watchmanconfig @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/example/App.js b/example/App.js deleted file mode 100644 index c36bd842..00000000 --- a/example/App.js +++ /dev/null @@ -1,162 +0,0 @@ -import React from 'react'; -import {StyleSheet, Text, View, TouchableHighlight} from 'react-native'; -import JPush from 'jpush-react-native'; - -const styles = StyleSheet.create({ - container: { - flex: 1, - justifyContent: 'center', - alignItems: 'center', - backgroundColor: '#F5FCFF', - }, - setBtnStyle: { - width: 320, - justifyContent: 'center', - alignItems: 'center', - marginTop: 10, - borderWidth: 1, - borderColor: '#3e83d7', - borderRadius: 8, - backgroundColor: '#3e83d7', - padding: 10 - }, - textStyle: { - textAlign: 'center', - fontSize: 25, - color: '#ffffff' - } -}); - -class Button extends React.Component { - render() { - return - - - {this.props.title} - - - - } -} - -export default class App extends React.Component { - - constructor(props) { - super(props); - } - - componentDidMount() { - JPush.init({"appKey":"4fcc3e237eec4c4fb804ad49","channel":"dev","production":1}); - //连接状态 - this.connectListener = result => { - console.log("connectListener:" + JSON.stringify(result)) - }; - JPush.addConnectEventListener(this.connectListener); - //通知回调 - this.notificationListener = result => { - console.log("notificationListener:" + JSON.stringify(result)) - alert(JSON.stringify(result)) - }; - JPush.addNotificationListener(this.notificationListener); - //本地通知回调 - this.localNotificationListener = result => { - console.log("localNotificationListener:" + JSON.stringify(result)) - }; - JPush.addLocalNotificationListener(this.localNotificationListener); - //自定义消息回调 - this.customMessageListener = result => { - console.log("customMessageListener:" + JSON.stringify(result)) - }; - JPush.addCustomMessageListener(this.customMessageListener); - //应用内消息回调 - JPush.pageEnterTo("HomePage") // 进入首页,当页面退出时请调用 JPush.pageLeave('HomePage') - this.inappMessageListener = result => { - console.log("inappMessageListener:" + JSON.stringify(result)) - alert(JSON.stringify(result)) - }; - JPush.addInappMessageListener(this.inappMessageListener); - //tag alias事件回调 - this.tagAliasListener = result => { - console.log("tagAliasListener:" + JSON.stringify(result)) - }; - JPush.addTagAliasListener(this.tagAliasListener); - //手机号码事件回调 - this.mobileNumberListener = result => { - console.log("mobileNumberListener:" + JSON.stringify(result)) - }; - JPush.addMobileNumberListener(this.mobileNumberListener); - } - - render() { - return ( - -