├── .flowconfig ├── .gitignore ├── .npmignore ├── .npmrc ├── .watchmanconfig ├── Example ├── .buckconfig ├── .flowconfig ├── .gitignore ├── .watchmanconfig ├── __tests__ │ ├── index.android.js │ └── index.ios.js ├── android │ ├── app │ │ ├── BUCK │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── testproject │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── keystores │ │ ├── BUCK │ │ └── debug.keystore.properties │ └── settings.gradle ├── index.android.js ├── index.ios.js ├── ios │ ├── TestProject.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── TestProject.xcscheme │ ├── TestProject │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── TestProjectTests │ │ ├── Info.plist │ │ └── TestProjectTests.m └── package.json ├── LICENSE ├── README-pre.md ├── README.md ├── UmengPush.js ├── android ├── .gitignore ├── android.iml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── index.js └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── liuchungui │ │ └── react_native_umeng_push │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── liuchungui │ │ │ └── react_native_umeng_push │ │ │ ├── UmengPushApplication.java │ │ │ ├── UmengPushModule.java │ │ │ └── UmengPushPackage.java │ └── res │ │ └── values │ │ └── strings.xml │ └── test │ └── java │ └── com │ └── liuchungui │ └── react_native_umeng_push │ └── ExampleUnitTest.java ├── ios ├── RCTUmengPush.xcodeproj │ └── project.pbxproj ├── RCTUmengPush │ ├── RCTUmengPush.h │ └── RCTUmengPush.m └── UMessage_Sdk_1.2.6 │ ├── UMessage.h │ └── libUMessage_Sdk_1.2.6.a └── package.json /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*.web.js 5 | .*/*.android.js 6 | 7 | # Some modules have their own node_modules with overlap 8 | .*/node_modules/node-haste/.* 9 | 10 | # Ugh 11 | .*/node_modules/babel.* 12 | .*/node_modules/babylon.* 13 | .*/node_modules/invariant.* 14 | 15 | # Ignore react and fbjs where there are overlaps, but don't ignore 16 | # anything that react-native relies on 17 | .*/node_modules/fbjs/lib/Map.js 18 | .*/node_modules/fbjs/lib/fetch.js 19 | .*/node_modules/fbjs/lib/ExecutionEnvironment.js 20 | .*/node_modules/fbjs/lib/ErrorUtils.js 21 | 22 | # Flow has a built-in definition for the 'react' module which we prefer to use 23 | # over the currently-untyped source 24 | .*/node_modules/react/react.js 25 | .*/node_modules/react/lib/React.js 26 | .*/node_modules/react/lib/ReactDOM.js 27 | 28 | .*/__mocks__/.* 29 | .*/__tests__/.* 30 | 31 | .*/commoner/test/source/widget/share.js 32 | 33 | # Ignore commoner tests 34 | .*/node_modules/commoner/test/.* 35 | 36 | # See https://github.com/facebook/flow/issues/442 37 | .*/react-tools/node_modules/commoner/lib/reader.js 38 | 39 | # Ignore jest 40 | .*/node_modules/jest-cli/.* 41 | 42 | # Ignore Website 43 | .*/website/.* 44 | 45 | .*/node_modules/is-my-json-valid/test/.*\.json 46 | .*/node_modules/iconv-lite/encodings/tables/.*\.json 47 | .*/node_modules/y18n/test/.*\.json 48 | .*/node_modules/spdx-license-ids/spdx-license-ids.json 49 | .*/node_modules/spdx-exceptions/index.json 50 | .*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json 51 | .*/node_modules/resolve/lib/core.json 52 | .*/node_modules/jsonparse/samplejson/.*\.json 53 | .*/node_modules/json5/test/.*\.json 54 | .*/node_modules/ua-parser-js/test/.*\.json 55 | .*/node_modules/builtin-modules/builtin-modules.json 56 | .*/node_modules/binary-extensions/binary-extensions.json 57 | .*/node_modules/url-regex/tlds.json 58 | .*/node_modules/joi/.*\.json 59 | .*/node_modules/isemail/.*\.json 60 | .*/node_modules/tr46/.*\.json 61 | 62 | [include] 63 | 64 | [libs] 65 | node_modules/react-native/Libraries/react-native/react-native-interface.js 66 | node_modules/react-native/flow 67 | flow/ 68 | 69 | [options] 70 | module.system=haste 71 | 72 | esproposal.class_static_fields=enable 73 | esproposal.class_instance_fields=enable 74 | 75 | munge_underscores=true 76 | 77 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 78 | 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\)$' -> 'RelativeImageStub' 79 | 80 | suppress_type=$FlowIssue 81 | suppress_type=$FlowFixMe 82 | suppress_type=$FixMe 83 | 84 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-2]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 85 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-2]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 86 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 87 | 88 | [version] 89 | 0.22.0 90 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IJ 26 | # 27 | .idea 28 | .gradle 29 | local.properties 30 | 31 | # node.js 32 | # 33 | node_modules/ 34 | npm-debug.log 35 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | Example/ 2 | .git 3 | .gitignore 4 | .idea 5 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchungui/react-native-umeng-push/ff313728175408e02b28aac1dbf8e658e9e2bf2c/.npmrc -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /Example/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | 3 | # We fork some components by platform. 4 | .*/*.android.js 5 | 6 | # Ignore templates with `@flow` in header 7 | .*/local-cli/generator.* 8 | 9 | # Ignore malformed json 10 | .*/node_modules/y18n/test/.*\.json 11 | 12 | # Ignore the website subdir 13 | /website/.* 14 | 15 | # Ignore BUCK generated dirs 16 | /\.buckd/ 17 | 18 | # Ignore unexpected extra @providesModule 19 | .*/node_modules/commoner/test/source/widget/share.js 20 | 21 | # Ignore duplicate module providers 22 | # For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root 23 | .*/Libraries/react-native/React.js 24 | .*/Libraries/react-native/ReactNative.js 25 | .*/node_modules/jest-runtime/build/__tests__/.* 26 | 27 | [include] 28 | 29 | [libs] 30 | node_modules/react-native/Libraries/react-native/react-native-interface.js 31 | node_modules/react-native/flow 32 | flow/ 33 | 34 | [options] 35 | module.system=haste 36 | 37 | esproposal.class_static_fields=enable 38 | esproposal.class_instance_fields=enable 39 | 40 | experimental.strict_type_args=true 41 | 42 | munge_underscores=true 43 | 44 | module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' 45 | 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' 46 | 47 | suppress_type=$FlowIssue 48 | suppress_type=$FlowFixMe 49 | suppress_type=$FixMe 50 | 51 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(30\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 52 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(30\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 53 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 54 | 55 | unsafe.enable_getters_and_setters=true 56 | 57 | [version] 58 | ^0.30.0 59 | -------------------------------------------------------------------------------- /Example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IJ 26 | # 27 | *.iml 28 | .idea 29 | .gradle 30 | local.properties 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | 37 | # BUCK 38 | buck-out/ 39 | \.buckd/ 40 | android/app/libs 41 | android/keystores/debug.keystore 42 | -------------------------------------------------------------------------------- /Example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Example/__tests__/index.android.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.android.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /Example/__tests__/index.ios.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.ios.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /Example/android/app/BUCK: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | # To learn about Buck see [Docs](https://buckbuild.com/). 4 | # To run your application with Buck: 5 | # - install Buck 6 | # - `npm start` - to start the packager 7 | # - `cd android` 8 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 9 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 10 | # - `buck install -r android/app` - compile, install and run application 11 | # 12 | 13 | lib_deps = [] 14 | for jarfile in glob(['libs/*.jar']): 15 | name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile) 16 | lib_deps.append(':' + name) 17 | prebuilt_jar( 18 | name = name, 19 | binary_jar = jarfile, 20 | ) 21 | 22 | for aarfile in glob(['libs/*.aar']): 23 | name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile) 24 | lib_deps.append(':' + name) 25 | android_prebuilt_aar( 26 | name = name, 27 | aar = aarfile, 28 | ) 29 | 30 | android_library( 31 | name = 'all-libs', 32 | exported_deps = lib_deps 33 | ) 34 | 35 | android_library( 36 | name = 'app-code', 37 | srcs = glob([ 38 | 'src/main/java/**/*.java', 39 | ]), 40 | deps = [ 41 | ':all-libs', 42 | ':build_config', 43 | ':res', 44 | ], 45 | ) 46 | 47 | android_build_config( 48 | name = 'build_config', 49 | package = 'com.testproject', 50 | ) 51 | 52 | android_resource( 53 | name = 'res', 54 | res = 'src/main/res', 55 | package = 'com.testproject', 56 | ) 57 | 58 | android_binary( 59 | name = 'app', 60 | package_type = 'debug', 61 | manifest = 'src/main/AndroidManifest.xml', 62 | keystore = '//android/keystores:debug', 63 | deps = [ 64 | ':app-code', 65 | ], 66 | ) 67 | -------------------------------------------------------------------------------- /Example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // the root of your project, i.e. where "package.json" lives 37 | * root: "../../", 38 | * 39 | * // where to put the JS bundle asset in debug mode 40 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 41 | * 42 | * // where to put the JS bundle asset in release mode 43 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 44 | * 45 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 46 | * // require('./image.png')), in debug mode 47 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 48 | * 49 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 50 | * // require('./image.png')), in release mode 51 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 52 | * 53 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 54 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 55 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 56 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 57 | * // for example, you might want to remove it from here. 58 | * inputExcludes: ["android/**", "ios/**"], 59 | * 60 | * // override which node gets called and with what additional arguments 61 | * nodeExecutableAndArgs: ["node"] 62 | * 63 | * // supply additional arguments to the packager 64 | * extraPackagerArgs: [] 65 | * ] 66 | */ 67 | 68 | apply from: "../../node_modules/react-native/react.gradle" 69 | 70 | /** 71 | * Set this to true to create two separate APKs instead of one: 72 | * - An APK that only works on ARM devices 73 | * - An APK that only works on x86 devices 74 | * The advantage is the size of the APK is reduced by about 4MB. 75 | * Upload all the APKs to the Play Store and people will download 76 | * the correct one based on the CPU architecture of their device. 77 | */ 78 | def enableSeparateBuildPerCPUArchitecture = false 79 | 80 | /** 81 | * Run Proguard to shrink the Java bytecode in release builds. 82 | */ 83 | def enableProguardInReleaseBuilds = false 84 | 85 | android { 86 | compileSdkVersion 23 87 | buildToolsVersion "23.0.1" 88 | 89 | defaultConfig { 90 | applicationId "com.testproject" 91 | minSdkVersion 16 92 | targetSdkVersion 22 93 | versionCode 1 94 | versionName "1.0" 95 | ndk { 96 | abiFilters "armeabi-v7a", "x86" 97 | } 98 | } 99 | splits { 100 | abi { 101 | reset() 102 | enable enableSeparateBuildPerCPUArchitecture 103 | universalApk false // If true, also generate a universal APK 104 | include "armeabi-v7a", "x86" 105 | } 106 | } 107 | buildTypes { 108 | release { 109 | minifyEnabled enableProguardInReleaseBuilds 110 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 111 | } 112 | } 113 | // applicationVariants are e.g. debug, release 114 | applicationVariants.all { variant -> 115 | variant.outputs.each { output -> 116 | // For each separate APK per architecture, set a unique version code as described here: 117 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 118 | def versionCodes = ["armeabi-v7a":1, "x86":2] 119 | def abi = output.getFilter(OutputFile.ABI) 120 | if (abi != null) { // null for the universal-debug, universal-release variants 121 | output.versionCodeOverride = 122 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 123 | } 124 | } 125 | } 126 | } 127 | 128 | dependencies { 129 | compile project(':react-native-umeng-push') 130 | compile fileTree(dir: "libs", include: ["*.jar"]) 131 | compile "com.android.support:appcompat-v7:23.0.1" 132 | compile "com.facebook.react:react-native:+" // From node_modules 133 | } 134 | 135 | // Run this once to be able to run the application with BUCK 136 | // puts all compile dependencies into folder libs for BUCK to use 137 | task copyDownloadableDepsToLibs(type: Copy) { 138 | from configurations.compile 139 | into 'libs' 140 | } 141 | -------------------------------------------------------------------------------- /Example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # okhttp 54 | 55 | -keepattributes Signature 56 | -keepattributes *Annotation* 57 | -keep class okhttp3.** { *; } 58 | -keep interface okhttp3.** { *; } 59 | -dontwarn okhttp3.** 60 | 61 | # okio 62 | 63 | -keep class sun.misc.Unsafe { *; } 64 | -dontwarn java.nio.file.* 65 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 66 | -dontwarn okio.** 67 | -------------------------------------------------------------------------------- /Example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/android/app/src/main/java/com/testproject/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.testproject; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.liuchungui.react_native_umeng_push.UmengPushPackage; 5 | 6 | public class MainActivity extends ReactActivity { 7 | 8 | /** 9 | * Returns the name of the main component registered from JavaScript. 10 | * This is used to schedule rendering of the component. 11 | */ 12 | @Override 13 | protected String getMainComponentName() { 14 | return "testProject"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Example/android/app/src/main/java/com/testproject/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.testproject; 2 | 3 | import android.app.Application; 4 | import android.util.Log; 5 | 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.shell.MainReactPackage; 11 | import com.facebook.soloader.SoLoader; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | import com.liuchungui.react_native_umeng_push.UmengPushApplication; 17 | import com.liuchungui.react_native_umeng_push.UmengPushPackage; 18 | 19 | public class MainApplication extends UmengPushApplication implements ReactApplication { 20 | 21 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 22 | @Override 23 | protected boolean getUseDeveloperSupport() { 24 | return BuildConfig.DEBUG; 25 | } 26 | 27 | @Override 28 | protected List getPackages() { 29 | return Arrays.asList( 30 | new MainReactPackage(), 31 | new UmengPushPackage() 32 | ); 33 | } 34 | }; 35 | 36 | @Override 37 | public ReactNativeHost getReactNativeHost() { 38 | return mReactNativeHost; 39 | } 40 | 41 | @Override 42 | public void onCreate() { 43 | super.onCreate(); 44 | SoLoader.init(this, /* native exopackage */ false); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchungui/react-native-umeng-push/ff313728175408e02b28aac1dbf8e658e9e2bf2c/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchungui/react-native-umeng-push/ff313728175408e02b28aac1dbf8e658e9e2bf2c/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchungui/react-native-umeng-push/ff313728175408e02b28aac1dbf8e658e9e2bf2c/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchungui/react-native-umeng-push/ff313728175408e02b28aac1dbf8e658e9e2bf2c/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /Example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | testProject 4 | 5 | -------------------------------------------------------------------------------- /Example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.1' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | maven { 20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 21 | url "$rootDir/../node_modules/react-native/android" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /Example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchungui/react-native-umeng-push/ff313728175408e02b28aac1dbf8e658e9e2bf2c/Example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 6 | -------------------------------------------------------------------------------- /Example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /Example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /Example/android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = 'debug', 3 | store = 'debug.keystore', 4 | properties = 'debug.keystore.properties', 5 | visibility = [ 6 | 'PUBLIC', 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /Example/android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /Example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'testProject' 2 | 3 | include ':PushSDK' 4 | project(':PushSDK').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-umeng-sdk/android/PushSDK') 5 | 6 | include ':app' 7 | include ':react-native-umeng-push' 8 | project(':react-native-umeng-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-umeng-push/android') 9 | -------------------------------------------------------------------------------- /Example/index.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View 13 | } from 'react-native'; 14 | 15 | import UmengPush from 'react-native-umeng-push'; 16 | 17 | //获取DeviceToken 18 | UmengPush.getDeviceToken(deviceToken => { 19 | console.log("deviceToken: ", deviceToken); 20 | }); 21 | 22 | //接收到推送消息回调 23 | UmengPush.didReceiveMessage(message => { 24 | console.log("didReceiveMessage:", message); 25 | }); 26 | 27 | //点击推送消息打开应用回调 28 | UmengPush.didOpenMessage(message => { 29 | console.log("didOpenMessage:", message); 30 | }); 31 | 32 | export default class testProject extends Component { 33 | render() { 34 | return ( 35 | 36 | 37 | Welcome to React Native! 38 | 39 | 40 | To get started, edit index.android.js 41 | 42 | 43 | Double tap R on your keyboard to reload,{'\n'} 44 | Shake or press menu button for dev menu 45 | 46 | 47 | ); 48 | } 49 | } 50 | 51 | const styles = StyleSheet.create({ 52 | container: { 53 | flex: 1, 54 | justifyContent: 'center', 55 | alignItems: 'center', 56 | backgroundColor: '#F5FCFF', 57 | }, 58 | welcome: { 59 | fontSize: 20, 60 | textAlign: 'center', 61 | margin: 10, 62 | }, 63 | instructions: { 64 | textAlign: 'center', 65 | color: '#333333', 66 | marginBottom: 5, 67 | }, 68 | }); 69 | 70 | AppRegistry.registerComponent('testProject', () => testProject); 71 | -------------------------------------------------------------------------------- /Example/index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View 13 | } from 'react-native'; 14 | 15 | export default class testProject extends Component { 16 | render() { 17 | return ( 18 | 19 | 20 | Welcome to React Native! 21 | 22 | 23 | To get started, edit index.ios.js 24 | 25 | 26 | Press Cmd+R to reload,{'\n'} 27 | Cmd+D or shake for dev menu 28 | 29 | 30 | ); 31 | } 32 | } 33 | 34 | const styles = StyleSheet.create({ 35 | container: { 36 | flex: 1, 37 | justifyContent: 'center', 38 | alignItems: 'center', 39 | backgroundColor: '#F5FCFF', 40 | }, 41 | welcome: { 42 | fontSize: 20, 43 | textAlign: 'center', 44 | margin: 10, 45 | }, 46 | instructions: { 47 | textAlign: 'center', 48 | color: '#333333', 49 | marginBottom: 5, 50 | }, 51 | }); 52 | 53 | AppRegistry.registerComponent('testProject', () => testProject); 54 | -------------------------------------------------------------------------------- /Example/ios/TestProject.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | /* Begin PBXBuildFile section */ 9 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 10 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 11 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 12 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 13 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 14 | 00E356F31AD99517003FC87E /* testProjectTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* testProjectTests.m */; }; 15 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 16 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 17 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 18 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 19 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 20 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 21 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 22 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 23 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 24 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */; }; 25 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 26 | A49A53610B03474388F21B39 /* libRCTUmengPush.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 92159F29DED247489AE820AD /* libRCTUmengPush.a */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 33 | proxyType = 2; 34 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 35 | remoteInfo = RCTActionSheet; 36 | }; 37 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 40 | proxyType = 2; 41 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 42 | remoteInfo = RCTGeolocation; 43 | }; 44 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 47 | proxyType = 2; 48 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 49 | remoteInfo = RCTImage; 50 | }; 51 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 52 | isa = PBXContainerItemProxy; 53 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 54 | proxyType = 2; 55 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 56 | remoteInfo = RCTNetwork; 57 | }; 58 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 59 | isa = PBXContainerItemProxy; 60 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 61 | proxyType = 2; 62 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 63 | remoteInfo = RCTVibration; 64 | }; 65 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 66 | isa = PBXContainerItemProxy; 67 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 68 | proxyType = 1; 69 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 70 | remoteInfo = testProject; 71 | }; 72 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 73 | isa = PBXContainerItemProxy; 74 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 75 | proxyType = 2; 76 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 77 | remoteInfo = RCTSettings; 78 | }; 79 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 80 | isa = PBXContainerItemProxy; 81 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 82 | proxyType = 2; 83 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 84 | remoteInfo = RCTWebSocket; 85 | }; 86 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 87 | isa = PBXContainerItemProxy; 88 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 89 | proxyType = 2; 90 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 91 | remoteInfo = React; 92 | }; 93 | 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 94 | isa = PBXContainerItemProxy; 95 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 96 | proxyType = 2; 97 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 98 | remoteInfo = RCTAnimation; 99 | }; 100 | 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */ = { 101 | isa = PBXContainerItemProxy; 102 | containerPortal = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 103 | proxyType = 2; 104 | remoteGlobalIDString = 2D2A28201D9B03D100D4039D; 105 | remoteInfo = "RCTAnimation-tvOS"; 106 | }; 107 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 108 | isa = PBXContainerItemProxy; 109 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 110 | proxyType = 2; 111 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 112 | remoteInfo = RCTLinking; 113 | }; 114 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 115 | isa = PBXContainerItemProxy; 116 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 117 | proxyType = 2; 118 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 119 | remoteInfo = RCTText; 120 | }; 121 | /* End PBXContainerItemProxy section */ 122 | 123 | /* Begin PBXFileReference section */ 124 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 125 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 126 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 127 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 128 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 129 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 130 | 00E356EE1AD99517003FC87E /* testProjectTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = testProjectTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 131 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 132 | 00E356F21AD99517003FC87E /* testProjectTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = testProjectTests.m; sourceTree = ""; }; 133 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 134 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 135 | 13B07F961A680F5B00A75B9A /* testProject.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testProject.app; sourceTree = BUILT_PRODUCTS_DIR; }; 136 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = testProject/AppDelegate.h; sourceTree = ""; }; 137 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = testProject/AppDelegate.m; sourceTree = ""; }; 138 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 139 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = testProject/Images.xcassets; sourceTree = ""; }; 140 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = testProject/Info.plist; sourceTree = ""; }; 141 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = testProject/main.m; sourceTree = ""; }; 142 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 143 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = ""; }; 144 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 145 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 146 | 7FC69F48525C47509EC76B77 /* RCTUmengPush.xcodeproj */ = {isa = PBXFileReference; name = "RCTUmengPush.xcodeproj"; path = "../node_modules/react-native-umeng-push/ios/RCTUmengPush.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; 147 | 92159F29DED247489AE820AD /* libRCTUmengPush.a */ = {isa = PBXFileReference; name = "libRCTUmengPush.a"; path = "libRCTUmengPush.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; 148 | /* End PBXFileReference section */ 149 | 150 | /* Begin PBXFrameworksBuildPhase section */ 151 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 152 | isa = PBXFrameworksBuildPhase; 153 | buildActionMask = 2147483647; 154 | files = ( 155 | 140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */, 156 | ); 157 | runOnlyForDeploymentPostprocessing = 0; 158 | }; 159 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 160 | isa = PBXFrameworksBuildPhase; 161 | buildActionMask = 2147483647; 162 | files = ( 163 | 5E9157361DD0AC6A00FF2AA8 /* libRCTAnimation.a in Frameworks */, 164 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 165 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 166 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 167 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 168 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 169 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 170 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 171 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 172 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 173 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 174 | A49A53610B03474388F21B39 /* libRCTUmengPush.a in Frameworks */, 175 | ); 176 | runOnlyForDeploymentPostprocessing = 0; 177 | }; 178 | /* End PBXFrameworksBuildPhase section */ 179 | 180 | /* Begin PBXGroup section */ 181 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 185 | ); 186 | name = Products; 187 | sourceTree = ""; 188 | }; 189 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 190 | isa = PBXGroup; 191 | children = ( 192 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 193 | ); 194 | name = Products; 195 | sourceTree = ""; 196 | }; 197 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 198 | isa = PBXGroup; 199 | children = ( 200 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 201 | ); 202 | name = Products; 203 | sourceTree = ""; 204 | }; 205 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 206 | isa = PBXGroup; 207 | children = ( 208 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 209 | ); 210 | name = Products; 211 | sourceTree = ""; 212 | }; 213 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 214 | isa = PBXGroup; 215 | children = ( 216 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 217 | ); 218 | name = Products; 219 | sourceTree = ""; 220 | }; 221 | 00E356EF1AD99517003FC87E /* testProjectTests */ = { 222 | isa = PBXGroup; 223 | children = ( 224 | 00E356F21AD99517003FC87E /* testProjectTests.m */, 225 | 00E356F01AD99517003FC87E /* Supporting Files */, 226 | ); 227 | path = testProjectTests; 228 | sourceTree = ""; 229 | }; 230 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 231 | isa = PBXGroup; 232 | children = ( 233 | 00E356F11AD99517003FC87E /* Info.plist */, 234 | ); 235 | name = "Supporting Files"; 236 | sourceTree = ""; 237 | }; 238 | 139105B71AF99BAD00B5F7CC /* Products */ = { 239 | isa = PBXGroup; 240 | children = ( 241 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 242 | ); 243 | name = Products; 244 | sourceTree = ""; 245 | }; 246 | 139FDEE71B06529A00C62182 /* Products */ = { 247 | isa = PBXGroup; 248 | children = ( 249 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 250 | ); 251 | name = Products; 252 | sourceTree = ""; 253 | }; 254 | 13B07FAE1A68108700A75B9A /* testProject */ = { 255 | isa = PBXGroup; 256 | children = ( 257 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 258 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 259 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 260 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 261 | 13B07FB61A68108700A75B9A /* Info.plist */, 262 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 263 | 13B07FB71A68108700A75B9A /* main.m */, 264 | ); 265 | name = testProject; 266 | sourceTree = ""; 267 | }; 268 | 146834001AC3E56700842450 /* Products */ = { 269 | isa = PBXGroup; 270 | children = ( 271 | 146834041AC3E56700842450 /* libReact.a */, 272 | ); 273 | name = Products; 274 | sourceTree = ""; 275 | }; 276 | 5E91572E1DD0AC6500FF2AA8 /* Products */ = { 277 | isa = PBXGroup; 278 | children = ( 279 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */, 280 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */, 281 | ); 282 | name = Products; 283 | sourceTree = ""; 284 | }; 285 | 78C398B11ACF4ADC00677621 /* Products */ = { 286 | isa = PBXGroup; 287 | children = ( 288 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 289 | ); 290 | name = Products; 291 | sourceTree = ""; 292 | }; 293 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 294 | isa = PBXGroup; 295 | children = ( 296 | 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */, 297 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 298 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 299 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 300 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 301 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 302 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 303 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 304 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 305 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 306 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 307 | 7FC69F48525C47509EC76B77 /* RCTUmengPush.xcodeproj */, 308 | ); 309 | name = Libraries; 310 | sourceTree = ""; 311 | }; 312 | 832341B11AAA6A8300B99B32 /* Products */ = { 313 | isa = PBXGroup; 314 | children = ( 315 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 316 | ); 317 | name = Products; 318 | sourceTree = ""; 319 | }; 320 | 83CBB9F61A601CBA00E9B192 = { 321 | isa = PBXGroup; 322 | children = ( 323 | 13B07FAE1A68108700A75B9A /* testProject */, 324 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 325 | 00E356EF1AD99517003FC87E /* testProjectTests */, 326 | 83CBBA001A601CBA00E9B192 /* Products */, 327 | ); 328 | indentWidth = 2; 329 | sourceTree = ""; 330 | tabWidth = 2; 331 | }; 332 | 83CBBA001A601CBA00E9B192 /* Products */ = { 333 | isa = PBXGroup; 334 | children = ( 335 | 13B07F961A680F5B00A75B9A /* testProject.app */, 336 | 00E356EE1AD99517003FC87E /* testProjectTests.xctest */, 337 | ); 338 | name = Products; 339 | sourceTree = ""; 340 | }; 341 | /* End PBXGroup section */ 342 | 343 | /* Begin PBXNativeTarget section */ 344 | 00E356ED1AD99517003FC87E /* testProjectTests */ = { 345 | isa = PBXNativeTarget; 346 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "testProjectTests" */; 347 | buildPhases = ( 348 | 00E356EA1AD99517003FC87E /* Sources */, 349 | 00E356EB1AD99517003FC87E /* Frameworks */, 350 | 00E356EC1AD99517003FC87E /* Resources */, 351 | ); 352 | buildRules = ( 353 | ); 354 | dependencies = ( 355 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 356 | ); 357 | name = testProjectTests; 358 | productName = testProjectTests; 359 | productReference = 00E356EE1AD99517003FC87E /* testProjectTests.xctest */; 360 | productType = "com.apple.product-type.bundle.unit-test"; 361 | }; 362 | 13B07F861A680F5B00A75B9A /* testProject */ = { 363 | isa = PBXNativeTarget; 364 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "testProject" */; 365 | buildPhases = ( 366 | 13B07F871A680F5B00A75B9A /* Sources */, 367 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 368 | 13B07F8E1A680F5B00A75B9A /* Resources */, 369 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 370 | ); 371 | buildRules = ( 372 | ); 373 | dependencies = ( 374 | ); 375 | name = testProject; 376 | productName = "Hello World"; 377 | productReference = 13B07F961A680F5B00A75B9A /* testProject.app */; 378 | productType = "com.apple.product-type.application"; 379 | }; 380 | /* End PBXNativeTarget section */ 381 | 382 | /* Begin PBXProject section */ 383 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 384 | isa = PBXProject; 385 | attributes = { 386 | LastUpgradeCheck = 610; 387 | ORGANIZATIONNAME = Facebook; 388 | TargetAttributes = { 389 | 00E356ED1AD99517003FC87E = { 390 | CreatedOnToolsVersion = 6.2; 391 | TestTargetID = 13B07F861A680F5B00A75B9A; 392 | }; 393 | }; 394 | }; 395 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "testProject" */; 396 | compatibilityVersion = "Xcode 3.2"; 397 | developmentRegion = English; 398 | hasScannedForEncodings = 0; 399 | knownRegions = ( 400 | en, 401 | Base, 402 | ); 403 | mainGroup = 83CBB9F61A601CBA00E9B192; 404 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 405 | projectDirPath = ""; 406 | projectReferences = ( 407 | { 408 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 409 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 410 | }, 411 | { 412 | ProductGroup = 5E91572E1DD0AC6500FF2AA8 /* Products */; 413 | ProjectRef = 5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */; 414 | }, 415 | { 416 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 417 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 418 | }, 419 | { 420 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 421 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 422 | }, 423 | { 424 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 425 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 426 | }, 427 | { 428 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 429 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 430 | }, 431 | { 432 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 433 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 434 | }, 435 | { 436 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 437 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 438 | }, 439 | { 440 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 441 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 442 | }, 443 | { 444 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 445 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 446 | }, 447 | { 448 | ProductGroup = 146834001AC3E56700842450 /* Products */; 449 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 450 | }, 451 | ); 452 | projectRoot = ""; 453 | targets = ( 454 | 13B07F861A680F5B00A75B9A /* testProject */, 455 | 00E356ED1AD99517003FC87E /* testProjectTests */, 456 | ); 457 | }; 458 | /* End PBXProject section */ 459 | 460 | /* Begin PBXReferenceProxy section */ 461 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 462 | isa = PBXReferenceProxy; 463 | fileType = archive.ar; 464 | path = libRCTActionSheet.a; 465 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 466 | sourceTree = BUILT_PRODUCTS_DIR; 467 | }; 468 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 469 | isa = PBXReferenceProxy; 470 | fileType = archive.ar; 471 | path = libRCTGeolocation.a; 472 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 473 | sourceTree = BUILT_PRODUCTS_DIR; 474 | }; 475 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 476 | isa = PBXReferenceProxy; 477 | fileType = archive.ar; 478 | path = libRCTImage.a; 479 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 480 | sourceTree = BUILT_PRODUCTS_DIR; 481 | }; 482 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 483 | isa = PBXReferenceProxy; 484 | fileType = archive.ar; 485 | path = libRCTNetwork.a; 486 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 487 | sourceTree = BUILT_PRODUCTS_DIR; 488 | }; 489 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 490 | isa = PBXReferenceProxy; 491 | fileType = archive.ar; 492 | path = libRCTVibration.a; 493 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 494 | sourceTree = BUILT_PRODUCTS_DIR; 495 | }; 496 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 497 | isa = PBXReferenceProxy; 498 | fileType = archive.ar; 499 | path = libRCTSettings.a; 500 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 501 | sourceTree = BUILT_PRODUCTS_DIR; 502 | }; 503 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 504 | isa = PBXReferenceProxy; 505 | fileType = archive.ar; 506 | path = libRCTWebSocket.a; 507 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 508 | sourceTree = BUILT_PRODUCTS_DIR; 509 | }; 510 | 146834041AC3E56700842450 /* libReact.a */ = { 511 | isa = PBXReferenceProxy; 512 | fileType = archive.ar; 513 | path = libReact.a; 514 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 515 | sourceTree = BUILT_PRODUCTS_DIR; 516 | }; 517 | 5E9157331DD0AC6500FF2AA8 /* libRCTAnimation.a */ = { 518 | isa = PBXReferenceProxy; 519 | fileType = archive.ar; 520 | path = libRCTAnimation.a; 521 | remoteRef = 5E9157321DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 522 | sourceTree = BUILT_PRODUCTS_DIR; 523 | }; 524 | 5E9157351DD0AC6500FF2AA8 /* libRCTAnimation-tvOS.a */ = { 525 | isa = PBXReferenceProxy; 526 | fileType = archive.ar; 527 | path = "libRCTAnimation-tvOS.a"; 528 | remoteRef = 5E9157341DD0AC6500FF2AA8 /* PBXContainerItemProxy */; 529 | sourceTree = BUILT_PRODUCTS_DIR; 530 | }; 531 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 532 | isa = PBXReferenceProxy; 533 | fileType = archive.ar; 534 | path = libRCTLinking.a; 535 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 536 | sourceTree = BUILT_PRODUCTS_DIR; 537 | }; 538 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 539 | isa = PBXReferenceProxy; 540 | fileType = archive.ar; 541 | path = libRCTText.a; 542 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 543 | sourceTree = BUILT_PRODUCTS_DIR; 544 | }; 545 | /* End PBXReferenceProxy section */ 546 | 547 | /* Begin PBXResourcesBuildPhase section */ 548 | 00E356EC1AD99517003FC87E /* Resources */ = { 549 | isa = PBXResourcesBuildPhase; 550 | buildActionMask = 2147483647; 551 | files = ( 552 | ); 553 | runOnlyForDeploymentPostprocessing = 0; 554 | }; 555 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 556 | isa = PBXResourcesBuildPhase; 557 | buildActionMask = 2147483647; 558 | files = ( 559 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 560 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 561 | ); 562 | runOnlyForDeploymentPostprocessing = 0; 563 | }; 564 | /* End PBXResourcesBuildPhase section */ 565 | 566 | /* Begin PBXShellScriptBuildPhase section */ 567 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 568 | isa = PBXShellScriptBuildPhase; 569 | buildActionMask = 2147483647; 570 | files = ( 571 | ); 572 | inputPaths = ( 573 | ); 574 | name = "Bundle React Native code and images"; 575 | outputPaths = ( 576 | ); 577 | runOnlyForDeploymentPostprocessing = 0; 578 | shellPath = /bin/sh; 579 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh"; 580 | }; 581 | /* End PBXShellScriptBuildPhase section */ 582 | 583 | /* Begin PBXSourcesBuildPhase section */ 584 | 00E356EA1AD99517003FC87E /* Sources */ = { 585 | isa = PBXSourcesBuildPhase; 586 | buildActionMask = 2147483647; 587 | files = ( 588 | 00E356F31AD99517003FC87E /* testProjectTests.m in Sources */, 589 | ); 590 | runOnlyForDeploymentPostprocessing = 0; 591 | }; 592 | 13B07F871A680F5B00A75B9A /* Sources */ = { 593 | isa = PBXSourcesBuildPhase; 594 | buildActionMask = 2147483647; 595 | files = ( 596 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 597 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 598 | ); 599 | runOnlyForDeploymentPostprocessing = 0; 600 | }; 601 | /* End PBXSourcesBuildPhase section */ 602 | 603 | /* Begin PBXTargetDependency section */ 604 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 605 | isa = PBXTargetDependency; 606 | target = 13B07F861A680F5B00A75B9A /* testProject */; 607 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 608 | }; 609 | /* End PBXTargetDependency section */ 610 | 611 | /* Begin PBXVariantGroup section */ 612 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 613 | isa = PBXVariantGroup; 614 | children = ( 615 | 13B07FB21A68108700A75B9A /* Base */, 616 | ); 617 | name = LaunchScreen.xib; 618 | path = testProject; 619 | sourceTree = ""; 620 | }; 621 | /* End PBXVariantGroup section */ 622 | 623 | /* Begin XCBuildConfiguration section */ 624 | 00E356F61AD99517003FC87E /* Debug */ = { 625 | isa = XCBuildConfiguration; 626 | buildSettings = { 627 | BUNDLE_LOADER = "$(TEST_HOST)"; 628 | GCC_PREPROCESSOR_DEFINITIONS = ( 629 | "DEBUG=1", 630 | "$(inherited)", 631 | ); 632 | INFOPLIST_FILE = testProjectTests/Info.plist; 633 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 634 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 635 | PRODUCT_NAME = "$(TARGET_NAME)"; 636 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/testProject.app/testProject"; 637 | LIBRARY_SEARCH_PATHS = ( 638 | "$(inherited)", 639 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 640 | ); 641 | }; 642 | name = Debug; 643 | }; 644 | 00E356F71AD99517003FC87E /* Release */ = { 645 | isa = XCBuildConfiguration; 646 | buildSettings = { 647 | BUNDLE_LOADER = "$(TEST_HOST)"; 648 | COPY_PHASE_STRIP = NO; 649 | INFOPLIST_FILE = testProjectTests/Info.plist; 650 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 651 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 652 | PRODUCT_NAME = "$(TARGET_NAME)"; 653 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/testProject.app/testProject"; 654 | LIBRARY_SEARCH_PATHS = ( 655 | "$(inherited)", 656 | "\"$(SRCROOT)/$(TARGET_NAME)\"", 657 | ); 658 | }; 659 | name = Release; 660 | }; 661 | 13B07F941A680F5B00A75B9A /* Debug */ = { 662 | isa = XCBuildConfiguration; 663 | buildSettings = { 664 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 665 | CURRENT_PROJECT_VERSION = 1; 666 | DEAD_CODE_STRIPPING = NO; 667 | INFOPLIST_FILE = testProject/Info.plist; 668 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 669 | OTHER_LDFLAGS = ( 670 | "$(inherited)", 671 | "-ObjC", 672 | "-lc++", 673 | ); 674 | PRODUCT_NAME = testProject; 675 | VERSIONING_SYSTEM = "apple-generic"; 676 | }; 677 | name = Debug; 678 | }; 679 | 13B07F951A680F5B00A75B9A /* Release */ = { 680 | isa = XCBuildConfiguration; 681 | buildSettings = { 682 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 683 | CURRENT_PROJECT_VERSION = 1; 684 | INFOPLIST_FILE = testProject/Info.plist; 685 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 686 | OTHER_LDFLAGS = ( 687 | "$(inherited)", 688 | "-ObjC", 689 | "-lc++", 690 | ); 691 | PRODUCT_NAME = testProject; 692 | VERSIONING_SYSTEM = "apple-generic"; 693 | }; 694 | name = Release; 695 | }; 696 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 697 | isa = XCBuildConfiguration; 698 | buildSettings = { 699 | ALWAYS_SEARCH_USER_PATHS = NO; 700 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 701 | CLANG_CXX_LIBRARY = "libc++"; 702 | CLANG_ENABLE_MODULES = YES; 703 | CLANG_ENABLE_OBJC_ARC = YES; 704 | CLANG_WARN_BOOL_CONVERSION = YES; 705 | CLANG_WARN_CONSTANT_CONVERSION = YES; 706 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 707 | CLANG_WARN_EMPTY_BODY = YES; 708 | CLANG_WARN_ENUM_CONVERSION = YES; 709 | CLANG_WARN_INT_CONVERSION = YES; 710 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 711 | CLANG_WARN_UNREACHABLE_CODE = YES; 712 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 713 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 714 | COPY_PHASE_STRIP = NO; 715 | ENABLE_STRICT_OBJC_MSGSEND = YES; 716 | GCC_C_LANGUAGE_STANDARD = gnu99; 717 | GCC_DYNAMIC_NO_PIC = NO; 718 | GCC_OPTIMIZATION_LEVEL = 0; 719 | GCC_PREPROCESSOR_DEFINITIONS = ( 720 | "DEBUG=1", 721 | "$(inherited)", 722 | ); 723 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 724 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 725 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 726 | GCC_WARN_UNDECLARED_SELECTOR = YES; 727 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 728 | GCC_WARN_UNUSED_FUNCTION = YES; 729 | GCC_WARN_UNUSED_VARIABLE = YES; 730 | HEADER_SEARCH_PATHS = ( 731 | "$(inherited)", 732 | "$(SRCROOT)/../node_modules/react-native/React/**", 733 | "$(SRCROOT)/../node_modules/react-native/ReactCommon/**", 734 | "$(SRCROOT)/../node_modules/react-native-umeng-push/ios/**", 735 | ); 736 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 737 | MTL_ENABLE_DEBUG_INFO = YES; 738 | ONLY_ACTIVE_ARCH = YES; 739 | SDKROOT = iphoneos; 740 | }; 741 | name = Debug; 742 | }; 743 | 83CBBA211A601CBA00E9B192 /* Release */ = { 744 | isa = XCBuildConfiguration; 745 | buildSettings = { 746 | ALWAYS_SEARCH_USER_PATHS = NO; 747 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 748 | CLANG_CXX_LIBRARY = "libc++"; 749 | CLANG_ENABLE_MODULES = YES; 750 | CLANG_ENABLE_OBJC_ARC = YES; 751 | CLANG_WARN_BOOL_CONVERSION = YES; 752 | CLANG_WARN_CONSTANT_CONVERSION = YES; 753 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 754 | CLANG_WARN_EMPTY_BODY = YES; 755 | CLANG_WARN_ENUM_CONVERSION = YES; 756 | CLANG_WARN_INT_CONVERSION = YES; 757 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 758 | CLANG_WARN_UNREACHABLE_CODE = YES; 759 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 760 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 761 | COPY_PHASE_STRIP = YES; 762 | ENABLE_NS_ASSERTIONS = NO; 763 | ENABLE_STRICT_OBJC_MSGSEND = YES; 764 | GCC_C_LANGUAGE_STANDARD = gnu99; 765 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 766 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 767 | GCC_WARN_UNDECLARED_SELECTOR = YES; 768 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 769 | GCC_WARN_UNUSED_FUNCTION = YES; 770 | GCC_WARN_UNUSED_VARIABLE = YES; 771 | HEADER_SEARCH_PATHS = ( 772 | "$(inherited)", 773 | "$(SRCROOT)/../node_modules/react-native/React/**", 774 | "$(SRCROOT)/../node_modules/react-native/ReactCommon/**", 775 | "$(SRCROOT)/../node_modules/react-native-umeng-push/ios/**", 776 | ); 777 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 778 | MTL_ENABLE_DEBUG_INFO = NO; 779 | SDKROOT = iphoneos; 780 | VALIDATE_PRODUCT = YES; 781 | }; 782 | name = Release; 783 | }; 784 | /* End XCBuildConfiguration section */ 785 | 786 | /* Begin XCConfigurationList section */ 787 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "testProjectTests" */ = { 788 | isa = XCConfigurationList; 789 | buildConfigurations = ( 790 | 00E356F61AD99517003FC87E /* Debug */, 791 | 00E356F71AD99517003FC87E /* Release */, 792 | ); 793 | defaultConfigurationIsVisible = 0; 794 | defaultConfigurationName = Release; 795 | }; 796 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "testProject" */ = { 797 | isa = XCConfigurationList; 798 | buildConfigurations = ( 799 | 13B07F941A680F5B00A75B9A /* Debug */, 800 | 13B07F951A680F5B00A75B9A /* Release */, 801 | ); 802 | defaultConfigurationIsVisible = 0; 803 | defaultConfigurationName = Release; 804 | }; 805 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "testProject" */ = { 806 | isa = XCConfigurationList; 807 | buildConfigurations = ( 808 | 83CBBA201A601CBA00E9B192 /* Debug */, 809 | 83CBBA211A601CBA00E9B192 /* Release */, 810 | ); 811 | defaultConfigurationIsVisible = 0; 812 | defaultConfigurationName = Release; 813 | }; 814 | /* End XCConfigurationList section */ 815 | }; 816 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 817 | } 818 | -------------------------------------------------------------------------------- /Example/ios/TestProject.xcodeproj/xcshareddata/xcschemes/TestProject.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /Example/ios/TestProject/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example/ios/TestProject/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import "RCTBundleURLProvider.h" 13 | #import "RCTRootView.h" 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 24 | moduleName:@"testProject" 25 | initialProperties:nil 26 | launchOptions:launchOptions]; 27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 28 | 29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 30 | UIViewController *rootViewController = [UIViewController new]; 31 | rootViewController.view = rootView; 32 | self.window.rootViewController = rootViewController; 33 | [self.window makeKeyAndVisible]; 34 | return YES; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Example/ios/TestProject/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Example/ios/TestProject/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Example/ios/TestProject/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /Example/ios/TestProject/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/ios/TestProjectTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/ios/TestProjectTests/TestProjectTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface testProjectTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation testProjectTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /Example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "testProject", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start", 7 | "test": "jest" 8 | }, 9 | "dependencies": { 10 | "react": "15.4.1", 11 | "react-native": "0.39.2", 12 | "react-native-umeng-push": "^1.0.5" 13 | }, 14 | "devDependencies": { 15 | "babel-jest": "18.0.0", 16 | "babel-preset-react-native": "1.9.1", 17 | "jest": "18.0.0", 18 | "react-test-renderer": "15.4.1" 19 | }, 20 | "jest": { 21 | "preset": "react-native" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 liuchungui 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README-pre.md: -------------------------------------------------------------------------------- 1 | #react-native-umeng-push 2 | ##安装 3 | ``` 4 | rnpm install react-native-umeng-push 5 | ``` 6 | 7 | ##集成到iOS 8 | 在`Appdelegate.m`中对应的位置添加如下三个API: 9 | 10 | ``` 11 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 12 | { 13 | //注册友盟推送 14 | [RCTUmengPush registerWithAppkey:@"your app key" launchOptions:launchOptions]; 15 | } 16 | 17 | - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken 18 | { 19 | //获取deviceToken 20 | [RCTUmengPush application:application didRegisterDeviceToken:deviceToken]; 21 | } 22 | 23 | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo 24 | { 25 | //获取远程推送消息 26 | [RCTUmengPush application:application didReceiveRemoteNotification:userInfo]; 27 | } 28 | ``` 29 | 30 | ##集成到android 31 | ####1、添加PushSDK 32 | 由于这个库依赖于[react-native-umeng-sdk](https://github.com/liuchungui/react-native-umeng-sdk.git),需要在你的工程`settings.gradle`文件中添加`PushSDK`。 33 | 34 | ``` 35 | include ':PushSDK' 36 | project(':PushSDK').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-umeng-sdk/android/PushSDK') 37 | ``` 38 | 39 | ####2、设置Application 40 | 创建一个Application类,并继承`UmengPushApplication`,在主项目中的`AndroidManifest.xml`文件中指定application的名字为你创建的Application。 41 | 42 | 注:这一步主要是因为友盟推送需要在Application当中接收推送,`UmengPushApplication`封装了友盟推送的内容。如果友盟推送如果不放在Application当中,退出应用之后是无法接收到推送的。 43 | 44 | ####3、添加AppKey & Umeng Message Secret 45 | 在项目工程的`AndroidManifest.xml`中的标签下添加: 46 | 47 | ``` 48 | 51 | 52 | 55 | 56 | ``` 57 | 58 | ####4、在项目的build.gradle里面配置applicationId 59 | 在自己项目的build.gradle里面一定要配置applicationId,`PushSDK`下的`AndroidManifest.xml`里面的${applicationId}会引用到applicationId。 60 | 61 | 如下所示: 62 | 63 | ``` 64 | defaultConfig { 65 | applicationId "应用的包名" 66 | minSdkVersion 8 67 | targetSdkVersion 22 68 | } 69 | ``` 70 | **注:**如果是android6.0以上的api编译,需要在PushSDK的build.gradle文件的android{}块内添加useLibrary 'org.apache.http.legacy',并把compileSdkVersion的版本号改为23。 71 | 72 | 详情参考:[友盟安卓SDK集成指南](http://dev.umeng.com/push/android/integration) 73 | 74 | ##API 75 | 76 | | API | Note | 77 | |---|---| 78 | | `getDeviceToken` | 获取DeviceToken | 79 | | `didReceiveMessage` | 接收到推送消息回调的方法 | 80 | | `didOpenMessage` | 点击推送消息打开应用回调的方法 | 81 | 82 | 83 | ##Usage 84 | 85 | ``` 86 | import UmengPush from 'react-native-umeng-push'; 87 | 88 | //获取DeviceToken 89 | UmengPush.getDeviceToken(deviceToken => { 90 | console.log("deviceToken: ", deviceToken); 91 | }); 92 | 93 | //接收到推送消息回调 94 | UmengPush.didReceiveMessage(message => { 95 | console.log("didReceiveMessage:", message); 96 | }); 97 | 98 | //点击推送消息打开应用回调 99 | UmengPush.didOpenMessage(message => { 100 | console.log("didOpenMessage:", message); 101 | }); 102 | 103 | ``` 104 | **具体使用详情,请下载代码查看Example** 105 | 106 | ##Example 107 | ``` 108 | git clone https://github.com/liuchungui/react-native-umeng-push.git 109 | cd react-native-umeng-push/Example 110 | npm install --save 111 | ``` 112 | 113 | ##注意 114 | * 安卓如果获取不到deviceToken也接收不到推送,请查看友盟后台的包名是否一致,当前设备是否添加到测试设备当中 115 | 116 | 117 | 118 | 119 | ##More 120 | * 欢迎大家Pull Request 121 | * 有什么疑问,欢迎提问题 122 | * 觉得好的,来一个star 123 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # react-native-umeng-push 2 | ## 安装 3 | ``` 4 | rnpm install react-native-umeng-push 5 | ``` 6 | 7 | ## 集成到iOS 8 | 在`Appdelegate.m`中对应的位置添加如下三个API: 9 | 10 | ``` 11 | #import "RCTUmengPush.h" 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | //注册友盟推送 16 | [RCTUmengPush registerWithAppkey:@"your app key" launchOptions:launchOptions]; 17 | } 18 | 19 | - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken 20 | { 21 | //获取deviceToken 22 | [RCTUmengPush application:application didRegisterDeviceToken:deviceToken]; 23 | } 24 | 25 | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo 26 | { 27 | //获取远程推送消息 28 | [RCTUmengPush application:application didReceiveRemoteNotification:userInfo]; 29 | } 30 | ``` 31 | 参考: 32 | https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/AddingCapabilities/AddingCapabilities.html#//apple_ref/doc/uid/TP40012582-CH26-SW6 33 | 34 | 启用推送设置 Enabling Push Notifications(否则会报 iOS device_token 无效) 35 | 36 | ## 集成到android 37 | 注意:0.29版本以后,reactNative会自动创建MainApplication,并且将添加原生模块从MainActivity移到了MainApplication,详情请见[http://reactnative.cn/post/1774](http://reactnative.cn/post/1774),所以我们的这里继承也有些变化,如果你的reactNative版本是0.29以下,请点击[README-pre.md](https://github.com/liuchungui/react-native-umeng-push/blob/master/README-pre.md) 38 | 39 | #### 1、添加PushSDK 40 | 由于这个库依赖于[react-native-umeng-sdk](https://github.com/liuchungui/react-native-umeng-sdk.git),需要在你的工程`settings.gradle`文件中添加`PushSDK`。 41 | 42 | ``` 43 | include ':PushSDK' 44 | project(':PushSDK').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-umeng-sdk/android/PushSDK') 45 | ``` 46 | 47 | #### 2、设置Application 48 | 新版本的react-native工程已经存在`MainApplication`,我们只需要将`MainApplication`继承`UmengApplication`,然后添加对应的`UmengPushPackage`进去就行了,如下所示: 49 | 50 | ```java 51 | import com.liuchungui.react_native_umeng_push.UmengPushApplication; 52 | import com.liuchungui.react_native_umeng_push.UmengPushPackage; 53 | 54 | public class MainApplication extends UmengPushApplication implements ReactApplication { 55 | 56 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 57 | @Override 58 | protected boolean getUseDeveloperSupport() { 59 | return BuildConfig.DEBUG; 60 | } 61 | 62 | @Override 63 | protected List getPackages() { 64 | return Arrays.asList( 65 | new MainReactPackage(), 66 | new UmengPushPackage() 67 | ); 68 | } 69 | }; 70 | ``` 71 | 72 | 注:这一步主要是因为友盟推送需要在Application当中接收推送,`UmengPushApplication`封装了友盟推送的内容。如果友盟推送如果不放在Application当中,退出应用之后是无法接收到推送的。 73 | 74 | #### 3、添加AppKey & Umeng Message Secret 75 | 在项目工程的`AndroidManifest.xml`中的`Application`标签下添加: 76 | 77 | ``` 78 | 81 | 82 | 85 | 86 | ``` 87 | 88 | #### 4、安卓集成获取不到deviceToken问题 89 | * 确定是否将appkey、MessageSecret、以及包名都更换为开发者所申请的相应值 90 | * 如果获取不到deviceToken也接收不到推送,请查看友盟后台的包名是否一致,当前设备是否添加到测试设备当中 91 | * Android Studio中gradle的版本需要在1.5.0或者以上 92 | 93 | 更多DeviceToken相关问题,请参考[Device_token 相关问题整理【安卓版】](http://bbs.umeng.com/thread-15233-1-1.html) 94 | 95 | #### 5、其它 96 | **注:**如果是android6.0以上的api编译,需要在PushSDK的build.gradle文件的android{}块内添加useLibrary 'org.apache.http.legacy',并把compileSdkVersion的版本号改为23。 97 | 98 | 详情参考:[友盟安卓SDK集成指南](http://dev.umeng.com/push/android/integration) 99 | 100 | ## API 101 | 102 | | API | Note | 103 | |---|---| 104 | | `getDeviceToken` | 获取DeviceToken | 105 | | `didReceiveMessage` | 接收到推送消息回调的方法 | 106 | | `didOpenMessage` | 点击推送消息打开应用回调的方法 | 107 | 108 | 109 | ## Usage 110 | 111 | ``` 112 | import UmengPush from 'react-native-umeng-push'; 113 | 114 | //获取DeviceToken 115 | UmengPush.getDeviceToken(deviceToken => { 116 | console.log("deviceToken: ", deviceToken); 117 | }); 118 | 119 | //接收到推送消息回调 120 | UmengPush.didReceiveMessage(message => { 121 | console.log("didReceiveMessage:", message); 122 | }); 123 | 124 | //点击推送消息打开应用回调 125 | UmengPush.didOpenMessage(message => { 126 | console.log("didOpenMessage:", message); 127 | }); 128 | 129 | ``` 130 | **具体使用详情,请下载代码查看Example** 131 | 132 | ## Example 133 | ``` 134 | git clone https://github.com/liuchungui/react-native-umeng-push.git 135 | cd react-native-umeng-push/Example 136 | npm install --save 137 | ``` 138 | 139 | 140 | ## More 141 | * 欢迎大家Pull Request 142 | * 有什么疑问,欢迎提问题 143 | * 觉得好的,来一个star 144 | -------------------------------------------------------------------------------- /UmengPush.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import React, { 4 | NativeModules, 5 | DeviceEventEmitter, //android 6 | NativeAppEventEmitter, //ios 7 | Platform, 8 | AppState, 9 | } from 'react-native'; 10 | 11 | const UmengPushModule = NativeModules.UmengPush; 12 | 13 | var receiveMessageSubscript, openMessageSubscription; 14 | 15 | var UmengPush = { 16 | 17 | getDeviceToken(handler: Function) { 18 | UmengPushModule.getDeviceToken(handler); 19 | }, 20 | 21 | didReceiveMessage(handler: Function) { 22 | receiveMessageSubscript = this.addEventListener(UmengPushModule.DidReceiveMessage, message => { 23 | //处于后台时,拦截收到的消息 24 | if(AppState.currentState === 'background') { 25 | return; 26 | } 27 | handler(message); 28 | }); 29 | }, 30 | 31 | didOpenMessage(handler: Function) { 32 | openMessageSubscription = this.addEventListener(UmengPushModule.DidOpenMessage, handler); 33 | }, 34 | 35 | addEventListener(eventName: string, handler: Function) { 36 | if(Platform.OS === 'android') { 37 | return DeviceEventEmitter.addListener(eventName, (event) => { 38 | handler(event); 39 | }); 40 | } 41 | else { 42 | return NativeAppEventEmitter.addListener( 43 | eventName, (userInfo) => { 44 | handler(userInfo); 45 | }); 46 | } 47 | }, 48 | }; 49 | 50 | module.exports = UmengPush; 51 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.3" 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 23 10 | versionCode 1 11 | versionName "1.0" 12 | } 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 17 | } 18 | } 19 | } 20 | 21 | repositories { 22 | flatDir { 23 | dirs 'libs' //this way we can find the .aar file in libs folder 24 | } 25 | } 26 | 27 | dependencies { 28 | compile fileTree(dir: 'libs', include: ['*.jar']) 29 | testCompile 'junit:junit:4.12' 30 | compile 'com.android.support:appcompat-v7:23.0.1' 31 | compile 'com.facebook.react:react-native:+' 32 | compile project(':PushSDK') 33 | } 34 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | ## Project-wide Gradle settings. 2 | # 3 | # For more details on how to configure your build environment visit 4 | # http://www.gradle.org/docs/current/userguide/build_environment.html 5 | # 6 | # Specifies the JVM arguments used for the daemon process. 7 | # The setting is particularly useful for tweaking memory settings. 8 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 9 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 10 | # 11 | # When configured, Gradle will run in incubating parallel mode. 12 | # This option should only be used with decoupled projects. More details, visit 13 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 14 | # org.gradle.parallel=true 15 | #Fri Apr 08 18:26:47 CST 2016 16 | systemProp.http.proxyHost=mirrors.neusoft.edu.cn 17 | systemProp.http.proxyPort=80 18 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchungui/react-native-umeng-push/ff313728175408e02b28aac1dbf8e658e9e2bf2c/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Oct 21 11:34:03 PDT 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/index.js: -------------------------------------------------------------------------------- 1 | var AndroidKeyboardAdjust = require('NativeModules').AndroidKeyboardAdjust; 2 | module.exports = AndroidKeyboardAdjust; -------------------------------------------------------------------------------- /android/src/androidTest/java/com/liuchungui/react_native_umeng_push/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.liuchungui.react_native_umeng_push; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/src/main/java/com/liuchungui/react_native_umeng_push/UmengPushApplication.java: -------------------------------------------------------------------------------- 1 | package com.liuchungui.react_native_umeng_push; 2 | 3 | import android.app.Application; 4 | import android.app.Notification; 5 | import android.content.Context; 6 | import android.os.Handler; 7 | import android.util.Log; 8 | 9 | import com.umeng.message.IUmengRegisterCallback; 10 | import com.umeng.message.PushAgent; 11 | import com.umeng.message.UmengMessageHandler; 12 | import com.umeng.message.UmengNotificationClickHandler; 13 | import com.umeng.message.entity.UMessage; 14 | 15 | /** 16 | * Created by user on 16/4/20. 17 | */ 18 | public class UmengPushApplication extends Application { 19 | protected static final String TAG = UmengPushModule.class.getSimpleName(); 20 | protected UmengPushModule mPushModule; 21 | protected String mRegistrationId; 22 | protected PushAgent mPushAgent; 23 | //应用退出时,打开推送通知时临时保存的消息 24 | private UMessage tmpMessage; 25 | //应用退出时,打开推送通知时临时保存的事件 26 | private String tmpEvent; 27 | 28 | @Override 29 | public void onCreate() { 30 | super.onCreate(); 31 | enablePush(); 32 | } 33 | 34 | protected void setmPushModule(UmengPushModule module) { 35 | mPushModule = module; 36 | if (tmpMessage != null && tmpEvent != null && mPushModule != null) { 37 | //execute the task 38 | clikHandlerSendEvent(tmpEvent, tmpMessage); 39 | //发送事件之后,清空临时内容 40 | tmpEvent = null; 41 | tmpMessage = null; 42 | } 43 | } 44 | //开启推送 45 | private void enablePush() { 46 | mPushAgent = PushAgent.getInstance(this); 47 | mPushAgent.enable(new IUmengRegisterCallback() { 48 | @Override 49 | public void onRegistered(final String s) { 50 | new Handler().post(new Runnable() { 51 | @Override 52 | public void run() { 53 | Log.i(TAG, "enable push, registrationId = " + s); 54 | mRegistrationId = s; 55 | } 56 | }); 57 | } 58 | }); 59 | //统计应用启动数据 60 | mPushAgent.onAppStart(); 61 | 62 | UmengNotificationClickHandler notificationClickHandler = new UmengNotificationClickHandler() { 63 | @Override 64 | public void launchApp(Context context, UMessage msg) { 65 | super.launchApp(context, msg); 66 | // Log.i(TAG, "launchApp"); 67 | clikHandlerSendEvent(UmengPushModule.DidOpenMessage, msg); 68 | } 69 | 70 | @Override 71 | public void openUrl(Context context, UMessage msg) { 72 | super.openUrl(context, msg); 73 | clikHandlerSendEvent(UmengPushModule.DidOpenMessage, msg); 74 | } 75 | 76 | @Override 77 | public void openActivity(Context context, UMessage msg) { 78 | super.openActivity(context, msg); 79 | clikHandlerSendEvent(UmengPushModule.DidOpenMessage, msg); 80 | } 81 | 82 | @Override 83 | public void dealWithCustomAction(Context context, UMessage msg) { 84 | super.dealWithCustomAction(context, msg); 85 | clikHandlerSendEvent(UmengPushModule.DidOpenMessage, msg); 86 | } 87 | }; 88 | 89 | //设置通知点击处理者 90 | mPushAgent.setNotificationClickHandler(notificationClickHandler); 91 | 92 | //设置消息和通知的处理 93 | mPushAgent.setMessageHandler(new UmengMessageHandler() { 94 | @Override 95 | public Notification getNotification(Context context, UMessage msg) { 96 | messageHandlerSendEvent(UmengPushModule.DidReceiveMessage, msg); 97 | Log.i(TAG, msg.toString()); 98 | return super.getNotification(context, msg); 99 | } 100 | 101 | @Override 102 | public void dealWithCustomMessage(Context context, UMessage msg) { 103 | super.dealWithCustomMessage(context, msg); 104 | messageHandlerSendEvent(UmengPushModule.DidReceiveMessage, msg); 105 | } 106 | }); 107 | 108 | //设置debug状态 109 | if(BuildConfig.DEBUG) { 110 | mPushAgent.setDebugMode(true); 111 | } 112 | //前台不显示通知 113 | // mPushAgent.setNotificaitonOnForeground(false); 114 | } 115 | 116 | /** 117 | * 点击推送通知触发的事件 118 | * @param event 119 | * @param msg 120 | */ 121 | private void clikHandlerSendEvent(final String event, final UMessage msg) { 122 | if(mPushModule == null) { 123 | tmpEvent = event; 124 | tmpMessage = msg; 125 | return; 126 | } 127 | //延时500毫秒发送推送,否则可能收不到 128 | new Handler().postDelayed(new Runnable() { 129 | public void run() { 130 | mPushModule.sendEvent(event, msg); 131 | } 132 | }, 500); 133 | } 134 | 135 | /** 136 | * 消息处理触发的事件 137 | * @param event 138 | * @param msg 139 | */ 140 | private void messageHandlerSendEvent(String event, UMessage msg) { 141 | if(mPushModule == null) { 142 | return; 143 | } 144 | mPushModule.sendEvent(event, msg); 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /android/src/main/java/com/liuchungui/react_native_umeng_push/UmengPushModule.java: -------------------------------------------------------------------------------- 1 | package com.liuchungui.react_native_umeng_push; 2 | 3 | import android.support.annotation.Nullable; 4 | import android.util.Log; 5 | 6 | import com.facebook.react.bridge.Arguments; 7 | import com.facebook.react.bridge.Callback; 8 | import com.facebook.react.bridge.LifecycleEventListener; 9 | import com.facebook.react.bridge.ReactApplicationContext; 10 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 11 | import com.facebook.react.bridge.ReactMethod; 12 | import com.facebook.react.bridge.WritableMap; 13 | import com.facebook.react.modules.core.DeviceEventManagerModule; 14 | import com.umeng.message.UmengRegistrar; 15 | import com.umeng.message.entity.UMessage; 16 | 17 | import org.json.JSONObject; 18 | 19 | import java.util.HashMap; 20 | import java.util.Iterator; 21 | import java.util.Map; 22 | 23 | /** 24 | * Created by user on 16/4/7. 25 | */ 26 | public class UmengPushModule extends ReactContextBaseJavaModule implements LifecycleEventListener { 27 | protected static final String TAG = UmengPushModule.class.getSimpleName(); 28 | protected static final String DidReceiveMessage = "DidReceiveMessage"; 29 | protected static final String DidOpenMessage = "DidOpenMessage"; 30 | 31 | private UmengPushApplication mPushApplication; 32 | private ReactApplicationContext mReactContext; 33 | 34 | public UmengPushModule(ReactApplicationContext reactContext) { 35 | super(reactContext); 36 | mReactContext = reactContext; 37 | //设置module给application 38 | UmengPushApplication application = (UmengPushApplication)reactContext.getBaseContext(); 39 | mPushApplication = application; 40 | //添加监听 41 | mReactContext.addLifecycleEventListener(this); 42 | } 43 | 44 | @Override 45 | public String getName() { 46 | return "UmengPush"; 47 | } 48 | 49 | @Override 50 | public Map getConstants() { 51 | final Map constants = new HashMap<>(); 52 | constants.put(DidReceiveMessage, DidReceiveMessage); 53 | constants.put(DidOpenMessage, DidOpenMessage); 54 | return constants; 55 | } 56 | 57 | /** 58 | * 获取设备id 59 | * @param callback 60 | */ 61 | @ReactMethod 62 | public void getDeviceToken(Callback callback) { 63 | String registrationId = UmengRegistrar.getRegistrationId(mReactContext); 64 | callback.invoke(registrationId == null ? mPushApplication.mRegistrationId : registrationId); 65 | } 66 | 67 | private WritableMap convertToWriteMap(UMessage msg) { 68 | WritableMap map = Arguments.createMap(); 69 | //遍历Json 70 | JSONObject jsonObject = msg.getRaw(); 71 | Iterator keys = jsonObject.keys(); 72 | String key; 73 | while (keys.hasNext()) { 74 | key = keys.next(); 75 | try { 76 | map.putString(key, jsonObject.get(key).toString()); 77 | } 78 | catch (Exception e) { 79 | Log.e(TAG, "putString fail"); 80 | } 81 | } 82 | return map; 83 | } 84 | 85 | 86 | protected void sendEvent(String eventName, UMessage msg) { 87 | sendEvent(eventName, convertToWriteMap(msg)); 88 | } 89 | 90 | private void sendEvent(String eventName, @Nullable WritableMap params) { 91 | //此处需要添加hasActiveCatalystInstance,否则可能造成崩溃 92 | //问题解决参考: https://github.com/walmartreact/react-native-orientation-listener/issues/8 93 | if(mReactContext.hasActiveCatalystInstance()) { 94 | Log.i(TAG, "hasActiveCatalystInstance"); 95 | mReactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) 96 | .emit(eventName, params); 97 | } 98 | else { 99 | Log.i(TAG, "not hasActiveCatalystInstance"); 100 | } 101 | } 102 | 103 | @Override 104 | public void onHostResume() { 105 | mPushApplication.setmPushModule(this); 106 | } 107 | 108 | @Override 109 | public void onHostPause() { 110 | } 111 | 112 | @Override 113 | public void onHostDestroy() { 114 | mPushApplication.setmPushModule(null); 115 | } 116 | 117 | } -------------------------------------------------------------------------------- /android/src/main/java/com/liuchungui/react_native_umeng_push/UmengPushPackage.java: -------------------------------------------------------------------------------- 1 | package com.liuchungui.react_native_umeng_push; 2 | 3 | import com.facebook.react.ReactPackage; 4 | import com.facebook.react.bridge.JavaScriptModule; 5 | import com.facebook.react.bridge.NativeModule; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.react.uimanager.ViewManager; 8 | 9 | import java.util.Arrays; 10 | import java.util.Collections; 11 | import java.util.List; 12 | 13 | /** 14 | * Created by user on 16/4/7. 15 | */ 16 | public class UmengPushPackage implements ReactPackage { 17 | @Override 18 | public List createNativeModules(ReactApplicationContext reactContext) { 19 | return Arrays.asList(new NativeModule[]{ 20 | // Modules from third-party 21 | new UmengPushModule(reactContext), 22 | }); 23 | } 24 | 25 | public List> createJSModules() { 26 | return Collections.emptyList(); 27 | } 28 | 29 | @Override 30 | public List createViewManagers(ReactApplicationContext reactContext) { 31 | return Collections.emptyList(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | react-native-umeng-push 3 | 4 | -------------------------------------------------------------------------------- /android/src/test/java/com/liuchungui/react_native_umeng_push/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.liuchungui.react_native_umeng_push; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /ios/RCTUmengPush.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CEA4D70C1CCBD77B002E8008 /* RCTUmengPush.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CEA4D70B1CCBD77B002E8008 /* RCTUmengPush.h */; }; 11 | CEA4D70E1CCBD77B002E8008 /* RCTUmengPush.m in Sources */ = {isa = PBXBuildFile; fileRef = CEA4D70D1CCBD77B002E8008 /* RCTUmengPush.m */; }; 12 | CEA4D7171CCBD86E002E8008 /* libUMessage_Sdk_1.2.6.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CEA4D7151CCBD86E002E8008 /* libUMessage_Sdk_1.2.6.a */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXCopyFilesBuildPhase section */ 16 | CEA4D7061CCBD77B002E8008 /* CopyFiles */ = { 17 | isa = PBXCopyFilesBuildPhase; 18 | buildActionMask = 2147483647; 19 | dstPath = "include/$(PRODUCT_NAME)"; 20 | dstSubfolderSpec = 16; 21 | files = ( 22 | CEA4D70C1CCBD77B002E8008 /* RCTUmengPush.h in CopyFiles */, 23 | ); 24 | runOnlyForDeploymentPostprocessing = 0; 25 | }; 26 | /* End PBXCopyFilesBuildPhase section */ 27 | 28 | /* Begin PBXFileReference section */ 29 | CEA4D7081CCBD77B002E8008 /* libRCTUmengPush.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTUmengPush.a; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | CEA4D70B1CCBD77B002E8008 /* RCTUmengPush.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTUmengPush.h; sourceTree = ""; }; 31 | CEA4D70D1CCBD77B002E8008 /* RCTUmengPush.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTUmengPush.m; sourceTree = ""; }; 32 | CEA4D7151CCBD86E002E8008 /* libUMessage_Sdk_1.2.6.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = libUMessage_Sdk_1.2.6.a; sourceTree = ""; }; 33 | CEA4D7161CCBD86E002E8008 /* UMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UMessage.h; sourceTree = ""; }; 34 | /* End PBXFileReference section */ 35 | 36 | /* Begin PBXFrameworksBuildPhase section */ 37 | CEA4D7051CCBD77B002E8008 /* Frameworks */ = { 38 | isa = PBXFrameworksBuildPhase; 39 | buildActionMask = 2147483647; 40 | files = ( 41 | CEA4D7171CCBD86E002E8008 /* libUMessage_Sdk_1.2.6.a in Frameworks */, 42 | ); 43 | runOnlyForDeploymentPostprocessing = 0; 44 | }; 45 | /* End PBXFrameworksBuildPhase section */ 46 | 47 | /* Begin PBXGroup section */ 48 | CEA4D6FF1CCBD77B002E8008 = { 49 | isa = PBXGroup; 50 | children = ( 51 | CEA4D7141CCBD86E002E8008 /* UMessage_Sdk_1.2.6 */, 52 | CEA4D70A1CCBD77B002E8008 /* RCTUmengPush */, 53 | CEA4D7091CCBD77B002E8008 /* Products */, 54 | ); 55 | sourceTree = ""; 56 | }; 57 | CEA4D7091CCBD77B002E8008 /* Products */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | CEA4D7081CCBD77B002E8008 /* libRCTUmengPush.a */, 61 | ); 62 | name = Products; 63 | sourceTree = ""; 64 | }; 65 | CEA4D70A1CCBD77B002E8008 /* RCTUmengPush */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | CEA4D70B1CCBD77B002E8008 /* RCTUmengPush.h */, 69 | CEA4D70D1CCBD77B002E8008 /* RCTUmengPush.m */, 70 | ); 71 | path = RCTUmengPush; 72 | sourceTree = ""; 73 | }; 74 | CEA4D7141CCBD86E002E8008 /* UMessage_Sdk_1.2.6 */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | CEA4D7151CCBD86E002E8008 /* libUMessage_Sdk_1.2.6.a */, 78 | CEA4D7161CCBD86E002E8008 /* UMessage.h */, 79 | ); 80 | path = UMessage_Sdk_1.2.6; 81 | sourceTree = ""; 82 | }; 83 | /* End PBXGroup section */ 84 | 85 | /* Begin PBXNativeTarget section */ 86 | CEA4D7071CCBD77B002E8008 /* RCTUmengPush */ = { 87 | isa = PBXNativeTarget; 88 | buildConfigurationList = CEA4D7111CCBD77B002E8008 /* Build configuration list for PBXNativeTarget "RCTUmengPush" */; 89 | buildPhases = ( 90 | CEA4D7041CCBD77B002E8008 /* Sources */, 91 | CEA4D7051CCBD77B002E8008 /* Frameworks */, 92 | CEA4D7061CCBD77B002E8008 /* CopyFiles */, 93 | ); 94 | buildRules = ( 95 | ); 96 | dependencies = ( 97 | ); 98 | name = RCTUmengPush; 99 | productName = RCTUmengPush; 100 | productReference = CEA4D7081CCBD77B002E8008 /* libRCTUmengPush.a */; 101 | productType = "com.apple.product-type.library.static"; 102 | }; 103 | /* End PBXNativeTarget section */ 104 | 105 | /* Begin PBXProject section */ 106 | CEA4D7001CCBD77B002E8008 /* Project object */ = { 107 | isa = PBXProject; 108 | attributes = { 109 | LastUpgradeCheck = 0730; 110 | ORGANIZATIONNAME = "react-native-umeng-push"; 111 | TargetAttributes = { 112 | CEA4D7071CCBD77B002E8008 = { 113 | CreatedOnToolsVersion = 7.3; 114 | }; 115 | }; 116 | }; 117 | buildConfigurationList = CEA4D7031CCBD77B002E8008 /* Build configuration list for PBXProject "RCTUmengPush" */; 118 | compatibilityVersion = "Xcode 3.2"; 119 | developmentRegion = English; 120 | hasScannedForEncodings = 0; 121 | knownRegions = ( 122 | en, 123 | ); 124 | mainGroup = CEA4D6FF1CCBD77B002E8008; 125 | productRefGroup = CEA4D7091CCBD77B002E8008 /* Products */; 126 | projectDirPath = ""; 127 | projectRoot = ""; 128 | targets = ( 129 | CEA4D7071CCBD77B002E8008 /* RCTUmengPush */, 130 | ); 131 | }; 132 | /* End PBXProject section */ 133 | 134 | /* Begin PBXSourcesBuildPhase section */ 135 | CEA4D7041CCBD77B002E8008 /* Sources */ = { 136 | isa = PBXSourcesBuildPhase; 137 | buildActionMask = 2147483647; 138 | files = ( 139 | CEA4D70E1CCBD77B002E8008 /* RCTUmengPush.m in Sources */, 140 | ); 141 | runOnlyForDeploymentPostprocessing = 0; 142 | }; 143 | /* End PBXSourcesBuildPhase section */ 144 | 145 | /* Begin XCBuildConfiguration section */ 146 | CEA4D70F1CCBD77B002E8008 /* Debug */ = { 147 | isa = XCBuildConfiguration; 148 | buildSettings = { 149 | ALWAYS_SEARCH_USER_PATHS = NO; 150 | CLANG_ANALYZER_NONNULL = YES; 151 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 152 | CLANG_CXX_LIBRARY = "libc++"; 153 | CLANG_ENABLE_MODULES = YES; 154 | CLANG_ENABLE_OBJC_ARC = YES; 155 | CLANG_WARN_BOOL_CONVERSION = YES; 156 | CLANG_WARN_CONSTANT_CONVERSION = YES; 157 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 158 | CLANG_WARN_EMPTY_BODY = YES; 159 | CLANG_WARN_ENUM_CONVERSION = YES; 160 | CLANG_WARN_INT_CONVERSION = YES; 161 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 162 | CLANG_WARN_UNREACHABLE_CODE = YES; 163 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 164 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 165 | COPY_PHASE_STRIP = NO; 166 | DEBUG_INFORMATION_FORMAT = dwarf; 167 | ENABLE_STRICT_OBJC_MSGSEND = YES; 168 | ENABLE_TESTABILITY = YES; 169 | GCC_C_LANGUAGE_STANDARD = gnu99; 170 | GCC_DYNAMIC_NO_PIC = NO; 171 | GCC_NO_COMMON_BLOCKS = YES; 172 | GCC_OPTIMIZATION_LEVEL = 0; 173 | GCC_PREPROCESSOR_DEFINITIONS = ( 174 | "DEBUG=1", 175 | "$(inherited)", 176 | ); 177 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 178 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 179 | GCC_WARN_UNDECLARED_SELECTOR = YES; 180 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 181 | GCC_WARN_UNUSED_FUNCTION = YES; 182 | GCC_WARN_UNUSED_VARIABLE = YES; 183 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 184 | MTL_ENABLE_DEBUG_INFO = YES; 185 | ONLY_ACTIVE_ARCH = YES; 186 | SDKROOT = iphoneos; 187 | }; 188 | name = Debug; 189 | }; 190 | CEA4D7101CCBD77B002E8008 /* Release */ = { 191 | isa = XCBuildConfiguration; 192 | buildSettings = { 193 | ALWAYS_SEARCH_USER_PATHS = NO; 194 | CLANG_ANALYZER_NONNULL = YES; 195 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 196 | CLANG_CXX_LIBRARY = "libc++"; 197 | CLANG_ENABLE_MODULES = YES; 198 | CLANG_ENABLE_OBJC_ARC = YES; 199 | CLANG_WARN_BOOL_CONVERSION = YES; 200 | CLANG_WARN_CONSTANT_CONVERSION = YES; 201 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 202 | CLANG_WARN_EMPTY_BODY = YES; 203 | CLANG_WARN_ENUM_CONVERSION = YES; 204 | CLANG_WARN_INT_CONVERSION = YES; 205 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 206 | CLANG_WARN_UNREACHABLE_CODE = YES; 207 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 208 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 209 | COPY_PHASE_STRIP = NO; 210 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 211 | ENABLE_NS_ASSERTIONS = NO; 212 | ENABLE_STRICT_OBJC_MSGSEND = YES; 213 | GCC_C_LANGUAGE_STANDARD = gnu99; 214 | GCC_NO_COMMON_BLOCKS = YES; 215 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 216 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 217 | GCC_WARN_UNDECLARED_SELECTOR = YES; 218 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 219 | GCC_WARN_UNUSED_FUNCTION = YES; 220 | GCC_WARN_UNUSED_VARIABLE = YES; 221 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 222 | MTL_ENABLE_DEBUG_INFO = NO; 223 | SDKROOT = iphoneos; 224 | VALIDATE_PRODUCT = YES; 225 | }; 226 | name = Release; 227 | }; 228 | CEA4D7121CCBD77B002E8008 /* Debug */ = { 229 | isa = XCBuildConfiguration; 230 | buildSettings = { 231 | HEADER_SEARCH_PATHS = "$(SRCROOT)/../../react-native/React/**"; 232 | LIBRARY_SEARCH_PATHS = ( 233 | "$(inherited)", 234 | "$(PROJECT_DIR)/UMessage_Sdk_1.2.6", 235 | ); 236 | OTHER_LDFLAGS = "-ObjC"; 237 | PRODUCT_NAME = "$(TARGET_NAME)"; 238 | SKIP_INSTALL = YES; 239 | }; 240 | name = Debug; 241 | }; 242 | CEA4D7131CCBD77B002E8008 /* Release */ = { 243 | isa = XCBuildConfiguration; 244 | buildSettings = { 245 | HEADER_SEARCH_PATHS = "$(SRCROOT)/../../react-native/React/**"; 246 | LIBRARY_SEARCH_PATHS = ( 247 | "$(inherited)", 248 | "$(PROJECT_DIR)/UMessage_Sdk_1.2.6", 249 | ); 250 | OTHER_LDFLAGS = "-ObjC"; 251 | PRODUCT_NAME = "$(TARGET_NAME)"; 252 | SKIP_INSTALL = YES; 253 | }; 254 | name = Release; 255 | }; 256 | /* End XCBuildConfiguration section */ 257 | 258 | /* Begin XCConfigurationList section */ 259 | CEA4D7031CCBD77B002E8008 /* Build configuration list for PBXProject "RCTUmengPush" */ = { 260 | isa = XCConfigurationList; 261 | buildConfigurations = ( 262 | CEA4D70F1CCBD77B002E8008 /* Debug */, 263 | CEA4D7101CCBD77B002E8008 /* Release */, 264 | ); 265 | defaultConfigurationIsVisible = 0; 266 | defaultConfigurationName = Release; 267 | }; 268 | CEA4D7111CCBD77B002E8008 /* Build configuration list for PBXNativeTarget "RCTUmengPush" */ = { 269 | isa = XCConfigurationList; 270 | buildConfigurations = ( 271 | CEA4D7121CCBD77B002E8008 /* Debug */, 272 | CEA4D7131CCBD77B002E8008 /* Release */, 273 | ); 274 | defaultConfigurationIsVisible = 0; 275 | defaultConfigurationName = Release; 276 | }; 277 | /* End XCConfigurationList section */ 278 | }; 279 | rootObject = CEA4D7001CCBD77B002E8008 /* Project object */; 280 | } 281 | -------------------------------------------------------------------------------- /ios/RCTUmengPush/RCTUmengPush.h: -------------------------------------------------------------------------------- 1 | // 2 | // RCTUmengPush.h 3 | // RCTUmengPush 4 | // 5 | // Created by user on 16/4/24. 6 | // Copyright © 2016年 react-native-umeng-push. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "RCTBridgeModule.h" 11 | 12 | @interface RCTUmengPush : NSObject 13 | + (void)registerWithAppkey:(NSString *)appkey launchOptions:(NSDictionary *)launchOptions; 14 | + (void)application:(UIApplication *)application didRegisterDeviceToken:(NSData *)deviceToken; 15 | + (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo; 16 | @end 17 | -------------------------------------------------------------------------------- /ios/RCTUmengPush/RCTUmengPush.m: -------------------------------------------------------------------------------- 1 | // 2 | // RCTUmengPush.m 3 | // RCTUmengPush 4 | // 5 | // Created by user on 16/4/24. 6 | // Copyright © 2016年 react-native-umeng-push. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "RCTUmengPush.h" 11 | #import "UMessage.h" 12 | #import "RCTEventDispatcher.h" 13 | 14 | #define UMSYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) 15 | #define _IPHONE80_ 80000 16 | 17 | static NSString * const DidReceiveMessage = @"DidReceiveMessage"; 18 | static NSString * const DidOpenMessage = @"DidOpenMessage"; 19 | static RCTUmengPush *_instance = nil; 20 | 21 | @interface RCTUmengPush () 22 | @property (nonatomic, copy) NSString *deviceToken; 23 | @end 24 | @implementation RCTUmengPush 25 | 26 | @synthesize bridge = _bridge; 27 | RCT_EXPORT_MODULE() 28 | 29 | + (instancetype)sharedInstance { 30 | static dispatch_once_t onceToken; 31 | dispatch_once(&onceToken, ^{ 32 | if(_instance == nil) { 33 | _instance = [[self alloc] init]; 34 | } 35 | }); 36 | return _instance; 37 | } 38 | 39 | + (instancetype)allocWithZone:(struct _NSZone *)zone { 40 | static dispatch_once_t onceToken; 41 | dispatch_once(&onceToken, ^{ 42 | if(_instance == nil) { 43 | _instance = [super allocWithZone:zone]; 44 | [_instance setupUMessage]; 45 | } 46 | }); 47 | return _instance; 48 | } 49 | 50 | + (dispatch_queue_t)sharedMethodQueue { 51 | static dispatch_queue_t methodQueue; 52 | static dispatch_once_t onceToken; 53 | dispatch_once(&onceToken, ^{ 54 | methodQueue = dispatch_queue_create("com.liuchungui.react-native-umeng-push", DISPATCH_QUEUE_SERIAL); 55 | }); 56 | return methodQueue; 57 | } 58 | 59 | - (dispatch_queue_t)methodQueue { 60 | return [RCTUmengPush sharedMethodQueue]; 61 | } 62 | 63 | - (NSDictionary *)constantsToExport { 64 | return @{ 65 | DidReceiveMessage: DidReceiveMessage, 66 | DidOpenMessage: DidOpenMessage, 67 | }; 68 | } 69 | 70 | - (void)didReceiveRemoteNotification:(NSDictionary *)userInfo { 71 | [self.bridge.eventDispatcher sendAppEventWithName:DidReceiveMessage body:userInfo]; 72 | } 73 | 74 | - (void)didOpenRemoteNotification:(NSDictionary *)userInfo { 75 | [self.bridge.eventDispatcher sendAppEventWithName:DidOpenMessage body:userInfo]; 76 | } 77 | 78 | RCT_EXPORT_METHOD(setAutoAlert:(BOOL)value) { 79 | [UMessage setAutoAlert:value]; 80 | } 81 | 82 | RCT_EXPORT_METHOD(getDeviceToken:(RCTResponseSenderBlock)callback) { 83 | NSString *deviceToken = self.deviceToken; 84 | if(deviceToken == nil) { 85 | deviceToken = @""; 86 | } 87 | callback(@[deviceToken]); 88 | } 89 | 90 | /** 91 | * 初始化UM的一些配置 92 | */ 93 | - (void)setupUMessage { 94 | [UMessage setAutoAlert:NO]; 95 | } 96 | 97 | + (void)registerWithAppkey:(NSString *)appkey launchOptions:(NSDictionary *)launchOptions { 98 | //set AppKey and LaunchOptions 99 | [UMessage startWithAppkey:appkey launchOptions:launchOptions]; 100 | 101 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= _IPHONE80_ 102 | if(UMSYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) 103 | { 104 | //register remoteNotification types 105 | UIMutableUserNotificationAction *action1 = [[UIMutableUserNotificationAction alloc] init]; 106 | action1.identifier = @"action1_identifier"; 107 | action1.title=@"Accept"; 108 | action1.activationMode = UIUserNotificationActivationModeForeground;//当点击的时候启动程序 109 | 110 | UIMutableUserNotificationAction *action2 = [[UIMutableUserNotificationAction alloc] init]; //第二按钮 111 | action2.identifier = @"action2_identifier"; 112 | action2.title=@"Reject"; 113 | action2.activationMode = UIUserNotificationActivationModeBackground;//当点击的时候不启动程序,在后台处理 114 | action2.authenticationRequired = YES;//需要解锁才能处理,如果action.activationMode = UIUserNotificationActivationModeForeground;则这个属性被忽略; 115 | action2.destructive = YES; 116 | 117 | UIMutableUserNotificationCategory *categorys = [[UIMutableUserNotificationCategory alloc] init]; 118 | categorys.identifier = @"category1";//这组动作的唯一标示 119 | [categorys setActions:@[action1,action2] forContext:(UIUserNotificationActionContextDefault)]; 120 | 121 | UIUserNotificationSettings *userSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert 122 | categories:[NSSet setWithObject:categorys]]; 123 | [UMessage registerRemoteNotificationAndUserNotificationSettings:userSettings]; 124 | 125 | } 126 | else{ 127 | //register remoteNotification types 128 | [UMessage registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge 129 | |UIRemoteNotificationTypeSound 130 | |UIRemoteNotificationTypeAlert]; 131 | } 132 | #else 133 | 134 | //register remoteNotification types 135 | [UMessage registerForRemoteNotificationTypes:UIRemoteNotificationTypeBadge 136 | |UIRemoteNotificationTypeSound 137 | |UIRemoteNotificationTypeAlert]; 138 | 139 | #endif 140 | 141 | //由推送第一次打开应用时 142 | if(launchOptions[@"UIApplicationLaunchOptionsRemoteNotificationKey"]) { 143 | [self didReceiveRemoteNotificationWhenFirstLaunchApp:launchOptions[@"UIApplicationLaunchOptionsRemoteNotificationKey"]]; 144 | } 145 | 146 | #ifdef DEBUG 147 | [UMessage setLogEnabled:YES]; 148 | #endif 149 | } 150 | 151 | + (void)application:(UIApplication *)application didRegisterDeviceToken:(NSData *)deviceToken { 152 | [RCTUmengPush sharedInstance].deviceToken = [[[[deviceToken description] stringByReplacingOccurrencesOfString: @"<" withString: @""] 153 | stringByReplacingOccurrencesOfString: @">" withString: @""] 154 | stringByReplacingOccurrencesOfString: @" " withString: @""]; 155 | [UMessage registerDeviceToken:deviceToken]; 156 | } 157 | 158 | + (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { 159 | [UMessage didReceiveRemoteNotification:userInfo]; 160 | //send event 161 | if (application.applicationState == UIApplicationStateInactive) { 162 | [[RCTUmengPush sharedInstance] didOpenRemoteNotification:userInfo]; 163 | } 164 | else { 165 | [[RCTUmengPush sharedInstance] didReceiveRemoteNotification:userInfo]; 166 | } 167 | } 168 | 169 | + (void)didReceiveRemoteNotificationWhenFirstLaunchApp:(NSDictionary *)launchOptions { 170 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), [self sharedMethodQueue], ^{ 171 | //判断当前模块是否正在加载,已经加载成功,则发送事件 172 | if(![RCTUmengPush sharedInstance].bridge.isLoading) { 173 | [UMessage didReceiveRemoteNotification:launchOptions]; 174 | [[RCTUmengPush sharedInstance] didOpenRemoteNotification:launchOptions]; 175 | } 176 | else { 177 | [self didReceiveRemoteNotificationWhenFirstLaunchApp:launchOptions]; 178 | } 179 | }); 180 | } 181 | 182 | @end 183 | -------------------------------------------------------------------------------- /ios/UMessage_Sdk_1.2.6/UMessage.h: -------------------------------------------------------------------------------- 1 | // 2 | // UMessage.h 3 | // UMessage 4 | // 5 | // Created by luyiyuan on 10/8/13. 6 | // Copyright (c) 2013 umeng.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | 13 | 14 | /** String type for alias 15 | */ 16 | //新浪微博 17 | UIKIT_EXTERN NSString *const kUMessageAliasTypeSina; 18 | //腾讯微博 19 | UIKIT_EXTERN NSString *const kUMessageAliasTypeTencent; 20 | //QQ 21 | UIKIT_EXTERN NSString *const kUMessageAliasTypeQQ; 22 | //微信 23 | UIKIT_EXTERN NSString *const kUMessageAliasTypeWeiXin; 24 | //百度 25 | UIKIT_EXTERN NSString *const kUMessageAliasTypeBaidu; 26 | //人人网 27 | UIKIT_EXTERN NSString *const kUMessageAliasTypeRenRen; 28 | //开心网 29 | UIKIT_EXTERN NSString *const kUMessageAliasTypeKaixin; 30 | //豆瓣 31 | UIKIT_EXTERN NSString *const kUMessageAliasTypeDouban; 32 | //facebook 33 | UIKIT_EXTERN NSString *const kUMessageAliasTypeFacebook; 34 | //twitter 35 | UIKIT_EXTERN NSString *const kUMessageAliasTypeTwitter; 36 | 37 | 38 | //error for handle 39 | extern NSString * const kUMessageErrorDomain; 40 | 41 | typedef NS_ENUM(NSInteger, kUMessageError) { 42 | /**未知错误*/ 43 | kUMessageErrorUnknown = 0, 44 | /**响应出错*/ 45 | kUMessageErrorResponseErr = 1, 46 | /**操作失败*/ 47 | kUMessageErrorOperateErr = 2, 48 | /**参数非法*/ 49 | kUMessageErrorParamErr = 3, 50 | /**条件不足(如:还未获取device_token,添加tag是不成功的)*/ 51 | kUMessageErrorDependsErr = 4, 52 | /**服务器限定操作*/ 53 | kUMessageErrorServerSetErr = 5, 54 | }; 55 | 56 | 57 | @class CLLocation; 58 | 59 | /** UMessage:开发者使用主类(API) 60 | */ 61 | @interface UMessage : NSObject 62 | 63 | 64 | ///--------------------------------------------------------------------------------------- 65 | /// @name settings(most required) 66 | ///--------------------------------------------------------------------------------------- 67 | 68 | //--required 69 | 70 | /** 绑定App的appKey和启动参数,启动消息参数用于处理用户通过消息打开应用相关信息 71 | @param appKey 主站生成appKey 72 | @param launchOptions 启动参数 73 | */ 74 | + (void)startWithAppkey:(NSString *)appKey launchOptions:(NSDictionary *)launchOptions; 75 | 76 | /** 注册RemoteNotification的类型 77 | @brief 开启消息推送,实际调用:[[UIApplication sharedApplication] registerForRemoteNotificationTypes:types]; 78 | @warning 此接口只针对 iOS 7及其以下的版本,iOS 8 请使用 `registerRemoteNotificationAndUserNotificationSettings` 79 | @param types 消息类型,参见`UIRemoteNotificationType` 80 | */ 81 | + (void)registerForRemoteNotificationTypes:(UIRemoteNotificationType)types NS_DEPRECATED_IOS(3_0, 8_0, "Please use registerRemoteNotificationAndUserNotificationSettings instead"); 82 | 83 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 84 | /** 注册RemoteNotification的类型 85 | @brief 开启消息推送,实际调用:[[UIApplication sharedApplication] registerForRemoteNotifications]和registerUserNotificationSettings; 86 | @warning 此接口只针对 iOS 8及其以上的版本,iOS 7 请使用 `registerForRemoteNotificationTypes` 87 | @param types 消息类型,参见`UIRemoteNotificationType` 88 | */ 89 | + (void)registerRemoteNotificationAndUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings NS_AVAILABLE_IOS(8_0); 90 | #endif 91 | 92 | /** 解除RemoteNotification的注册(关闭消息推送,实际调用:[[UIApplication sharedApplication] unregisterForRemoteNotifications]) 93 | @param types 消息类型,参见`UIRemoteNotificationType` 94 | */ 95 | + (void)unregisterForRemoteNotifications; 96 | 97 | /** 向友盟注册该设备的deviceToken,便于发送Push消息 98 | @param deviceToken APNs返回的deviceToken 99 | */ 100 | + (void)registerDeviceToken:(NSData *)deviceToken; 101 | 102 | /** 应用处于运行时(前台、后台)的消息处理 103 | @param userInfo 消息参数 104 | */ 105 | + (void)didReceiveRemoteNotification:(NSDictionary *)userInfo; 106 | 107 | //--optional 108 | 109 | /** 开发者自行传入location 110 | @param location 当前location信息 111 | */ 112 | + (void)setLocation:(CLLocation *)location; 113 | 114 | /** 设置应用的日志输出的开关(默认关闭) 115 | @param value 是否开启标志,注意App发布时请关闭日志输出 116 | */ 117 | + (void)setLogEnabled:(BOOL)value; 118 | 119 | /** 设置是否允许SDK自动清空角标(默认开启) 120 | @param value 是否开启角标清空 121 | */ 122 | + (void)setBadgeClear:(BOOL)value; 123 | 124 | /** 设置是否允许SDK当应用在前台运行收到Push时弹出Alert框(默认开启) 125 | @warning 建议不要关闭,否则会丢失程序在前台收到的Push的点击统计,如果定制了 Alert,可以使用`sendClickReportForRemoteNotification`补发 log 126 | @param value 是否开启弹出框 127 | */ 128 | + (void)setAutoAlert:(BOOL)value; 129 | 130 | /** 设置App的发布渠道(默认为:"App Store") 131 | @param channel 渠道名称 132 | */ 133 | + (void)setChannel:(NSString *)channel; 134 | 135 | /** 设置设备的唯一ID,目前友盟这边设备的唯一ID是OpenUdid,如果你们可以采集到更合适的唯一ID,可以采用这个ID来替换OpenUdid 136 | @warning 用户可以设置uniqueId方便以后扩展,我们短时间内在服务区端任然会采取OpenUdid作为唯一标记。 137 | @param uniqueId 唯一ID名称 138 | */ 139 | + (void)setUniqueID:(NSString *)uniqueId; 140 | 141 | /** 为某个消息发送点击事件 142 | @warning 请注意不要对同一个消息重复调用此方法,可能导致你的消息打开率飚升,此方法只在需要定制 Alert 框时调用 143 | @param userInfo 消息体的NSDictionary,此Dictionary是 144 | (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo中的userInfo 145 | */ 146 | + (void)sendClickReportForRemoteNotification:(NSDictionary *)userInfo; 147 | 148 | 149 | ///--------------------------------------------------------------------------------------- 150 | /// @name tag (optional) 151 | ///--------------------------------------------------------------------------------------- 152 | 153 | 154 | /** 获取当前绑定设备上的所有tag(每台设备最多绑定64个tag) 155 | @warning 获取列表的先决条件是已经成功获取到device_token,否则失败(kUMessageErrorDependsErr) 156 | @param handle responseTags为绑定的tag 157 | 集合,remain剩余可用的tag数,为-1时表示异常,error为获取失败时的信息(ErrCode:kUMessageError) 158 | */ 159 | + (void)getTags:(void (^)(NSSet *responseTags,NSInteger remain,NSError *error))handle; 160 | 161 | /** 绑定一个或多个tag至设备,每台设备最多绑定64个tag,超过64个,绑定tag不再成功,可`removeTag`或者`removeAllTags`来精简空间 162 | @warning 添加tag的先决条件是已经成功获取到device_token,否则直接添加失败(kUMessageErrorDependsErr) 163 | @param tag tag标记,可以为单个tag(NSString)也可以为tag集合(NSArray、NSSet),单个tag最大允许长度50字节,编码UTF-8,超过长度自动截取 164 | @param handle responseTags为绑定的tag集合,remain剩余可用的tag数,为-1时表示异常,error为获取失败时的信息(ErrCode:kUMessageError) 165 | */ 166 | + (void)addTag:(id)tag response:(void (^)(id responseObject,NSInteger remain,NSError *error))handle; 167 | 168 | /** 删除设备中绑定的一个或多个tag 169 | @warning 添加tag的先决条件是已经成功获取到device_token,否则失败(kUMessageErrorDependsErr) 170 | @param tag tag标记,可以为单个tag(NSString)也可以为tag集合(NSArray、NSSet),单个tag最大允许长度50字节,编码UTF-8,超过长度自动截取 171 | @param handle responseTags为绑定的tag集合,remain剩余可用的tag数,为-1时表示异常,error为获取失败时的信息(ErrCode:kUMessageError) 172 | */ 173 | + (void)removeTag:(id)tag response:(void (^)(id responseObject,NSInteger remain,NSError *error))handle; 174 | 175 | /** 删除设备中所有绑定的tag,handle responseObject 176 | @warning 删除tag的先决条件是已经成功获取到device_token,否则失败(kUMessageErrorDependsErr) 177 | @param handle responseTags为绑定的tag集合,remain剩余可用的tag数,为-1时表示异常,error为获取失败时的信息(ErrCode:kUMessageError) 178 | */ 179 | + (void)removeAllTags:(void (^)(id responseObject,NSInteger remain,NSError *error))handle; 180 | 181 | 182 | ///--------------------------------------------------------------------------------------- 183 | /// @name alias (optional) 184 | ///--------------------------------------------------------------------------------------- 185 | 186 | 187 | /** 绑定一个别名至设备(含账户,和平台类型) 188 | @warning 添加Alias的先决条件是已经成功获取到device_token,否则失败(kUMessageErrorDependsErr) 189 | @param name 账户,例如email 190 | @param type 平台类型,参见本文件头部的`kUMessageAliasType...`,例如:kUMessageAliasTypeSina 191 | @param handle block返回数据,error为获取失败时的信息,responseObject为成功返回的数据 192 | */ 193 | + (void)addAlias:(NSString *)name type:(NSString *)type response:(void (^)(id responseObject,NSError *error))handle; 194 | 195 | /** 绑定一个别名至设备(含账户,和平台类型),并解绑这个别名曾今绑定过的设备。 196 | @warning 添加Alias的先决条件是已经成功获取到device_token,否则失败(kUMessageErrorDependsErr) 197 | @param name 账户,例如email 198 | @param type 平台类型,参见本文件头部的`kUMessageAliasType...`,例如:kUMessageAliasTypeSina 199 | @param handle block返回数据,error为获取失败时的信息,responseObject为成功返回的数据 200 | */ 201 | + (void)setAlias:(NSString *)name type:(NSString *)type response:(void (^)(id responseObject,NSError *error))handle; 202 | 203 | /** 删除一个设备的别名绑定 204 | @warning 删除Alias的先决条件是已经成功获取到device_token,否则失败(kUMessageErrorDependsErr) 205 | @param name 账户,例如email 206 | @param type 平台类型,参见本文件头部的`kUMessageAliasType...`,例如:kUMessageAliasTypeSina 207 | @param handle block返回数据,error为获取失败时的信息,responseObject为成功返回的数据 208 | */ 209 | + (void)removeAlias:(NSString *)name type:(NSString *)type response:(void (^)(id responseObject,NSError *error))handle; 210 | 211 | @end 212 | -------------------------------------------------------------------------------- /ios/UMessage_Sdk_1.2.6/libUMessage_Sdk_1.2.6.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liuchungui/react-native-umeng-push/ff313728175408e02b28aac1dbf8e658e9e2bf2c/ios/UMessage_Sdk_1.2.6/libUMessage_Sdk_1.2.6.a -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-umeng-push", 3 | "version": "2.0.0", 4 | "private": false, 5 | "scripts": { 6 | "start": "node node_modules/react-native/local-cli/cli.js start" 7 | }, 8 | "dependencies": { 9 | "react-native-umeng-sdk": "1.5.0" 10 | }, 11 | "main": "UmengPush.js", 12 | "devDependencies": {}, 13 | "repository": { 14 | "type": "git", 15 | "url": "git+https://github.com/liuchungui/react-native-umeng-push.git" 16 | }, 17 | "keywords": [ 18 | "react-native", 19 | "umengpush", 20 | "umeng", 21 | "push", 22 | "umeng-push", 23 | "react-native", 24 | "react-native-umeng-push" 25 | ], 26 | "author": "liuchungui", 27 | "license": "MIT", 28 | "bugs": { 29 | "url": "https://github.com/liuchungui/react-native-umeng-push/issues" 30 | }, 31 | "homepage": "https://github.com/liuchungui/react-native-umeng-push#readme", 32 | "description": "" 33 | } 34 | --------------------------------------------------------------------------------