@onekeyfe/react-native-jpush 0.0.0-stage → 6.7.0-alpha.435
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +23 -2
- package/ReactNativeJpush.podspec +66 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +143 -0
- package/android/gradle.properties +4 -0
- package/android/src/main/AndroidManifest.xml +143 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/cn/android/service/JTransitActivity.java +19 -0
- package/android/src/main/java/cn/jiguang/android/BuildConfig.java +10 -0
- package/android/src/main/java/cn/jiguang/android/IDataShare.java +190 -0
- package/android/src/main/java/cn/jiguang/api/BaseLogger.java +82 -0
- package/android/src/main/java/cn/jiguang/api/JAction.java +22 -0
- package/android/src/main/java/cn/jiguang/api/JActionExtra.java +21 -0
- package/android/src/main/java/cn/jiguang/api/JAnalyticsAction.java +11 -0
- package/android/src/main/java/cn/jiguang/api/JCoreInterface.java +228 -0
- package/android/src/main/java/cn/jiguang/api/JCoreManager.java +156 -0
- package/android/src/main/java/cn/jiguang/api/JDispatchAction.java +66 -0
- package/android/src/main/java/cn/jiguang/api/MultiSpHelper.java +114 -0
- package/android/src/main/java/cn/jiguang/api/ReportCallBack.java +9 -0
- package/android/src/main/java/cn/jiguang/api/SdkType.java +13 -0
- package/android/src/main/java/cn/jiguang/api/utils/JCollectionAuth.java +23 -0
- package/android/src/main/java/cn/jiguang/core/JCoreCrypto.java +545 -0
- package/android/src/main/java/cn/jiguang/core/JCoreStorage.java +737 -0
- package/android/src/main/java/cn/jiguang/core/JCoreTcpEngine.java +1394 -0
- package/android/src/main/java/cn/jiguang/core/JCoreWireCodec.java +1716 -0
- package/android/src/main/java/cn/jiguang/internal/ActionManager.java +63 -0
- package/android/src/main/java/cn/jiguang/internal/JConstants.java +61 -0
- package/android/src/main/java/cn/jiguang/internal/JCoreHelperAction.java +12 -0
- package/android/src/main/java/cn/jiguang/internal/JCoreInternalHelper.java +102 -0
- package/android/src/main/java/cn/jiguang/net/DefaultHostVerifier.java +40 -0
- package/android/src/main/java/cn/jiguang/net/HttpRequest.java +78 -0
- package/android/src/main/java/cn/jiguang/net/HttpResponse.java +48 -0
- package/android/src/main/java/cn/jiguang/net/HttpUtils.java +106 -0
- package/android/src/main/java/cn/jiguang/plugins/core/JCoreModule.java +91 -0
- package/android/src/main/java/cn/jiguang/plugins/core/JCorePackage.java +27 -0
- package/android/src/main/java/cn/jiguang/plugins/push/JPushModule.java +773 -0
- package/android/src/main/java/cn/jiguang/plugins/push/JPushPackage.java +25 -0
- package/android/src/main/java/cn/jiguang/plugins/push/common/JConstants.java +88 -0
- package/android/src/main/java/cn/jiguang/plugins/push/common/JLogger.java +122 -0
- package/android/src/main/java/cn/jiguang/plugins/push/helper/JPushHelper.java +710 -0
- package/android/src/main/java/cn/jiguang/plugins/push/receiver/JPushBroadcastReceiver.java +37 -0
- package/android/src/main/java/cn/jiguang/plugins/push/receiver/JPushModuleReceiver.java +264 -0
- package/android/src/main/java/cn/jiguang/plugins/service/JCoreModuleService.java +7 -0
- package/android/src/main/java/cn/jpush/android/api/BasicPushNotificationBuilder.java +83 -0
- package/android/src/main/java/cn/jpush/android/api/CallBackParams.java +50 -0
- package/android/src/main/java/cn/jpush/android/api/CmdMessage.java +33 -0
- package/android/src/main/java/cn/jpush/android/api/CustomMessage.java +28 -0
- package/android/src/main/java/cn/jpush/android/api/CustomPushNotificationBuilder.java +81 -0
- package/android/src/main/java/cn/jpush/android/api/DefaultPushNotificationBuilder.java +90 -0
- package/android/src/main/java/cn/jpush/android/api/InAppSlotParams.java +65 -0
- package/android/src/main/java/cn/jpush/android/api/InstrumentedActivity.java +17 -0
- package/android/src/main/java/cn/jpush/android/api/InstrumentedListActivity.java +17 -0
- package/android/src/main/java/cn/jpush/android/api/JPushInterface.java +488 -0
- package/android/src/main/java/cn/jpush/android/api/JPushMessage.java +121 -0
- package/android/src/main/java/cn/jpush/android/api/JThirdPlatFormInterface.java +147 -0
- package/android/src/main/java/cn/jpush/android/api/MultiActionsNotificationBuilder.java +72 -0
- package/android/src/main/java/cn/jpush/android/api/NotificationCustomButton.java +50 -0
- package/android/src/main/java/cn/jpush/android/api/NotificationMessage.java +67 -0
- package/android/src/main/java/cn/jpush/android/api/PushNotificationBuilder.java +13 -0
- package/android/src/main/java/cn/jpush/android/api/TagAliasCallback.java +8 -0
- package/android/src/main/java/cn/jpush/android/data/JPushCollectControl.java +96 -0
- package/android/src/main/java/cn/jpush/android/data/JPushConfig.java +79 -0
- package/android/src/main/java/cn/jpush/android/data/JPushConfigEx.java +41 -0
- package/android/src/main/java/cn/jpush/android/data/JPushLocalNotification.java +155 -0
- package/android/src/main/java/cn/jpush/android/helper/JCoreHelper.java +70 -0
- package/android/src/main/java/cn/jpush/android/helper/Logger.java +82 -0
- package/android/src/main/java/cn/jpush/android/local/ActionHelper.java +1198 -0
- package/android/src/main/java/cn/jpush/android/local/ActivityLifeCallBack.java +47 -0
- package/android/src/main/java/cn/jpush/android/local/JPushAction.java +67 -0
- package/android/src/main/java/cn/jpush/android/local/JPushConstants.java +34 -0
- package/android/src/main/java/cn/jpush/android/local/JPushResponse.java +26 -0
- package/android/src/main/java/cn/jpush/android/local/ProxyActivityAction.java +34 -0
- package/android/src/main/java/cn/jpush/android/service/AlarmReceiver.java +15 -0
- package/android/src/main/java/cn/jpush/android/service/BActivity.java +19 -0
- package/android/src/main/java/cn/jpush/android/service/DActivity.java +19 -0
- package/android/src/main/java/cn/jpush/android/service/DaemonService.java +17 -0
- package/android/src/main/java/cn/jpush/android/service/DataProvider.java +136 -0
- package/android/src/main/java/cn/jpush/android/service/DataShare.java +129 -0
- package/android/src/main/java/cn/jpush/android/service/DownloadProvider.java +139 -0
- package/android/src/main/java/cn/jpush/android/service/InitProvider.java +48 -0
- package/android/src/main/java/cn/jpush/android/service/JCommonService.java +79 -0
- package/android/src/main/java/cn/jpush/android/service/JNotifyActivity.java +28 -0
- package/android/src/main/java/cn/jpush/android/service/JPushMessageReceiver.java +93 -0
- package/android/src/main/java/cn/jpush/android/service/PushReceiver.java +26 -0
- package/android/src/main/java/cn/jpush/android/service/PushService.java +28 -0
- package/android/src/main/java/cn/jpush/android/service/SchedulerReceiver.java +17 -0
- package/android/src/main/java/cn/jpush/android/service/TagAliasReceiver.java +11 -0
- package/android/src/main/java/cn/jpush/android/service/WakedResultReceiver.java +24 -0
- package/android/src/main/java/cn/jpush/android/ui/FullScreenView.java +11 -0
- package/android/src/main/java/cn/jpush/android/ui/PopWinActivity.java +16 -0
- package/android/src/main/java/cn/jpush/android/ui/PushActivity.java +27 -0
- package/android/src/main/java/cn/jpush/android/ui/RoundedImageView.java +63 -0
- package/android/src/main/java/cn/jpush/android/ui/ShadowViewCard.java +56 -0
- package/android/src/main/java/cn/jpush/android/ups/ICallbackResult.java +5 -0
- package/android/src/main/java/cn/jpush/android/ups/JPushUPSManager.java +37 -0
- package/android/src/main/java/cn/jpush/android/ups/TokenResult.java +47 -0
- package/android/src/main/java/cn/jpush/android/ups/UPSRegisterCallBack.java +4 -0
- package/android/src/main/java/cn/jpush/android/ups/UPSTurnCallBack.java +4 -0
- package/android/src/main/java/cn/jpush/android/ups/UPSUnRegisterCallBack.java +4 -0
- package/android/src/main/java/com/margelo/nitro/reactnativejpush/ReactNativeJpush.kt +455 -0
- package/android/src/main/java/com/margelo/nitro/reactnativejpush/ReactNativeJpushPackage.kt +50 -0
- package/android/src/main/res/values/jpush_string.xml +7 -0
- package/android/src/main/res/values/jpush_style.xml +22 -0
- package/android/src/test/java/com/margelo/nitro/reactnativejpush/ReactNativeJpushProtocolTest.java +1016 -0
- package/ios/ReactNativeJpush.swift +522 -0
- package/ios/bridge/RCTJCoreModule.h +5 -0
- package/ios/bridge/RCTJCoreModule.m +31 -0
- package/ios/bridge/RCTJPushEventQueue.h +14 -0
- package/ios/bridge/RCTJPushEventQueue.m +23 -0
- package/ios/bridge/RCTJPushModule.h +37 -0
- package/ios/bridge/RCTJPushModule.m +1165 -0
- package/ios/include/JCOREService.h +3 -0
- package/ios/include/JGCOREAPI.h +14 -0
- package/ios/include/JGInforCollectionAuth.h +17 -0
- package/ios/include/JGInforCollectionAuthItems.h +2 -0
- package/ios/include/JGPushNotificationTrigger.h +2 -0
- package/ios/include/JPUSHService.h +359 -0
- package/ios/jcore/JCOREConfiguration.h +141 -0
- package/ios/jcore/JCOREConfiguration.m +703 -0
- package/ios/jcore/JCORECrypto.h +73 -0
- package/ios/jcore/JCORECrypto.m +649 -0
- package/ios/jcore/JCORESisResolver.h +56 -0
- package/ios/jcore/JCORESisResolver.m +525 -0
- package/ios/jcore/JCORETcpSession.h +42 -0
- package/ios/jcore/JCORETcpSession.m +956 -0
- package/ios/jcore/JCOREWireProtocol.h +274 -0
- package/ios/jcore/JCOREWireProtocol.m +1453 -0
- package/ios/jpush/JPUSHModels.m +214 -0
- package/ios/jpush/JPUSHNotificationManager.h +34 -0
- package/ios/jpush/JPUSHNotificationManager.m +360 -0
- package/ios/jpush/JPUSHService.m +794 -0
- package/ios/tests/ReactNativeJpushTests.m +148 -0
- package/lib/module/ReactNativeJpush.nitro.js +4 -0
- package/lib/module/ReactNativeJpush.nitro.js.map +1 -0
- package/lib/module/index.js +801 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/ReactNativeJpush.nitro.d.ts +60 -0
- package/lib/typescript/src/ReactNativeJpush.nitro.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +235 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/nitro.json +23 -0
- package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +75 -0
- package/nitrogen/generated/android/c++/JFunc_void_std__string_std__string.hpp +76 -0
- package/nitrogen/generated/android/c++/JHybridReactNativeJpushSpec.cpp +310 -0
- package/nitrogen/generated/android/c++/JHybridReactNativeJpushSpec.hpp +115 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativejpush/Func_void_bool.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativejpush/Func_void_std__string_std__string.kt +78 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativejpush/HybridReactNativeJpushSpec.kt +274 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativejpush/reactnativejpushOnLoad.kt +35 -0
- package/nitrogen/generated/android/reactnativejpush+autolinking.cmake +81 -0
- package/nitrogen/generated/android/reactnativejpush+autolinking.gradle +27 -0
- package/nitrogen/generated/android/reactnativejpushOnLoad.cpp +58 -0
- package/nitrogen/generated/android/reactnativejpushOnLoad.hpp +34 -0
- package/nitrogen/generated/ios/ReactNativeJpush+autolinking.rb +62 -0
- package/nitrogen/generated/ios/ReactNativeJpush-Swift-Cxx-Bridge.cpp +49 -0
- package/nitrogen/generated/ios/ReactNativeJpush-Swift-Cxx-Bridge.hpp +147 -0
- package/nitrogen/generated/ios/ReactNativeJpush-Swift-Cxx-Umbrella.hpp +46 -0
- package/nitrogen/generated/ios/ReactNativeJpushAutolinking.mm +33 -0
- package/nitrogen/generated/ios/ReactNativeJpushAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridReactNativeJpushSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridReactNativeJpushSpecSwift.hpp +402 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__string_std__string.swift +46 -0
- package/nitrogen/generated/ios/swift/HybridReactNativeJpushSpec.swift +107 -0
- package/nitrogen/generated/ios/swift/HybridReactNativeJpushSpec_cxx.swift +723 -0
- package/nitrogen/generated/shared/c++/HybridReactNativeJpushSpec.cpp +73 -0
- package/nitrogen/generated/shared/c++/HybridReactNativeJpushSpec.hpp +116 -0
- package/package.json +173 -4
- package/src/ReactNativeJpush.nitro.ts +93 -0
- package/src/index.tsx +1090 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
package cn.jpush.android.api;
|
|
2
|
+
|
|
3
|
+
import java.io.Serializable;
|
|
4
|
+
import java.util.Map;
|
|
5
|
+
import java.util.Set;
|
|
6
|
+
|
|
7
|
+
public class JPushMessage implements Serializable {
|
|
8
|
+
private static final long serialVersionUID = 1L;
|
|
9
|
+
private int protoType = 0;
|
|
10
|
+
private int action = 0;
|
|
11
|
+
private String alias;
|
|
12
|
+
private Set<String> tags;
|
|
13
|
+
private Map<String, Object> pros;
|
|
14
|
+
private String checkTag;
|
|
15
|
+
private int errorCode;
|
|
16
|
+
private boolean tagCheckStateResult;
|
|
17
|
+
private boolean tagCheckOperator;
|
|
18
|
+
private int sequence;
|
|
19
|
+
private String mobileNumber;
|
|
20
|
+
|
|
21
|
+
public String getAlias() {
|
|
22
|
+
return alias;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public void setAlias(String alias) {
|
|
26
|
+
this.alias = alias;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public Set<String> getTags() {
|
|
30
|
+
return tags;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public void setTags(Set<String> tags) {
|
|
34
|
+
this.tags = tags;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public Map<String, Object> getPros() {
|
|
38
|
+
return pros;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public void setPros(Map<String, Object> pros) {
|
|
42
|
+
this.pros = pros;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public int getErrorCode() {
|
|
46
|
+
return errorCode;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public void setErrorCode(int errorCode) {
|
|
50
|
+
this.errorCode = errorCode;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public int getSequence() {
|
|
54
|
+
return sequence;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
public void setSequence(int sequence) {
|
|
58
|
+
this.sequence = sequence;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public String getCheckTag() {
|
|
62
|
+
return checkTag;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public void setCheckTag(String checkTag) {
|
|
66
|
+
this.checkTag = checkTag;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public boolean getTagCheckStateResult() {
|
|
70
|
+
return tagCheckStateResult;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
public void setTagCheckStateResult(boolean tagCheckStateResult) {
|
|
74
|
+
this.tagCheckStateResult = tagCheckStateResult;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public boolean isTagCheckOperator() {
|
|
78
|
+
return tagCheckOperator;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
public void setTagCheckOperator(boolean tagCheckOperator) {
|
|
82
|
+
this.tagCheckOperator = tagCheckOperator;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public String getMobileNumber() {
|
|
86
|
+
return mobileNumber;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public void setMobileNumber(String mobileNumber) {
|
|
90
|
+
this.mobileNumber = mobileNumber;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
public int getProtoType() {
|
|
94
|
+
return protoType;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
public void setProtoType(int protoType) {
|
|
98
|
+
this.protoType = protoType;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
public int getAction() {
|
|
102
|
+
return action;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public void setAction(int action) {
|
|
106
|
+
this.action = action;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@Override
|
|
110
|
+
public String toString() {
|
|
111
|
+
return "JPushMessage{alias='" + alias
|
|
112
|
+
+ "', tags=" + tags
|
|
113
|
+
+ ", pros=" + pros
|
|
114
|
+
+ ", checkTag='" + checkTag
|
|
115
|
+
+ "', errorCode=" + errorCode
|
|
116
|
+
+ ", tagCheckStateResult=" + tagCheckStateResult
|
|
117
|
+
+ ", isTagCheckOperator=" + tagCheckOperator
|
|
118
|
+
+ ", sequence=" + sequence
|
|
119
|
+
+ ", mobileNumber=" + mobileNumber + '}';
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
package cn.jpush.android.api;
|
|
2
|
+
|
|
3
|
+
import android.app.Notification;
|
|
4
|
+
import android.content.Context;
|
|
5
|
+
import android.os.Bundle;
|
|
6
|
+
import cn.jiguang.core.JCoreCrypto;
|
|
7
|
+
import cn.jpush.android.helper.JCoreHelper;
|
|
8
|
+
import cn.jpush.android.local.ActionHelper;
|
|
9
|
+
import org.json.JSONObject;
|
|
10
|
+
|
|
11
|
+
public abstract class JThirdPlatFormInterface {
|
|
12
|
+
public static final String ACTION_NOTIFICATION_SHOW = "action_notification_show";
|
|
13
|
+
public static final String ACTION_NOTIFICATION_ARRIVED = "action_notification_arrived";
|
|
14
|
+
public static final String ACTION_NOTIFICATION_UN_SHOW = "action_notification_unshow";
|
|
15
|
+
public static final String ACTION_NOTIFICATION_CLCKED = "action_notification_clicked";
|
|
16
|
+
public static final String ACTION_NOTIFICATION_CUSTOM_BUTTON_CLCKED = "action_notification_custom_button_clcked";
|
|
17
|
+
public static final String ACTION_REGISTER_TOKEN = "action_register_token";
|
|
18
|
+
public static final String ACTION_SEND_EXCEPTION = "action_send_exception";
|
|
19
|
+
public static final String KEY_DATA = "data";
|
|
20
|
+
public static final String KEY_MSG_ID = "msg_id";
|
|
21
|
+
public static final String KEY_NOTI_ID = "noti_id";
|
|
22
|
+
public static final String KEY_PLATFORM = "platform";
|
|
23
|
+
public static final String KEY_CODE = "code";
|
|
24
|
+
public static final String KEY_MSG = "msg";
|
|
25
|
+
public static final String KEY_ROM_TYPE = "rom_type";
|
|
26
|
+
public static final String EXCEPTION_TYPE = "exception_type";
|
|
27
|
+
public static final String KEY_EXTRA = "extra";
|
|
28
|
+
public static final String KEY_VENDOR_SDK_VER = "vendor_sdk_ver";
|
|
29
|
+
public static final String KEY_PLUGIN_SDK_VER = "plugin_sdk_ver";
|
|
30
|
+
public static final String KEY_VENDOR_PUSH_APP_KEY_MISS = "j10000";
|
|
31
|
+
public static final String KEY_VENDOR_PUSH_INIT_UNKNOWN_EXCEPTION = "j10001";
|
|
32
|
+
public static final String KEY_VENDOR_PUSH_STATUS_EXCEPTION = "j10002";
|
|
33
|
+
public static final String KEY_VENDOR_PUSH_MANUFACTURE_UNKNOWN = "j10003";
|
|
34
|
+
public static final int CMD_CALL_BACK = 10000;
|
|
35
|
+
public static final String KEY_TOKEN = "token";
|
|
36
|
+
public static final String ACTION_PLUGIN_PALTFORM_REQUEST_REGID = "intent.plugin.platform.REQUEST_REGID";
|
|
37
|
+
public static final String ACTION_PLUGIN_PALTFORM_REFRESSH_REGID = "intent.plugin.platform.REFRESSH_REGID";
|
|
38
|
+
public static final String ACTION_PLUGIN_PALTFORM_ON_MESSAGING = "intent.plugin.platform.ON_MESSAGING";
|
|
39
|
+
|
|
40
|
+
public abstract void init(Context context);
|
|
41
|
+
|
|
42
|
+
public abstract String getToken(Context context);
|
|
43
|
+
|
|
44
|
+
public abstract boolean isSupport(Context context);
|
|
45
|
+
|
|
46
|
+
public abstract byte getRomType(Context context);
|
|
47
|
+
|
|
48
|
+
public abstract void register(Context context, Bundle bundle);
|
|
49
|
+
|
|
50
|
+
public void stopPush(Context context) {
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public void resumePush(Context context) {
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public abstract String getRomName();
|
|
57
|
+
|
|
58
|
+
public abstract String getAppkey(Context context);
|
|
59
|
+
|
|
60
|
+
public abstract String getAppId(Context context);
|
|
61
|
+
|
|
62
|
+
public abstract boolean isNeedClearToken(Context context);
|
|
63
|
+
|
|
64
|
+
public abstract void clearNotification(Context context, int notificationId);
|
|
65
|
+
|
|
66
|
+
public abstract void clearAllNotification(Context context);
|
|
67
|
+
|
|
68
|
+
public boolean needSendToMainProcess() {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public static void onEvent(Thread thread, Throwable error) {
|
|
73
|
+
ActionHelper.getInstance().onEvent(thread, error);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public static void doAction(Context context, String action, Bundle bundle) {
|
|
77
|
+
Bundle target = bundle != null ? bundle : new Bundle();
|
|
78
|
+
target.putString("third_key_action", action);
|
|
79
|
+
ActionHelper.getInstance().doAction(context, "third_action", target);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public static int getNofiticationID(String msgId, int defaultId) {
|
|
83
|
+
return msgId != null ? Math.abs(msgId.hashCode()) : defaultId;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
public static void sendActionByJCore(Context context, Bundle bundle, String action) {
|
|
87
|
+
JCoreHelper.runActionWithService(context, "JPUSH", action, bundle);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
public static String toHash(String input) {
|
|
91
|
+
return JCoreCrypto.md5Hex(input);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
public static void setNotificationChannel(
|
|
95
|
+
Context context,
|
|
96
|
+
Notification.Builder builder,
|
|
97
|
+
String channelId,
|
|
98
|
+
CharSequence channelName,
|
|
99
|
+
int priority,
|
|
100
|
+
int defaults,
|
|
101
|
+
int importance
|
|
102
|
+
) {
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
public static void setNotificationChannel(
|
|
106
|
+
Context context,
|
|
107
|
+
Notification.Builder builder,
|
|
108
|
+
String channelId,
|
|
109
|
+
CharSequence channelName,
|
|
110
|
+
int priority,
|
|
111
|
+
int defaults,
|
|
112
|
+
String sound,
|
|
113
|
+
int importance
|
|
114
|
+
) {
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public static void setNotification(
|
|
118
|
+
Context context,
|
|
119
|
+
Notification notification,
|
|
120
|
+
String channelId,
|
|
121
|
+
CharSequence channelName,
|
|
122
|
+
int priority,
|
|
123
|
+
int defaults,
|
|
124
|
+
String sound,
|
|
125
|
+
int importance
|
|
126
|
+
) {
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
public static void reportThirdSDKMsgActionResult(String msgId, String extra, byte platform, long code, Context context) {
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
public static NotificationMessage parseMessage(Context context, String rawJson) {
|
|
133
|
+
NotificationMessage message = new NotificationMessage();
|
|
134
|
+
message.context = context;
|
|
135
|
+
if (rawJson != null) {
|
|
136
|
+
try {
|
|
137
|
+
JSONObject json = new JSONObject(rawJson);
|
|
138
|
+
message.msgId = json.optString("msg_id", "");
|
|
139
|
+
message.notificationTitle = json.optString("n_title", "");
|
|
140
|
+
message.notificationContent = json.optString("n_content", "");
|
|
141
|
+
message.notificationExtras = json.optString("n_extras", "");
|
|
142
|
+
} catch (Throwable ignored) {
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return message;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
package cn.jpush.android.api;
|
|
2
|
+
|
|
3
|
+
import android.app.Notification;
|
|
4
|
+
import android.app.PendingIntent;
|
|
5
|
+
import android.content.Context;
|
|
6
|
+
import android.content.Intent;
|
|
7
|
+
import cn.jpush.android.service.JNotifyActivity;
|
|
8
|
+
import org.json.JSONArray;
|
|
9
|
+
import org.json.JSONException;
|
|
10
|
+
import org.json.JSONObject;
|
|
11
|
+
|
|
12
|
+
public class MultiActionsNotificationBuilder extends DefaultPushNotificationBuilder {
|
|
13
|
+
protected Context mContext;
|
|
14
|
+
private JSONArray actionJSONArray = new JSONArray();
|
|
15
|
+
|
|
16
|
+
public MultiActionsNotificationBuilder(Context context) {
|
|
17
|
+
this.mContext = context;
|
|
18
|
+
this.context = context;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public void addJPushAction(int iconResId, String actionText, String actionExtra) {
|
|
22
|
+
JSONObject action = new JSONObject();
|
|
23
|
+
try {
|
|
24
|
+
action.put("notification_action_res_id", iconResId);
|
|
25
|
+
action.put("notification_action_text", actionText);
|
|
26
|
+
action.put("notification_action_extra_string", actionExtra);
|
|
27
|
+
this.actionJSONArray.put(action);
|
|
28
|
+
} catch (JSONException ignored) {
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@Override
|
|
33
|
+
Notification getNotification(Notification.Builder builder) {
|
|
34
|
+
for (int i = 0; i < this.actionJSONArray.length(); i++) {
|
|
35
|
+
try {
|
|
36
|
+
JSONObject action = this.actionJSONArray.getJSONObject(i);
|
|
37
|
+
Intent intent = new Intent("cn.jpush.android.intent.NOTIFICATION_CLICK_ACTION_PROXY");
|
|
38
|
+
intent.putExtra(JPushInterface.EXTRA_NOTIFICATION_ACTION_EXTRA, action.optString("notification_action_extra_string"));
|
|
39
|
+
intent.setClass(this.mContext, JNotifyActivity.class);
|
|
40
|
+
intent.putExtra("isNotification", true);
|
|
41
|
+
intent.putExtra("multi_notification_msg", this.notificationMessage);
|
|
42
|
+
PendingIntent pendingIntent = PendingIntent.getActivity(
|
|
43
|
+
this.mContext,
|
|
44
|
+
i,
|
|
45
|
+
intent,
|
|
46
|
+
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE
|
|
47
|
+
);
|
|
48
|
+
builder.addAction(
|
|
49
|
+
action.optInt("notification_action_res_id"),
|
|
50
|
+
action.optString("notification_action_text"),
|
|
51
|
+
pendingIntent
|
|
52
|
+
).setAutoCancel(true);
|
|
53
|
+
} catch (Throwable ignored) {
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return builder.build();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
public static PushNotificationBuilder parseFromPreference(Context context, String rawJson) {
|
|
60
|
+
MultiActionsNotificationBuilder builder = new MultiActionsNotificationBuilder(context);
|
|
61
|
+
try {
|
|
62
|
+
builder.actionJSONArray = new JSONArray(rawJson);
|
|
63
|
+
} catch (JSONException ignored) {
|
|
64
|
+
}
|
|
65
|
+
return builder;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@Override
|
|
69
|
+
public String toString() {
|
|
70
|
+
return this.actionJSONArray.toString();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
package cn.jpush.android.api;
|
|
2
|
+
|
|
3
|
+
import java.io.Serializable;
|
|
4
|
+
|
|
5
|
+
public class NotificationCustomButton implements Serializable {
|
|
6
|
+
private static final long serialVersionUID = 1L;
|
|
7
|
+
|
|
8
|
+
public String msgId;
|
|
9
|
+
public int platform;
|
|
10
|
+
public String name;
|
|
11
|
+
public int actionType;
|
|
12
|
+
public String action;
|
|
13
|
+
public String data;
|
|
14
|
+
|
|
15
|
+
// Public field aliases accessed directly by JPushHelper in jpush-react-native.
|
|
16
|
+
public String a;
|
|
17
|
+
public int b;
|
|
18
|
+
public String c;
|
|
19
|
+
public int d;
|
|
20
|
+
public String e;
|
|
21
|
+
public String f;
|
|
22
|
+
|
|
23
|
+
public NotificationCustomButton() {
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public NotificationCustomButton(String msgId, int platform, String name, int actionType, String action, String data) {
|
|
27
|
+
this.msgId = msgId;
|
|
28
|
+
this.platform = platform;
|
|
29
|
+
this.name = name;
|
|
30
|
+
this.actionType = actionType;
|
|
31
|
+
this.action = action;
|
|
32
|
+
this.data = data;
|
|
33
|
+
this.a = msgId;
|
|
34
|
+
this.b = platform;
|
|
35
|
+
this.c = name;
|
|
36
|
+
this.d = actionType;
|
|
37
|
+
this.e = action;
|
|
38
|
+
this.f = data;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@Override
|
|
42
|
+
public String toString() {
|
|
43
|
+
return "NotificationCustomButton{msgId='" + (msgId != null ? msgId : a)
|
|
44
|
+
+ "', platform=" + (platform != 0 ? platform : b)
|
|
45
|
+
+ ", name='" + (name != null ? name : c)
|
|
46
|
+
+ "', actionType=" + (actionType != 0 ? actionType : d)
|
|
47
|
+
+ ", action='" + (action != null ? action : e)
|
|
48
|
+
+ "', data=" + (data != null ? data : f) + '}';
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
package cn.jpush.android.api;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import java.io.Serializable;
|
|
5
|
+
import java.util.ArrayList;
|
|
6
|
+
import org.json.JSONArray;
|
|
7
|
+
|
|
8
|
+
public class NotificationMessage implements Serializable {
|
|
9
|
+
private static final long serialVersionUID = 1L;
|
|
10
|
+
public String appkey;
|
|
11
|
+
public String msgId;
|
|
12
|
+
public transient Context context;
|
|
13
|
+
public String notificationContent;
|
|
14
|
+
public int notificationAlertType;
|
|
15
|
+
public String notificationTitle;
|
|
16
|
+
public String notificationSmallIcon;
|
|
17
|
+
public String notificationLargeIcon;
|
|
18
|
+
public String notificationExtras;
|
|
19
|
+
public int notificationStyle;
|
|
20
|
+
public String notificationNormalSmallIcon;
|
|
21
|
+
public int notificationBuilderId;
|
|
22
|
+
public String notificationBigText;
|
|
23
|
+
public String notificationBigPicPath;
|
|
24
|
+
public String notificationInbox;
|
|
25
|
+
public int notificationPriority;
|
|
26
|
+
public int notificationImportance;
|
|
27
|
+
public String notificationCategory;
|
|
28
|
+
public int notificationId;
|
|
29
|
+
public String developerArg0;
|
|
30
|
+
public int platform = 0;
|
|
31
|
+
public String appId;
|
|
32
|
+
public int notificationType;
|
|
33
|
+
public String notificationChannelId;
|
|
34
|
+
public String displayForeground;
|
|
35
|
+
public String _webPagePath;
|
|
36
|
+
public ArrayList<String> showResourceList = new ArrayList<String>();
|
|
37
|
+
public boolean isRichPush;
|
|
38
|
+
public int richType;
|
|
39
|
+
public String deeplink;
|
|
40
|
+
public int failedAction;
|
|
41
|
+
public String failedLink;
|
|
42
|
+
public String targetPkgName;
|
|
43
|
+
public String sspWxAppId;
|
|
44
|
+
public String sspWmOriginId;
|
|
45
|
+
public int sspWmType;
|
|
46
|
+
public boolean isWmDeepLink = false;
|
|
47
|
+
public int inAppMsgType = 1;
|
|
48
|
+
public int inAppMsgShowType = 2;
|
|
49
|
+
public int inAppMsgShowPos = 0;
|
|
50
|
+
public String inAppMsgTitle = "";
|
|
51
|
+
public String inAppMsgContentBody = "";
|
|
52
|
+
public int inAppType;
|
|
53
|
+
public String inAppShowTarget;
|
|
54
|
+
public String inAppClickAction;
|
|
55
|
+
public String inAppExtras;
|
|
56
|
+
public transient JSONArray notificationTargetEvent;
|
|
57
|
+
public transient JSONArray customButtons;
|
|
58
|
+
|
|
59
|
+
@Override
|
|
60
|
+
public String toString() {
|
|
61
|
+
return "NotificationMessage{notificationId=" + notificationId
|
|
62
|
+
+ ", msgId='" + msgId
|
|
63
|
+
+ "', notificationTitle='" + notificationTitle
|
|
64
|
+
+ "', notificationContent='" + notificationContent
|
|
65
|
+
+ "', notificationExtras='" + notificationExtras + "'}";
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
package cn.jpush.android.api;
|
|
2
|
+
|
|
3
|
+
import android.app.Notification;
|
|
4
|
+
import android.content.Context;
|
|
5
|
+
import java.util.Map;
|
|
6
|
+
|
|
7
|
+
public interface PushNotificationBuilder {
|
|
8
|
+
Notification buildNotification(Map<String, String> params);
|
|
9
|
+
|
|
10
|
+
Notification buildNotification(Context context, NotificationMessage message);
|
|
11
|
+
|
|
12
|
+
String getDeveloperArg0();
|
|
13
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
package cn.jpush.android.data;
|
|
2
|
+
|
|
3
|
+
import java.io.Serializable;
|
|
4
|
+
import java.util.ArrayList;
|
|
5
|
+
import java.util.HashSet;
|
|
6
|
+
import java.util.Set;
|
|
7
|
+
|
|
8
|
+
public class JPushCollectControl implements Serializable {
|
|
9
|
+
private static final long serialVersionUID = -3135447319267654288L;
|
|
10
|
+
private static final int IMEI = 1003;
|
|
11
|
+
private static final int MAC = 1005;
|
|
12
|
+
private static final int SSID = 1006;
|
|
13
|
+
private static final int BSSID = 1007;
|
|
14
|
+
private static final int CELL = 1008;
|
|
15
|
+
public static final int IMSI = 1010;
|
|
16
|
+
public static final int WIFI = 1012;
|
|
17
|
+
public static final int APP_RUNNING = 1013;
|
|
18
|
+
|
|
19
|
+
private final ArrayList<Integer> mEnableDatas = new ArrayList<Integer>();
|
|
20
|
+
private final ArrayList<Integer> mDisableDatas = new ArrayList<Integer>();
|
|
21
|
+
|
|
22
|
+
public JPushCollectControl(Builder builder) {
|
|
23
|
+
if (builder != null) {
|
|
24
|
+
mDisableDatas.addAll(builder.mDisableDatas);
|
|
25
|
+
mEnableDatas.addAll(builder.mEnableDatas);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public ArrayList<Integer> getEnableDatas() {
|
|
30
|
+
return mEnableDatas;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public ArrayList<Integer> getDisableDatas() {
|
|
34
|
+
return mDisableDatas;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public static class Builder {
|
|
38
|
+
private final Set<Integer> mEnableDatas = new HashSet<Integer>();
|
|
39
|
+
private final Set<Integer> mDisableDatas = new HashSet<Integer>();
|
|
40
|
+
|
|
41
|
+
private void set(boolean enable, int code) {
|
|
42
|
+
if (enable) {
|
|
43
|
+
mDisableDatas.remove(code);
|
|
44
|
+
mEnableDatas.add(code);
|
|
45
|
+
} else {
|
|
46
|
+
mEnableDatas.remove(code);
|
|
47
|
+
mDisableDatas.add(code);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public Builder imei(boolean enable) {
|
|
52
|
+
set(enable, IMEI);
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public Builder mac(boolean enable) {
|
|
57
|
+
set(enable, MAC);
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public Builder ssid(boolean enable) {
|
|
62
|
+
set(enable, SSID);
|
|
63
|
+
if (!enable) {
|
|
64
|
+
wifi(false);
|
|
65
|
+
}
|
|
66
|
+
return this;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
public Builder bssid(boolean enable) {
|
|
70
|
+
set(enable, BSSID);
|
|
71
|
+
if (!enable) {
|
|
72
|
+
wifi(false);
|
|
73
|
+
}
|
|
74
|
+
return this;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public Builder cell(boolean enable) {
|
|
78
|
+
set(enable, CELL);
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
public Builder imsi(boolean enable) {
|
|
83
|
+
set(enable, IMSI);
|
|
84
|
+
return this;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public Builder wifi(boolean enable) {
|
|
88
|
+
set(enable, WIFI);
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
public JPushCollectControl build() {
|
|
93
|
+
return new JPushCollectControl(this);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
package cn.jpush.android.data;
|
|
2
|
+
|
|
3
|
+
import java.io.Serializable;
|
|
4
|
+
|
|
5
|
+
public class JPushConfig implements Serializable {
|
|
6
|
+
private static final long serialVersionUID = -3135447319267244288L;
|
|
7
|
+
private String jAppKey;
|
|
8
|
+
private String oppoAppKey;
|
|
9
|
+
private String oppoAppId;
|
|
10
|
+
private String oppoAppSecret;
|
|
11
|
+
private String mzAppId;
|
|
12
|
+
private String mzAppKey;
|
|
13
|
+
private String xmAppId;
|
|
14
|
+
private String xmAppKey;
|
|
15
|
+
|
|
16
|
+
public String getjAppKey() {
|
|
17
|
+
return jAppKey;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public void setjAppKey(String jAppKey) {
|
|
21
|
+
this.jAppKey = jAppKey;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
public String getOppoAppKey() {
|
|
25
|
+
return oppoAppKey;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public void setOppoAppKey(String oppoAppKey) {
|
|
29
|
+
this.oppoAppKey = oppoAppKey;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public String getOppoAppId() {
|
|
33
|
+
return oppoAppId;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
public void setOppoAppId(String oppoAppId) {
|
|
37
|
+
this.oppoAppId = oppoAppId;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
public String getOppoAppSecret() {
|
|
41
|
+
return oppoAppSecret;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
public void setOppoAppSecret(String oppoAppSecret) {
|
|
45
|
+
this.oppoAppSecret = oppoAppSecret;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public String getMzAppId() {
|
|
49
|
+
return mzAppId;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public void setMzAppId(String mzAppId) {
|
|
53
|
+
this.mzAppId = mzAppId;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
public String getMzAppKey() {
|
|
57
|
+
return mzAppKey;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public void setMzAppKey(String mzAppKey) {
|
|
61
|
+
this.mzAppKey = mzAppKey;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
public String getXmAppId() {
|
|
65
|
+
return xmAppId;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public void setXmAppId(String xmAppId) {
|
|
69
|
+
this.xmAppId = xmAppId;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public String getXmAppKey() {
|
|
73
|
+
return xmAppKey;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
public void setXmAppKey(String xmAppKey) {
|
|
77
|
+
this.xmAppKey = xmAppKey;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
package cn.jpush.android.data;
|
|
2
|
+
|
|
3
|
+
public class JPushConfigEx extends JPushConfig {
|
|
4
|
+
private static final long serialVersionUID = 1L;
|
|
5
|
+
private String hwAppId;
|
|
6
|
+
private String honorAppId;
|
|
7
|
+
private String vivoAppId;
|
|
8
|
+
private String vivoAppKey;
|
|
9
|
+
|
|
10
|
+
public String getHwAppId() {
|
|
11
|
+
return hwAppId;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
public void setHwAppId(String hwAppId) {
|
|
15
|
+
this.hwAppId = hwAppId;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public String getHonorAppId() {
|
|
19
|
+
return honorAppId;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
public void setHonorAppId(String honorAppId) {
|
|
23
|
+
this.honorAppId = honorAppId;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public String getVivoAppId() {
|
|
27
|
+
return vivoAppId;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public void setVivoAppId(String vivoAppId) {
|
|
31
|
+
this.vivoAppId = vivoAppId;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public String getVivoAppKey() {
|
|
35
|
+
return vivoAppKey;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
public void setVivoAppKey(String vivoAppKey) {
|
|
39
|
+
this.vivoAppKey = vivoAppKey;
|
|
40
|
+
}
|
|
41
|
+
}
|