diff --git a/.packages b/.packages index 852e85b..7ad6ec9 100644 --- a/.packages +++ b/.packages @@ -1,56 +1,56 @@ -# Generated by pub on 2019-07-24 14:38:49.565093. -analyzer:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.37.0/lib/ -args:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/args-1.5.2/lib/ -async:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/async-2.3.0/lib/ -boolean_selector:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-1.0.5/lib/ -charcode:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.1.2/lib/ -collection:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.11/lib/ -convert:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/convert-2.1.1/lib/ -crypto:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/crypto-2.0.6/lib/ -csslib:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/csslib-0.16.1/lib/ -flutter:file:///Users/shikk/Documents/flutter/packages/flutter/lib/ -front_end:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/front_end-0.1.20/lib/ -glob:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/glob-1.1.7/lib/ -html:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/html-0.14.0+2/lib/ -http:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/http-0.12.0+2/lib/ -http_multi_server:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/http_multi_server-2.1.0/lib/ -http_parser:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/http_parser-3.1.3/lib/ -io:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/io-0.3.3/lib/ -js:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/js-0.6.1+1/lib/ -kernel:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/kernel-0.3.20/lib/ -matcher:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.5/lib/ -meta:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/meta-1.1.6/lib/ -mime:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/mime-0.9.6+3/lib/ -mockito:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/mockito-3.0.2/lib/ -multi_server_socket:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/multi_server_socket-1.0.2/lib/ -node_preamble:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/node_preamble-1.4.5/lib/ -package_config:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/package_config-1.0.5/lib/ -package_resolver:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/package_resolver-1.0.10/lib/ -path:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/path-1.6.2/lib/ -pedantic:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/pedantic-1.8.0+1/lib/ -platform:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/platform-2.2.0/lib/ -pool:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/pool-1.4.0/lib/ -pub_semver:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/pub_semver-1.4.2/lib/ -shelf:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/shelf-0.7.5/lib/ -shelf_packages_handler:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/shelf_packages_handler-1.0.4/lib/ -shelf_static:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/shelf_static-0.2.8/lib/ -shelf_web_socket:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/shelf_web_socket-0.2.3/lib/ -sky_engine:file:///Users/shikk/Documents/flutter/bin/cache/pkg/sky_engine/lib/ -source_map_stack_trace:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/source_map_stack_trace-1.1.5/lib/ -source_maps:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/source_maps-0.10.8/lib/ -source_span:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.5.5/lib/ -stack_trace:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.9.3/lib/ -stream_channel:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.0.0/lib/ -stream_transform:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/stream_transform-0.0.19/lib/ -string_scanner:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.0.4/lib/ -term_glyph:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.1.0/lib/ -test:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/test-1.6.5/lib/ -test_api:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.2.6/lib/ -test_core:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/test_core-0.2.7/lib/ -typed_data:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.1.6/lib/ -vector_math:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8/lib/ -vm_service_lib:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/vm_service_lib-3.22.2/lib/ -watcher:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/watcher-0.9.7+12/lib/ -web_socket_channel:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/web_socket_channel-1.0.14/lib/ -yaml:file:///Users/shikk/.pub-cache/hosted/pub.flutter-io.cn/yaml-2.1.16/lib/ +# Generated by pub on 2019-08-23 15:35:48.440553. +analyzer:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.37.0/lib/ +args:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/args-1.5.2/lib/ +async:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/async-2.3.0/lib/ +boolean_selector:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-1.0.5/lib/ +charcode:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/charcode-1.1.2/lib/ +collection:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/collection-1.14.11/lib/ +convert:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/convert-2.1.1/lib/ +crypto:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/crypto-2.0.6/lib/ +csslib:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/csslib-0.16.1/lib/ +flutter:file:///Applications/flutter/packages/flutter/lib/ +front_end:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/front_end-0.1.20/lib/ +glob:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/glob-1.1.7/lib/ +html:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/html-0.14.0+2/lib/ +http:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/http-0.12.0+2/lib/ +http_multi_server:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/http_multi_server-2.1.0/lib/ +http_parser:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/http_parser-3.1.3/lib/ +io:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/io-0.3.3/lib/ +js:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/js-0.6.1+1/lib/ +kernel:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/kernel-0.3.20/lib/ +matcher:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/matcher-0.12.5/lib/ +meta:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/meta-1.1.6/lib/ +mime:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/mime-0.9.6+3/lib/ +mockito:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/mockito-3.0.2/lib/ +multi_server_socket:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/multi_server_socket-1.0.2/lib/ +node_preamble:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/node_preamble-1.4.5/lib/ +package_config:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/package_config-1.0.5/lib/ +package_resolver:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/package_resolver-1.0.10/lib/ +path:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/path-1.6.2/lib/ +pedantic:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/pedantic-1.8.0+1/lib/ +platform:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/platform-2.2.0/lib/ +pool:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/pool-1.4.0/lib/ +pub_semver:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/pub_semver-1.4.2/lib/ +shelf:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/shelf-0.7.5/lib/ +shelf_packages_handler:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/shelf_packages_handler-1.0.4/lib/ +shelf_static:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/shelf_static-0.2.8/lib/ +shelf_web_socket:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/shelf_web_socket-0.2.3/lib/ +sky_engine:file:///Applications/flutter/bin/cache/pkg/sky_engine/lib/ +source_map_stack_trace:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_map_stack_trace-1.1.5/lib/ +source_maps:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_maps-0.10.8/lib/ +source_span:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/source_span-1.5.5/lib/ +stack_trace:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/stack_trace-1.9.3/lib/ +stream_channel:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/stream_channel-2.0.0/lib/ +stream_transform:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/stream_transform-0.0.19/lib/ +string_scanner:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/string_scanner-1.0.4/lib/ +term_glyph:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/term_glyph-1.1.0/lib/ +test:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/test-1.6.5/lib/ +test_api:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_api-0.2.6/lib/ +test_core:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/test_core-0.2.7/lib/ +typed_data:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/typed_data-1.1.6/lib/ +vector_math:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/vector_math-2.0.8/lib/ +vm_service_lib:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/vm_service_lib-3.22.2/lib/ +watcher:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/watcher-0.9.7+12/lib/ +web_socket_channel:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/web_socket_channel-1.0.14/lib/ +yaml:file:///Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/yaml-2.1.16/lib/ jpush_flutter:lib/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 99b5509..c75dfea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.1.0 ++ 修复:调用 sendLocalNotification 接口 crash 问题; ++ 修复:iOS 启动 APP 角标自动消失问题; ++ 修复执行 flutter build apk 打包错误问题; ++ 更新配置 + ## 0.0.13 featurn: diff --git a/README.md b/README.md index a3319c2..66c79a4 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ ```yaml dependencies: - jpush_flutter: 0.0.13 + jpush_flutter: 0.1.0 ``` ### 配置 diff --git a/android/build.gradle b/android/build.gradle index da62ed2..801e246 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -22,7 +22,7 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - compileSdkVersion 27 + compileSdkVersion 28 defaultConfig { minSdkVersion 16 @@ -36,7 +36,7 @@ android { dependencies { implementation 'cn.jiguang.sdk:jpush:3.3.4' implementation 'cn.jiguang.sdk:jcore:2.1.2' - implementation 'com.android.support:appcompat-v7:27.+' +// implementation 'com.android.support:appcompat-v7:28.+' compileOnly files('libs/flutter.jar') } \ No newline at end of file diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index e502926..4fd5880 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -24,8 +24,12 @@ if (flutterVersionName == null) { apply plugin: 'com.android.application' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +def keystorePropertiesFile = rootProject.file("key.properties") +def keystoreProperties = new Properties() +keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) + android { - compileSdkVersion 27 + compileSdkVersion 28 lintOptions { disable 'InvalidPackage' } @@ -37,7 +41,7 @@ android { applicationId "com.shikk.testJpush" //JPush 上注册的包名. minSdkVersion 16 - targetSdkVersion 27 + targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -56,14 +60,23 @@ android { JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可. ] } + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile file(keystoreProperties['storeFile']) + storePassword keystoreProperties['storePassword'] + } + } + buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug + signingConfig signingConfigs.release } } - buildToolsVersion '28.0.2' +// buildToolsVersion '28.0.1' packagingOptions { exclude 'lib/arm64-v8a/libgojni.so' diff --git a/example/android/build.gradle b/example/android/build.gradle index e81b1a1..d4225c7 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.2.0' + classpath 'com.android.tools.build:gradle:3.1.2' } } diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 35f610e..31ae914 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Oct 10 15:58:24 CST 2018 +#Wed Aug 21 15:20:04 CST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip diff --git a/example/android/key.properties b/example/android/key.properties new file mode 100644 index 0000000..e2f094e --- /dev/null +++ b/example/android/key.properties @@ -0,0 +1,4 @@ +storePassword= +keyPassword= +keyAlias=key +storeFile=/key.jks> \ No newline at end of file diff --git a/example/pubspec.lock b/example/pubspec.lock index 0dec253..04b65dc 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -136,7 +136,7 @@ packages: path: ".." relative: true source: path - version: "0.0.12" + version: "0.1.0" js: dependency: transitive description: diff --git a/example/test/widget_test.dart b/example/test/widget_test.dart index 88f7150..f5f5832 100644 --- a/example/test/widget_test.dart +++ b/example/test/widget_test.dart @@ -14,6 +14,7 @@ import 'package:jpush_flutter/jpush_flutter.dart'; import 'package:test/test.dart'; void main() { + /* testWidgets('Verify Platform version', (WidgetTester tester) async { // Build our app and trigger a frame. await tester.pumpWidget(new MyApp()); @@ -48,6 +49,6 @@ test('requestNotificationPermissions on ios with custom permissions', () { {'sound': false, 'badge': true, 'alert': true})); }); - + */ } diff --git a/ios/Classes/JPushPlugin.m b/ios/Classes/JPushPlugin.m index d74ed84..1ded726 100644 --- a/ios/Classes/JPushPlugin.m +++ b/ios/Classes/JPushPlugin.m @@ -326,7 +326,7 @@ static NSMutableArray* getRidResults; content.title = params[@"title"]; } - if (![params[@"subtitle"] isEqualToString:@""]) { + if (params[@"subtitle"] && ![params[@"subtitle"] isEqualToString:@""]) { content.subtitle = params[@"subtitle"]; } @@ -338,15 +338,15 @@ static NSMutableArray* getRidResults; content.badge = params[@"badge"]; } - if (![params[@"action"] isEqualToString:@""]) { + if (params[@"action"] && ![params[@"action"] isEqualToString:@""]) { content.action = params[@"action"]; } - if (![params[@"extra"] isEqualToString:@""]) { - content.userInfo = params[@"extra"]; - } + if ([params[@"extra"] isKindOfClass:[NSDictionary class]]) { + content.userInfo = params[@"extra"]; + } - if (![params[@"sound"] isEqualToString:@""]) { + if (params[@"sound"] && ![params[@"sound"] isEqualToString:@""]) { content.sound = params[@"sound"]; } @@ -424,8 +424,8 @@ didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { } - (void)applicationDidBecomeActive:(UIApplication *)application { - application.applicationIconBadgeNumber = 1; - application.applicationIconBadgeNumber = 0; +// application.applicationIconBadgeNumber = 1; +// application.applicationIconBadgeNumber = 0; } - (bool)application:(UIApplication *)application diff --git a/lib/jpush_flutter.dart b/lib/jpush_flutter.dart index 503d1cd..962551c 100644 --- a/lib/jpush_flutter.dart +++ b/lib/jpush_flutter.dart @@ -291,7 +291,7 @@ class LocalNotification { 'badge': badge, 'soundName': soundName, 'subtitle': subtitle - }; + }..removeWhere((key, value)=>value==null); } } diff --git a/pubspec.lock b/pubspec.lock index b0d29c4..6bb8079 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,5 +1,5 @@ # Generated by pub -# See https://www.dartlang.org/tools/pub/glossary#lockfile +# See https://dart.dev/tools/pub/glossary#lockfile packages: analyzer: dependency: transitive diff --git a/pubspec.yaml b/pubspec.yaml index 4984d26..0be7aa9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: jpush_flutter description: Offically supported JPush Flutter plugin. -version: 0.0.13 +version: 0.1.0 author: huminios homepage: https://www.jiguang.cn