add debug mode config update to 0.0.7

master
huangminlinux 6 years ago
parent 260459af08
commit 6114053dac

@ -1,4 +1,4 @@
# Generated by pub on 2018-10-08 23:40:55.475551. # Generated by pub on 2018-12-18 11:12:10.903707.
analyzer:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.33.0/lib/ analyzer:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.33.0/lib/
args:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.5.0/lib/ args:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.5.0/lib/
async:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.0.8/lib/ async:file:///Applications/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.0.8/lib/

@ -34,6 +34,6 @@ android {
} }
dependencies { dependencies {
compile 'cn.jiguang.sdk:jpush:3.1.6' // JPush 3.1.6 implementation 'cn.jiguang.sdk:jpush:3.1.6' // JPush 3.1.6
compile 'cn.jiguang.sdk:jcore:1.2.5' // JCore 1.2.5 implementation 'cn.jiguang.sdk:jcore:1.2.5' // JCore 1.2.5
} }

@ -96,8 +96,9 @@ public class JPushPlugin implements MethodCallHandler {
} }
public void setup(MethodCall call, Result result) { public void setup(MethodCall call, Result result) {
HashMap<String, Object> map = call.arguments();
JPushInterface.setDebugMode(true); // 设置开启日志,发布时请关闭日志 boolean debug = (boolean)map.get("debug");
JPushInterface.setDebugMode(debug);
JPushInterface.init(registrar.context()); // 初始化 JPush JPushInterface.init(registrar.context()); // 初始化 JPush
JPushPlugin.instance.dartIsReady = true; JPushPlugin.instance.dartIsReady = true;
@ -227,9 +228,6 @@ public class JPushPlugin implements MethodCallHandler {
} }
/** /**
* ,,广 * ,,广
* :http://docs.jiguang.cn/client/android_api/ * :http://docs.jiguang.cn/client/android_api/

@ -8,6 +8,7 @@
[GeneratedPluginRegistrant registerWithRegistry:self]; [GeneratedPluginRegistrant registerWithRegistry:self];
// Override point for customization after application launch. // Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions]; return [super application:application didFinishLaunchingWithOptions:launchOptions];
} }
@end @end

@ -35,7 +35,8 @@ final JPush jpush = new JPush();
jpush.setup( jpush.setup(
appKey: "a1703c14b186a68a66ef86c1", appKey: "a1703c14b186a68a66ef86c1",
channel: "theChannel", channel: "theChannel",
production: false production: false,
// debug: true,
); );
jpush.applyPushAuthority(new NotificationSettingsIOS( jpush.applyPushAuthority(new NotificationSettingsIOS(
sound: false, sound: false,

@ -136,7 +136,7 @@ packages:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "0.0.5" version: "0.0.7"
js: js:
dependency: transitive dependency: transitive
description: description:

@ -150,8 +150,16 @@ static NSMutableArray<FlutterResult>* getRidResults;
} }
} }
- (void)setup:(FlutterMethodCall*)call result:(FlutterResult)result { - (void)setup:(FlutterMethodCall*)call result:(FlutterResult)result {
NSDictionary *arguments = call.arguments; NSDictionary *arguments = call.arguments;
NSNumber *debug = arguments[@"debug"];
if ([debug boolValue]) {
[JPUSHService setDebugMode];
} else {
[JPUSHService setLogOFF];
}
[JPUSHService setupWithOption:_launchNotification [JPUSHService setupWithOption:_launchNotification
appKey:arguments[@"appKey"] appKey:arguments[@"appKey"]
@ -383,6 +391,8 @@ static NSMutableArray<FlutterResult>* getRidResults;
result(@[@[]]); result(@[@[]]);
} }
- (void)dealloc { - (void)dealloc {
_isJPushDidLogin = NO; _isJPushDidLogin = NO;
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];

@ -29,8 +29,9 @@ class JPush {
String appKey, String appKey,
String channel, String channel,
bool production, bool production,
bool debug = false,
}) { }) {
_channel.invokeMethod('setup', { 'appKey': appKey, 'channel': channel, 'production': production }); _channel.invokeMethod('setup', { 'appKey': appKey, 'channel': channel, 'production': production, 'debug': debug});
} }
/// ///
/// JPush () /// JPush ()
@ -154,6 +155,10 @@ class JPush {
return result; return result;
} }
void setDebugMode() {
_channel.invokeMethod('setDebugMode');
}
/// ///
/// iOS Only /// iOS Only
/// Badge /// Badge

@ -1,6 +1,6 @@
name: jpush_flutter name: jpush_flutter
description: Offically supported JPush Flutter plugin. description: Offically supported JPush Flutter plugin.
version: 0.0.6 version: 0.0.7
author: huminios <h380108184@gmail.com> author: huminios <h380108184@gmail.com>
homepage: https://www.jiguang.cn homepage: https://www.jiguang.cn

Loading…
Cancel
Save