Skip to content

Commit

Permalink
修复sendLocalNotification crash 问题,修复 iOS 启动角标自动消失,更新 配置
Browse files Browse the repository at this point in the history
  • Loading branch information
raoxudong committed Aug 23, 2019
1 parent 54967f5 commit 625aeb7
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 78 deletions.
110 changes: 55 additions & 55 deletions .packages
Original file line number Diff line number Diff line change
@@ -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-21 16:32:49.978054.
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/
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.2.0
+ 修复:调用 sendLocalNotification 接口 crash 问题;
+ 修复:iOS 启动 APP 角标自动消失问题;
+ 修复执行 flutter build apk 打包错误问题;
+ 更新配置

## 0.0.13

featurn:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

```yaml
dependencies:
jpush_flutter: 0.0.13
jpush_flutter: 0.2.0
```
### 配置
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rootProject.allprojects {
apply plugin: 'com.android.library'

android {
compileSdkVersion 27
compileSdkVersion 28

defaultConfig {
minSdkVersion 16
Expand All @@ -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')

}
21 changes: 17 additions & 4 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand All @@ -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"
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.android.tools.build:gradle:3.1.2'
}
}

Expand Down
4 changes: 2 additions & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions example/android/key.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
storePassword=<password from previous step>
keyPassword=<password from previous step>
keyAlias=key
storeFile=<location of the key store file, e.g. /Users/<user name>/key.jks>
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.12"
version: "0.2.0"
js:
dependency: transitive
description:
Expand Down
3 changes: 2 additions & 1 deletion example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -48,6 +49,6 @@ test('requestNotificationPermissions on ios with custom permissions', () {
<String, bool>{'sound': false, 'badge': true, 'alert': true}));
});

*/

}
16 changes: 8 additions & 8 deletions ios/Classes/JPushPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ - (void)sendLocalNotification:(FlutterMethodCall*)call result:(FlutterResult)res
content.title = params[@"title"];
}

if (![params[@"subtitle"] isEqualToString:@"<null>"]) {
if (params[@"subtitle"] && ![params[@"subtitle"] isEqualToString:@"<null>"]) {
content.subtitle = params[@"subtitle"];
}

Expand All @@ -338,15 +338,15 @@ - (void)sendLocalNotification:(FlutterMethodCall*)call result:(FlutterResult)res
content.badge = params[@"badge"];
}

if (![params[@"action"] isEqualToString:@"<null>"]) {
if (params[@"action"] && ![params[@"action"] isEqualToString:@"<null>"]) {
content.action = params[@"action"];
}

if (![params[@"extra"] isEqualToString:@"<null>"]) {
content.userInfo = params[@"extra"];
}
if ([params[@"extra"] isKindOfClass:[NSDictionary class]]) {
content.userInfo = params[@"extra"];
}

if (![params[@"sound"] isEqualToString:@"<null>"]) {
if (params[@"sound"] && ![params[@"sound"] isEqualToString:@"<null>"]) {
content.sound = params[@"sound"];
}

Expand Down Expand Up @@ -424,8 +424,8 @@ - (void)applicationDidEnterBackground:(UIApplication *)application {
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
application.applicationIconBadgeNumber = 1;
application.applicationIconBadgeNumber = 0;
// application.applicationIconBadgeNumber = 1;
// application.applicationIconBadgeNumber = 0;
}

- (bool)application:(UIApplication *)application
Expand Down
2 changes: 1 addition & 1 deletion lib/jpush_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class LocalNotification {
'badge': badge,
'soundName': soundName,
'subtitle': subtitle
};
}..removeWhere((key, value)=>value==null);
}

}
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: jpush_flutter
description: Offically supported JPush Flutter plugin.
version: 0.0.13
version: 0.2.0
author: huminios <h380108184@gmail.com>
homepage: https://www.jiguang.cn

Expand Down

0 comments on commit 625aeb7

Please sign in to comment.