From 6bcb23425c0484e359acb2c7ba22da6bd95e2908 Mon Sep 17 00:00:00 2001 From: xiesubin Date: Thu, 7 Jun 2018 20:04:59 +0800 Subject: [PATCH 01/10] fix --- README.md | 3 + example/app/index.js | 4 +- .../xcshareddata/xcschemes/example.xcscheme | 2 + example/ios/example/AppDelegate.m | 45 ++------- index.js | 5 +- ios/XGPush/XGPushManager.h | 2 + ios/XGPush/XGPushManager.m | 91 ++++++++++++++++++- 7 files changed, 111 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index ddeef61..982023c 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,9 @@ react-native link react-native-xinge-push 5. 再次进行单推/全推,如果能够收到推送,则表明厂商通道集成成功 ###### 注意事项 +消息目前将其理解为两类:静默消息和普通通知 +静默消息不会弹窗,通知会弹窗 + 如果在EMUI 8.0(Android 8)上,出现发通知成功但通知栏不显示的情况,并在Logcat看到以下错误: ``` E/NotificationService: No Channel found for pkg=com.jeepeng.push, channelId=null, id=995033369, tag=null, opPkg=com.huawei.android.pushagent, callingUid=10060, userId=0, incomingUserId=0, notificationUid=10261, notification=Notification(channel=null pri=0 contentView=null vibrate=null sound=default tick defaults=0x1 flags=0x10 color=0x00000000 vis=PRIVATE) diff --git a/example/app/index.js b/example/app/index.js index 517381c..8eb34e7 100644 --- a/example/app/index.js +++ b/example/app/index.js @@ -32,6 +32,7 @@ class Example extends Component { } initPush() { + XGPush.enableDebug(true) // 初始化 if(Platform.OS === 'android') { // 请将1111111111修改为APP的AccessId,10位数字 @@ -93,7 +94,7 @@ class Example extends Component { * @private */ _onMessage(message) { - alert('收到透传消息: ' + message.content); + alert('收到透传消息: ' + JSON.stringify(message.content)); } /** @@ -102,6 +103,7 @@ class Example extends Component { * @private */ _onNotification(notification) { + console.log(notification) if(notification.clicked === true) { alert('app处于后台时收到通知' + JSON.stringify(notification)); } else { diff --git a/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme b/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme index c13a4bf..841adc2 100644 --- a/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme +++ b/example/ios/example.xcodeproj/xcshareddata/xcschemes/example.xcscheme @@ -54,6 +54,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" shouldUseLaunchSchemeArgsEnv = "YES"> = __IPHONE_10_0 -// App 用户点击通知 -// App 用户选择通知中的行为 -// App 用户在通知中心清除消息 -// 无论本地推送还是远程推送都会走这个回调 -- (void)xgPushUserNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { - NSLog(@"[XGPush] click notification"); - if ([response.actionIdentifier isEqualToString:@"xgaction001"]) { - NSLog(@"click from Action1"); - } else if ([response.actionIdentifier isEqualToString:@"xgaction002"]) { - NSLog(@"click from Action2"); - } - - [[XGPush defaultManager] reportXGNotificationResponse:response]; - - completionHandler(); -} -// App 在前台弹通知需要调用这个接口 -- (void)xgPushUserNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler { - [[XGPush defaultManager] reportXGNotificationInfo:notification.request.content.userInfo]; - completionHandler(UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert); -} -#endif @end diff --git a/index.js b/index.js index 1077d4d..a50071e 100644 --- a/index.js +++ b/index.js @@ -24,6 +24,7 @@ const EventMapping = Platform.select({ ios: { register: 'remoteNotificationsRegistered', notification: 'remoteNotificationReceived', + message: 'remoteMessageReceived', localNotification: 'localNotificationReceived', }, }); @@ -118,7 +119,7 @@ class XGPush { static addEventListener(eventType, callback) { let event = EventMapping[eventType]; if (!event) { - console.warn('XGPush only supports `notification`, `register` and `localNotification` events'); + console.warn('XGPush only supports `notification`, `register`, `message` ,and `localNotification` events'); return; } let listener = XGNativeEventEmitter.addListener(event, (data) => { @@ -133,7 +134,7 @@ class XGPush { static removeEventListener(eventType, callback) { if (!EventMapping[eventType]) { - console.warn('XGPush only supports `notification`, `register` and `localNotification` events'); + console.warn('XGPush only supports `notification`, `register`, `message` and `localNotification` events'); return; } let listener = _handlers.get(callback); diff --git a/ios/XGPush/XGPushManager.h b/ios/XGPush/XGPushManager.h index 034d48f..490ad73 100644 --- a/ios/XGPush/XGPushManager.h +++ b/ios/XGPush/XGPushManager.h @@ -19,6 +19,8 @@ typedef void (^RCTRemoteNotificationCallback)(UIBackgroundFetchResult result); + (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; + (void)didReceiveRemoteNotification:(NSDictionary *)notification; + (void)didReceiveRemoteNotification:(NSDictionary *)notification fetchCompletionHandler:(RCTRemoteNotificationCallback)completionHandler; ++ (void)didReceiveRemoteMessage:(NSDictionary *)notification; ++ (void)didReceiveRemoteMessage:(NSDictionary *)notification fetchCompletionHandler:(RCTRemoteNotificationCallback)completionHandler; + (void)didReceiveLocalNotification:(UILocalNotification *)notification; + (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error; #endif diff --git a/ios/XGPush/XGPushManager.m b/ios/XGPush/XGPushManager.m index 04f29c3..71f2f59 100644 --- a/ios/XGPush/XGPushManager.m +++ b/ios/XGPush/XGPushManager.m @@ -16,6 +16,7 @@ #import NSString *const RCTRemoteNotificationReceived = @"RemoteNotificationReceived"; +NSString *const RCTRemoteMessageReceived = @"RemoteMessageReceived"; static NSString *const kLocalNotificationReceived = @"LocalNotificationReceived"; static NSString *const kRemoteNotificationsRegistered = @"RemoteNotificationsRegistered"; @@ -142,6 +143,11 @@ - (void)startObserving selector:@selector(handleLocalNotificationReceived:) name:kLocalNotificationReceived object:nil]; + + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(handleRemoteMessageReceived:) + name:RCTRemoteMessageReceived + object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleRemoteNotificationReceived:) name:RCTRemoteNotificationReceived @@ -169,6 +175,7 @@ - (void)stopObserving { return @[@"localNotificationReceived", @"remoteNotificationReceived", + @"remoteMessageReceived", @"remoteNotificationsRegistered", @"remoteNotificationRegistrationError"]; } @@ -203,6 +210,48 @@ + (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error userInfo:@{@"error": error}]; } +// iOS 10 新增 API +// iOS 10 会走新 API, iOS 10 以前会走到老 API +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0 +// App 用户点击通知 +// App 用户选择通知中的行为 +// App 用户在通知中心清除消息 +// 无论本地推送还是远程推送都会走这个回调 +- (void)xgPushUserNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(void (^)(void))completionHandler { + UNNotification * notification = response.notification; + + if ([response.actionIdentifier isEqualToString:@"xgaction001"]) { + NSLog(@"click from Action1"); + } else if ([response.actionIdentifier isEqualToString:@"xgaction002"]) { + NSLog(@"click from Action2"); + } + UIApplicationState state = [RCTSharedApplication() applicationState]; + NSLog(@"state = %ld, UIApplicationStateActive = %ld", (long)state, (long)UIApplicationStateActive); + BOOL isClicked = (state != UIApplicationStateActive); + NSMutableDictionary *remoteNotification = [NSMutableDictionary dictionaryWithDictionary:notification.request.content.userInfo]; + if(isClicked) { + remoteNotification[@"clicked"] = @YES; + remoteNotification[@"background"] = @YES; + } + NSLog(@"[XGPush] click notification %@", remoteNotification); + NSDictionary * userInfo = @{@"notification": remoteNotification}; + [[NSNotificationCenter defaultCenter] postNotificationName:RCTRemoteNotificationReceived + object:self + userInfo:userInfo]; + [[XGPush defaultManager] reportXGNotificationResponse:response]; + + completionHandler(); +} + +// App 在前台弹通知需要调用这个接口 +- (void)xgPushUserNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler { + NSDictionary * userInfo = notification.request.content.userInfo; + NSLog(@"[XGPush] willPresentNotification notification %@", userInfo); + [[XGPush defaultManager] reportXGNotificationInfo:userInfo]; + completionHandler(UNNotificationPresentationOptionBadge | UNNotificationPresentationOptionSound | UNNotificationPresentationOptionAlert); +} +#endif + + (void)didReceiveRemoteNotification:(NSDictionary *)notification { NSDictionary *userInfo = @{@"notification": notification}; @@ -215,13 +264,33 @@ + (void)didReceiveRemoteNotification:(NSDictionary *)notification fetchCompletionHandler:(RCTRemoteNotificationCallback)completionHandler { NSDictionary *userInfo = @{@"notification": notification, @"completionHandler": completionHandler}; + NSLog(@"%s, notification is %@", __FUNCTION__, notification); [[NSNotificationCenter defaultCenter] postNotificationName:RCTRemoteNotificationReceived object:self userInfo:userInfo]; } ++ (void)didReceiveRemoteMessage:(NSDictionary *)notification +{ + NSDictionary *userInfo = @{@"notification": notification}; + [[NSNotificationCenter defaultCenter] postNotificationName:RCTRemoteMessageReceived + object:self + userInfo:userInfo]; +} + ++ (void)didReceiveRemoteMessage:(NSDictionary *)notification + fetchCompletionHandler:(RCTRemoteNotificationCallback)completionHandler +{ + NSDictionary *userInfo = @{@"notification": notification, @"completionHandler": completionHandler}; + NSLog(@"%s, notification is %@", __FUNCTION__, notification); + [[NSNotificationCenter defaultCenter] postNotificationName:RCTRemoteMessageReceived + object:self + userInfo:userInfo]; +} + + (void)didReceiveLocalNotification:(UILocalNotification *)notification { + NSLog(@"%s, notification is %@", __FUNCTION__, notification); [[NSNotificationCenter defaultCenter] postNotificationName:kLocalNotificationReceived object:self userInfo:RCTFormatLocalNotification(notification)]; @@ -232,6 +301,25 @@ - (void)handleLocalNotificationReceived:(NSNotification *)notification [self sendEventWithName:@"localNotificationReceived" body:notification.userInfo]; } +- (void)handleRemoteMessageReceived:(NSNotification *)notification +{ + NSMutableDictionary *remoteNotification = [NSMutableDictionary dictionary]; + remoteNotification[@"content"] = notification.userInfo[@"notification"]; + RCTRemoteNotificationCallback completionHandler = notification.userInfo[@"completionHandler"]; + NSString *notificationId = [[NSUUID UUID] UUIDString]; + remoteNotification[@"notificationId"] = notificationId; + remoteNotification[@"remote"] = @YES; + if (completionHandler) { + if (!self.remoteNotificationCallbacks) { + // Lazy initialization + self.remoteNotificationCallbacks = [NSMutableDictionary dictionary]; + } + self.remoteNotificationCallbacks[notificationId] = completionHandler; + } + + [self sendEventWithName:@"remoteMessageReceived" body:remoteNotification]; +} + - (void)handleRemoteNotificationReceived:(NSNotification *)notification { NSMutableDictionary *remoteNotification = [NSMutableDictionary dictionaryWithDictionary:notification.userInfo[@"notification"]]; @@ -263,6 +351,7 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification @"code": @(error.code), @"details": error.userInfo, }; + NSLog(@"%s, notification is %@", __FUNCTION__, notification); [self sendEventWithName:@"remoteNotificationRegistrationError" body:errorDetails]; } @@ -512,7 +601,7 @@ - (void)xgPushDidUnbindWithIdentifier:(NSString *)identifier type:(XGPushTokenBi */ RCT_EXPORT_METHOD(startXGWithAppID:(uint64_t)appID appKey:(nonnull NSString *)appKey) { - [[XGPush defaultManager] startXGWithAppID:appID appKey:appKey delegate:self]; + [[XGPush defaultManager] startXGWithAppID:appID appKey:appKey delegate:self]; } /** From 6d10fe73c2bdf56b2a19fba64aca1efd8ed02465 Mon Sep 17 00:00:00 2001 From: xiesubin Date: Thu, 7 Jun 2018 21:35:40 +0800 Subject: [PATCH 02/10] fix bug --- ios/XGPush/XGPushManager.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ios/XGPush/XGPushManager.m b/ios/XGPush/XGPushManager.m index 71f2f59..9804e02 100644 --- a/ios/XGPush/XGPushManager.m +++ b/ios/XGPush/XGPushManager.m @@ -227,10 +227,11 @@ - (void)xgPushUserNotificationCenter:(UNUserNotificationCenter *)center didRecei } UIApplicationState state = [RCTSharedApplication() applicationState]; NSLog(@"state = %ld, UIApplicationStateActive = %ld", (long)state, (long)UIApplicationStateActive); - BOOL isClicked = (state != UIApplicationStateActive); + + BOOL isBackground = (state != UIApplicationStateActive); NSMutableDictionary *remoteNotification = [NSMutableDictionary dictionaryWithDictionary:notification.request.content.userInfo]; - if(isClicked) { - remoteNotification[@"clicked"] = @YES; + remoteNotification[@"clicked"] = @YES; + if(isBackground) { remoteNotification[@"background"] = @YES; } NSLog(@"[XGPush] click notification %@", remoteNotification); From 7c1e55642fa9beeccfceab202ce0f41af6d0f23c Mon Sep 17 00:00:00 2001 From: xiesubin Date: Tue, 12 Jun 2018 16:37:56 +0800 Subject: [PATCH 03/10] fix --- android/src/main/AndroidManifest.xml | 12 ------------ .../react/xgpush/receiver/HWMessageReceiver.java | 11 ----------- 2 files changed, 23 deletions(-) delete mode 100644 android/src/main/java/com/jeepeng/react/xgpush/receiver/HWMessageReceiver.java diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 557aa4b..1885e29 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -14,18 +14,6 @@ - - - - - - - - - - - - diff --git a/android/src/main/java/com/jeepeng/react/xgpush/receiver/HWMessageReceiver.java b/android/src/main/java/com/jeepeng/react/xgpush/receiver/HWMessageReceiver.java deleted file mode 100644 index e5baf11..0000000 --- a/android/src/main/java/com/jeepeng/react/xgpush/receiver/HWMessageReceiver.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.jeepeng.react.xgpush.receiver; - -import com.tencent.android.hwpush.HWPushMessageReceiver; - -/** - * 华为官方推送通道消息接收器 - * Created by Jeepeng on 2018/3/11. - */ - -public class HWMessageReceiver extends HWPushMessageReceiver { -} \ No newline at end of file From 0ae5a93ff391ed8d5f0647d09d1578bdbf26b90b Mon Sep 17 00:00:00 2001 From: xiesubin Date: Tue, 12 Jun 2018 17:02:43 +0800 Subject: [PATCH 04/10] fix --- android/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/android/build.gradle b/android/build.gradle index 18a55d7..2565010 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -16,6 +16,7 @@ android { XG_ACCESS_ID: "", XG_ACCESS_KEY: "", HW_APPID: "", + PACKAGE_NAME: "" ] } From 590ade96e352709ca8fda3d67c66bf1283dc2ae2 Mon Sep 17 00:00:00 2001 From: xiesubin Date: Tue, 12 Jun 2018 17:43:04 +0800 Subject: [PATCH 05/10] fix --- android/build.gradle | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 2565010..fe6236d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -15,8 +15,7 @@ android { manifestPlaceholders = [ XG_ACCESS_ID: "", XG_ACCESS_KEY: "", - HW_APPID: "", - PACKAGE_NAME: "" + HW_APPID: "" ] } From 05a39611067273a2f468b1a1845f6a3af72f8a30 Mon Sep 17 00:00:00 2001 From: xiesubin Date: Tue, 12 Jun 2018 20:29:19 +0800 Subject: [PATCH 06/10] fix --- android/src/main/AndroidManifest.xml | 28 --------- .../xgpush/receiver/MZMessageReceiver.java | 57 ------------------- .../xgpush/receiver/XMMessageReceiver.java | 29 ---------- 3 files changed, 114 deletions(-) delete mode 100644 android/src/main/java/com/jeepeng/react/xgpush/receiver/MZMessageReceiver.java delete mode 100644 android/src/main/java/com/jeepeng/react/xgpush/receiver/XMMessageReceiver.java diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 1885e29..40f5f20 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -14,33 +14,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/src/main/java/com/jeepeng/react/xgpush/receiver/MZMessageReceiver.java b/android/src/main/java/com/jeepeng/react/xgpush/receiver/MZMessageReceiver.java deleted file mode 100644 index a22a6cc..0000000 --- a/android/src/main/java/com/jeepeng/react/xgpush/receiver/MZMessageReceiver.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.jeepeng.react.xgpush.receiver; - -import android.content.Context; - -import com.meizu.cloud.pushsdk.MzPushMessageReceiver; -import com.meizu.cloud.pushsdk.platform.message.PushSwitchStatus; -import com.meizu.cloud.pushsdk.platform.message.RegisterStatus; -import com.meizu.cloud.pushsdk.platform.message.SubAliasStatus; -import com.meizu.cloud.pushsdk.platform.message.SubTagsStatus; -import com.meizu.cloud.pushsdk.platform.message.UnRegisterStatus; - -/** - * 魅族官方推送通道消息接收器 - * Created by Jeepeng on 2018/3/12. - */ - -public class MZMessageReceiver extends MzPushMessageReceiver { - @Override - public void onRegister(Context context, String s) { - - } - - @Override - public void onMessage(Context context, String s) { - - } - - @Override - public void onUnRegister(Context context, boolean b) { - - } - - @Override - public void onPushStatus(Context context, PushSwitchStatus pushSwitchStatus) { - - } - - @Override - public void onRegisterStatus(Context context, RegisterStatus registerStatus) { - - } - - @Override - public void onUnRegisterStatus(Context context, UnRegisterStatus unRegisterStatus) { - - } - - @Override - public void onSubTagsStatus(Context context, SubTagsStatus subTagsStatus) { - - } - - @Override - public void onSubAliasStatus(Context context, SubAliasStatus subAliasStatus) { - - } -} diff --git a/android/src/main/java/com/jeepeng/react/xgpush/receiver/XMMessageReceiver.java b/android/src/main/java/com/jeepeng/react/xgpush/receiver/XMMessageReceiver.java deleted file mode 100644 index 5aa068e..0000000 --- a/android/src/main/java/com/jeepeng/react/xgpush/receiver/XMMessageReceiver.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.jeepeng.react.xgpush.receiver; - -import android.content.Context; - -import com.xiaomi.mipush.sdk.MiPushCommandMessage; -import com.xiaomi.mipush.sdk.MiPushMessage; -import com.xiaomi.mipush.sdk.PushMessageReceiver; - -/** - * 小米官方推送通道消息接收器 - * Created by Jeepeng on 2018/3/12. - */ - -public class XMMessageReceiver extends PushMessageReceiver { - public void onReceivePassThroughMessage(Context context, MiPushMessage message) { - } - - public void onNotificationMessageClicked(Context context, MiPushMessage message) { - } - - public void onNotificationMessageArrived(Context context, MiPushMessage message) { - } - - public void onReceiveRegisterResult(Context context, MiPushCommandMessage message) { - } - - public void onCommandResult(Context context, MiPushCommandMessage message) { - } -} From 172398d81943aafc83fd54bb5c1f6a40abd24185 Mon Sep 17 00:00:00 2001 From: xiesubin Date: Wed, 13 Jun 2018 18:02:16 +0800 Subject: [PATCH 07/10] fix --- .../main/java/com/jeepeng/react/xgpush/PushModule.java | 8 +++++--- .../jeepeng/react/xgpush/receiver/MessageReceiver.java | 4 ---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/android/src/main/java/com/jeepeng/react/xgpush/PushModule.java b/android/src/main/java/com/jeepeng/react/xgpush/PushModule.java index 776a0e2..71aedc4 100644 --- a/android/src/main/java/com/jeepeng/react/xgpush/PushModule.java +++ b/android/src/main/java/com/jeepeng/react/xgpush/PushModule.java @@ -52,9 +52,11 @@ public String getName() { } private void sendEvent(String eventName, @Nullable WritableMap params) { - getReactApplicationContext() - .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) - .emit(eventName, params); + if(getReactApplicationContext().hasActiveCatalystInstance()){ + getReactApplicationContext() + .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class) + .emit(eventName, params); + } } private void registerReceivers() { diff --git a/android/src/main/java/com/jeepeng/react/xgpush/receiver/MessageReceiver.java b/android/src/main/java/com/jeepeng/react/xgpush/receiver/MessageReceiver.java index 18ebb2f..b8f2307 100644 --- a/android/src/main/java/com/jeepeng/react/xgpush/receiver/MessageReceiver.java +++ b/android/src/main/java/com/jeepeng/react/xgpush/receiver/MessageReceiver.java @@ -102,10 +102,6 @@ public void onNotifactionClickedResult(Context context, XGPushClickedResult noti bundle.putString("title", notification.getTitle()); bundle.putString("custom_content", notification.getCustomContent()); intent.putExtra("notification", bundle); - - intent.putExtra("title", notification.getTitle()); - intent.putExtra("content", notification.getContent()); - intent.putExtra("custom_content", notification.getCustomContent()); intent.putExtra("activity", notification.getActivityName()); intent.putExtra("msgId", notification.getMsgId()); intent.putExtra("notificationActionType", notification.getNotificationActionType()); From b498666d378eaeec09f8141a765c22070305f9f9 Mon Sep 17 00:00:00 2001 From: xiesubin Date: Wed, 13 Jun 2018 19:18:44 +0800 Subject: [PATCH 08/10] fix --- .../com/jeepeng/react/xgpush/receiver/MessageReceiver.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/src/main/java/com/jeepeng/react/xgpush/receiver/MessageReceiver.java b/android/src/main/java/com/jeepeng/react/xgpush/receiver/MessageReceiver.java index b8f2307..bbaf9ee 100644 --- a/android/src/main/java/com/jeepeng/react/xgpush/receiver/MessageReceiver.java +++ b/android/src/main/java/com/jeepeng/react/xgpush/receiver/MessageReceiver.java @@ -102,6 +102,9 @@ public void onNotifactionClickedResult(Context context, XGPushClickedResult noti bundle.putString("title", notification.getTitle()); bundle.putString("custom_content", notification.getCustomContent()); intent.putExtra("notification", bundle); + intent.putExtra("title", notification.getTitle()); + intent.putExtra("content", notification.getContent()); + intent.putExtra("custom_content", notification.getCustomContent()); intent.putExtra("activity", notification.getActivityName()); intent.putExtra("msgId", notification.getMsgId()); intent.putExtra("notificationActionType", notification.getNotificationActionType()); From 420a43eb941412bf7df51a42819ab0d2fe57d254 Mon Sep 17 00:00:00 2001 From: xiesubin Date: Wed, 13 Jun 2018 21:52:11 +0800 Subject: [PATCH 09/10] Revert "fix" This reverts commit b498666d378eaeec09f8141a765c22070305f9f9. --- .../com/jeepeng/react/xgpush/receiver/MessageReceiver.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/android/src/main/java/com/jeepeng/react/xgpush/receiver/MessageReceiver.java b/android/src/main/java/com/jeepeng/react/xgpush/receiver/MessageReceiver.java index bbaf9ee..b8f2307 100644 --- a/android/src/main/java/com/jeepeng/react/xgpush/receiver/MessageReceiver.java +++ b/android/src/main/java/com/jeepeng/react/xgpush/receiver/MessageReceiver.java @@ -102,9 +102,6 @@ public void onNotifactionClickedResult(Context context, XGPushClickedResult noti bundle.putString("title", notification.getTitle()); bundle.putString("custom_content", notification.getCustomContent()); intent.putExtra("notification", bundle); - intent.putExtra("title", notification.getTitle()); - intent.putExtra("content", notification.getContent()); - intent.putExtra("custom_content", notification.getCustomContent()); intent.putExtra("activity", notification.getActivityName()); intent.putExtra("msgId", notification.getMsgId()); intent.putExtra("notificationActionType", notification.getNotificationActionType()); From 5753ad4c816242826ee6cd1569ebdf587f16198b Mon Sep 17 00:00:00 2001 From: xiesubin Date: Thu, 14 Jun 2018 22:16:26 +0800 Subject: [PATCH 10/10] fix --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 91d9f6c..9355d73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-xinge-push", - "version": "0.7.0", + "version": "0.8.0", "description": "Xinge push for react-native", "main": "index.js", "scripts": { @@ -8,7 +8,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/Jeepeng/react-native-xinge-push.git" + "url": "git+https://github.com/wanxsb/react-native-xinge-push.git" }, "keywords": [ "xinge", @@ -19,7 +19,7 @@ "author": "Jeepeng", "license": "Apache-2.0", "bugs": { - "url": "https://github.com/Jeepeng/react-native-xinge-push/issues" + "url": "https://github.com/wanxsb/react-native-xinge-push/issues" }, - "homepage": "https://github.com/Jeepeng/react-native-xinge-push#readme" + "homepage": "https://github.com/wanxsb/react-native-xinge-push#readme" }