Skip to content

Commit c55aa31

Browse files
author
詹强
committed
Android-更新example
1 parent 0d37a23 commit c55aa31

File tree

6 files changed

+9
-16
lines changed

6 files changed

+9
-16
lines changed

example/android/app/build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,11 @@ def enableSeparateBuildPerCPUArchitecture = false
9494
def enableProguardInReleaseBuilds = false
9595

9696
android {
97-
compileSdkVersion 25
98-
97+
compileSdkVersion 28
9998
defaultConfig {
10099
applicationId "com.jmessage.sdk" //替换包名:
101100
minSdkVersion 16
102-
targetSdkVersion 23
101+
targetSdkVersion 28
103102
versionCode 1
104103
versionName "1.0"
105104
ndk {
@@ -144,7 +143,6 @@ dependencies {
144143
implementation fileTree(include: ['*.jar'], dir: 'libs')
145144
implementation project(':jcore-react-native')
146145
implementation project(':jpush-react-native')
147-
implementation 'com.android.support:appcompat-v7:25.3.1'
148146
implementation 'com.facebook.react:react-native:+'
149147
}
150148

example/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
22
xmlns:tools="http://schemas.android.com/tools"
3-
package="com.pushdemo">
3+
package="com.example">
44

55
<application
66
android:name=".MainApplication"

example/android/app/src/main/java/com/pushdemo/MainActivity.java renamed to example/android/app/src/main/java/com/example/MainActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.pushdemo;
1+
package com.example;
22

33
import android.os.Bundle;
44

@@ -16,7 +16,7 @@ protected void onCreate(Bundle savedInstanceState) {
1616

1717
@Override
1818
protected String getMainComponentName() {
19-
return "ReactNative-JPush";
19+
return "JPush-RN";
2020
}
2121

2222
}

example/android/app/src/main/java/com/pushdemo/MainApplication.java renamed to example/android/app/src/main/java/com/example/MainApplication.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.pushdemo;
1+
package com.example;
22

33
import android.app.Application;
44

@@ -31,6 +31,7 @@ protected String getJSMainModuleName() {
3131
protected List<ReactPackage> getPackages() {
3232
return Arrays.<ReactPackage>asList(
3333
new MainReactPackage(),
34+
//需要add JPush
3435
new JPushPackage()
3536
);
3637
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<resources>
2-
<string name="app_name">ReactNative-JPush</string>
2+
<string name="app_name">JPush-RN</string>
33
</resources>

example/android/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
31
buildscript {
42
repositories {
53
google()
64
jcenter()
75
}
86
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.3.2'
10-
11-
// NOTE: Do not place your application dependencies here; they belong
12-
// in the individual module build.gradle files
7+
classpath 'com.android.tools.build:gradle:3.3.0'
138
}
149
}
1510

@@ -19,7 +14,6 @@ allprojects {
1914
mavenLocal()
2015
jcenter()
2116
maven {
22-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
2317
url "$rootDir/../node_modules/react-native/android"
2418
}
2519
}

0 commit comments

Comments
 (0)