@onekeyfe/react-native-jpush 0.0.0-stage → 6.7.0-alpha.436
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 +39 -2
- package/ReactNativeJpush.podspec +66 -0
- package/android/CMakeLists.txt +24 -0
- package/android/build.gradle +143 -0
- package/android/fcm/build.gradle +29 -0
- package/android/fcm/consumer-rules.pro +2 -0
- package/android/fcm/src/main/AndroidManifest.xml +16 -0
- package/android/fcm/src/main/java/com/onekey/jpush/fcm/FcmMessagingService.java +72 -0
- package/android/fcm/src/main/java/com/onekey/jpush/fcm/FcmPushManager.java +69 -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 +1395 -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 +490 -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 +247 -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 +1277 -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 +94 -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 +174 -4
- package/src/ReactNativeJpush.nitro.ts +93 -0
- package/src/index.tsx +1090 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridReactNativeJpushSpec.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.reactnativejpush
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.jni.HybridData
|
|
12
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
13
|
+
import dalvik.annotation.optimization.FastNative
|
|
14
|
+
import com.margelo.nitro.core.HybridObject
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A Kotlin class representing the ReactNativeJpush HybridObject.
|
|
18
|
+
* Implement this abstract class to create Kotlin-based instances of ReactNativeJpush.
|
|
19
|
+
*/
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
@Suppress(
|
|
23
|
+
"KotlinJniMissingFunction", "unused",
|
|
24
|
+
"RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
|
|
25
|
+
"LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
|
|
26
|
+
)
|
|
27
|
+
abstract class HybridReactNativeJpushSpec: HybridObject() {
|
|
28
|
+
// Properties
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
// Methods
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
34
|
+
abstract fun setDebugMode(enable: Boolean): Unit
|
|
35
|
+
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
abstract fun initPush(): Unit
|
|
39
|
+
|
|
40
|
+
@DoNotStrip
|
|
41
|
+
@Keep
|
|
42
|
+
abstract fun setupWithConfig(appKey: String, channel: String, production: Boolean): Unit
|
|
43
|
+
|
|
44
|
+
@DoNotStrip
|
|
45
|
+
@Keep
|
|
46
|
+
abstract fun loadJS(): Unit
|
|
47
|
+
|
|
48
|
+
@DoNotStrip
|
|
49
|
+
@Keep
|
|
50
|
+
abstract fun stopPush(): Unit
|
|
51
|
+
|
|
52
|
+
@DoNotStrip
|
|
53
|
+
@Keep
|
|
54
|
+
abstract fun resumePush(): Unit
|
|
55
|
+
|
|
56
|
+
@DoNotStrip
|
|
57
|
+
@Keep
|
|
58
|
+
abstract fun isPushStopped(): Boolean
|
|
59
|
+
|
|
60
|
+
@DoNotStrip
|
|
61
|
+
@Keep
|
|
62
|
+
abstract fun getRegistrationID(): String
|
|
63
|
+
|
|
64
|
+
abstract fun isNotificationEnabled(callback: (enabled: Boolean) -> Unit): Unit
|
|
65
|
+
|
|
66
|
+
@DoNotStrip
|
|
67
|
+
@Keep
|
|
68
|
+
private fun isNotificationEnabled_cxx(callback: Func_void_bool): Unit {
|
|
69
|
+
val __result = isNotificationEnabled(callback)
|
|
70
|
+
return __result
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@DoNotStrip
|
|
74
|
+
@Keep
|
|
75
|
+
abstract fun addTags(sequence: Double, tags: Array<String>): Unit
|
|
76
|
+
|
|
77
|
+
@DoNotStrip
|
|
78
|
+
@Keep
|
|
79
|
+
abstract fun setTags(sequence: Double, tags: Array<String>): Unit
|
|
80
|
+
|
|
81
|
+
@DoNotStrip
|
|
82
|
+
@Keep
|
|
83
|
+
abstract fun deleteTags(sequence: Double, tags: Array<String>): Unit
|
|
84
|
+
|
|
85
|
+
@DoNotStrip
|
|
86
|
+
@Keep
|
|
87
|
+
abstract fun cleanTags(sequence: Double): Unit
|
|
88
|
+
|
|
89
|
+
@DoNotStrip
|
|
90
|
+
@Keep
|
|
91
|
+
abstract fun getAllTags(sequence: Double): Unit
|
|
92
|
+
|
|
93
|
+
@DoNotStrip
|
|
94
|
+
@Keep
|
|
95
|
+
abstract fun checkTagBindState(sequence: Double, tag: String): Unit
|
|
96
|
+
|
|
97
|
+
@DoNotStrip
|
|
98
|
+
@Keep
|
|
99
|
+
abstract fun setAlias(sequence: Double, alias: String): Unit
|
|
100
|
+
|
|
101
|
+
@DoNotStrip
|
|
102
|
+
@Keep
|
|
103
|
+
abstract fun deleteAlias(sequence: Double): Unit
|
|
104
|
+
|
|
105
|
+
@DoNotStrip
|
|
106
|
+
@Keep
|
|
107
|
+
abstract fun getAlias(sequence: Double): Unit
|
|
108
|
+
|
|
109
|
+
@DoNotStrip
|
|
110
|
+
@Keep
|
|
111
|
+
abstract fun setProperties(sequence: Double, propertiesJson: String): Unit
|
|
112
|
+
|
|
113
|
+
@DoNotStrip
|
|
114
|
+
@Keep
|
|
115
|
+
abstract fun deleteProperties(sequence: Double, keys: Array<String>): Unit
|
|
116
|
+
|
|
117
|
+
@DoNotStrip
|
|
118
|
+
@Keep
|
|
119
|
+
abstract fun cleanProperties(sequence: Double): Unit
|
|
120
|
+
|
|
121
|
+
@DoNotStrip
|
|
122
|
+
@Keep
|
|
123
|
+
abstract fun setBadge(badge: Double, appBadge: Double): Unit
|
|
124
|
+
|
|
125
|
+
@DoNotStrip
|
|
126
|
+
@Keep
|
|
127
|
+
abstract fun setMobileNumber(sequence: Double, mobileNumber: String): Unit
|
|
128
|
+
|
|
129
|
+
@DoNotStrip
|
|
130
|
+
@Keep
|
|
131
|
+
abstract fun initCrashHandler(): Unit
|
|
132
|
+
|
|
133
|
+
@DoNotStrip
|
|
134
|
+
@Keep
|
|
135
|
+
abstract fun setPowerSaveMode(enable: Boolean): Unit
|
|
136
|
+
|
|
137
|
+
@DoNotStrip
|
|
138
|
+
@Keep
|
|
139
|
+
abstract fun addLocalNotification(messageID: String, title: String, content: String, broadcastTime: String, extrasJson: String): Unit
|
|
140
|
+
|
|
141
|
+
@DoNotStrip
|
|
142
|
+
@Keep
|
|
143
|
+
abstract fun removeLocalNotification(messageID: String): Unit
|
|
144
|
+
|
|
145
|
+
@DoNotStrip
|
|
146
|
+
@Keep
|
|
147
|
+
abstract fun clearLocalNotifications(): Unit
|
|
148
|
+
|
|
149
|
+
@DoNotStrip
|
|
150
|
+
@Keep
|
|
151
|
+
abstract fun clearAllNotifications(): Unit
|
|
152
|
+
|
|
153
|
+
@DoNotStrip
|
|
154
|
+
@Keep
|
|
155
|
+
abstract fun clearNotificationById(notificationId: Double): Unit
|
|
156
|
+
|
|
157
|
+
@DoNotStrip
|
|
158
|
+
@Keep
|
|
159
|
+
abstract fun requestPermission(): Unit
|
|
160
|
+
|
|
161
|
+
@DoNotStrip
|
|
162
|
+
@Keep
|
|
163
|
+
abstract fun setPushTime(days: DoubleArray, startHour: Double, endHour: Double): Unit
|
|
164
|
+
|
|
165
|
+
@DoNotStrip
|
|
166
|
+
@Keep
|
|
167
|
+
abstract fun setSilenceTime(startHour: Double, startMinute: Double, endHour: Double, endMinute: Double): Unit
|
|
168
|
+
|
|
169
|
+
@DoNotStrip
|
|
170
|
+
@Keep
|
|
171
|
+
abstract fun setLatestNotificationNumber(maxNumber: Double): Unit
|
|
172
|
+
|
|
173
|
+
@DoNotStrip
|
|
174
|
+
@Keep
|
|
175
|
+
abstract fun setChannel(channel: String): Unit
|
|
176
|
+
|
|
177
|
+
@DoNotStrip
|
|
178
|
+
@Keep
|
|
179
|
+
abstract fun setChannelAndSound(channel: String, channelId: String, sound: String): Unit
|
|
180
|
+
|
|
181
|
+
@DoNotStrip
|
|
182
|
+
@Keep
|
|
183
|
+
abstract fun setLinkMergeEnable(enable: Boolean): Unit
|
|
184
|
+
|
|
185
|
+
@DoNotStrip
|
|
186
|
+
@Keep
|
|
187
|
+
abstract fun setSmartPushEnable(enable: Boolean): Unit
|
|
188
|
+
|
|
189
|
+
@DoNotStrip
|
|
190
|
+
@Keep
|
|
191
|
+
abstract fun setDataInsightsEnable(enable: Boolean): Unit
|
|
192
|
+
|
|
193
|
+
@DoNotStrip
|
|
194
|
+
@Keep
|
|
195
|
+
abstract fun setGeofenceEnable(enable: Boolean): Unit
|
|
196
|
+
|
|
197
|
+
@DoNotStrip
|
|
198
|
+
@Keep
|
|
199
|
+
abstract fun setBackgroundEnable(enable: Boolean): Unit
|
|
200
|
+
|
|
201
|
+
@DoNotStrip
|
|
202
|
+
@Keep
|
|
203
|
+
abstract fun setMaxGeofenceNumber(maxNumber: Double): Unit
|
|
204
|
+
|
|
205
|
+
@DoNotStrip
|
|
206
|
+
@Keep
|
|
207
|
+
abstract fun deleteGeofence(geoFenceID: String): Unit
|
|
208
|
+
|
|
209
|
+
@DoNotStrip
|
|
210
|
+
@Keep
|
|
211
|
+
abstract fun pageEnterTo(pageName: String): Unit
|
|
212
|
+
|
|
213
|
+
@DoNotStrip
|
|
214
|
+
@Keep
|
|
215
|
+
abstract fun pageLeave(pageName: String): Unit
|
|
216
|
+
|
|
217
|
+
@DoNotStrip
|
|
218
|
+
@Keep
|
|
219
|
+
abstract fun setCollectControl(imei: Boolean, imsi: Boolean, mac: Boolean, wifi: Boolean, bssid: Boolean, ssid: Boolean, cell: Boolean, gps: Boolean): Unit
|
|
220
|
+
|
|
221
|
+
@DoNotStrip
|
|
222
|
+
@Keep
|
|
223
|
+
abstract fun setAuth(auth: Boolean): Unit
|
|
224
|
+
|
|
225
|
+
@DoNotStrip
|
|
226
|
+
@Keep
|
|
227
|
+
abstract fun setCountryCode(code: String): Unit
|
|
228
|
+
|
|
229
|
+
@DoNotStrip
|
|
230
|
+
@Keep
|
|
231
|
+
abstract fun enableAutoWakeup(enable: Boolean): Unit
|
|
232
|
+
|
|
233
|
+
@DoNotStrip
|
|
234
|
+
@Keep
|
|
235
|
+
abstract fun enableSDKLocalLog(enable: Boolean, uploadJgToServer: Boolean): Unit
|
|
236
|
+
|
|
237
|
+
@DoNotStrip
|
|
238
|
+
@Keep
|
|
239
|
+
abstract fun readNewLogs(): String
|
|
240
|
+
|
|
241
|
+
abstract fun addEventListener(callback: (eventName: String, payloadJson: String) -> Unit): Double
|
|
242
|
+
|
|
243
|
+
@DoNotStrip
|
|
244
|
+
@Keep
|
|
245
|
+
private fun addEventListener_cxx(callback: Func_void_std__string_std__string): Double {
|
|
246
|
+
val __result = addEventListener(callback)
|
|
247
|
+
return __result
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
@DoNotStrip
|
|
251
|
+
@Keep
|
|
252
|
+
abstract fun removeEventListener(id: Double): Unit
|
|
253
|
+
|
|
254
|
+
// Default implementation of `HybridObject.toString()`
|
|
255
|
+
override fun toString(): String {
|
|
256
|
+
return "[HybridObject ReactNativeJpush]"
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// C++ backing class
|
|
260
|
+
@DoNotStrip
|
|
261
|
+
@Keep
|
|
262
|
+
protected open class CxxPart(javaPart: HybridReactNativeJpushSpec): HybridObject.CxxPart(javaPart) {
|
|
263
|
+
// C++ JHybridReactNativeJpushSpec::CxxPart::initHybrid(...)
|
|
264
|
+
@FastNative
|
|
265
|
+
external override fun initHybrid(): HybridData
|
|
266
|
+
}
|
|
267
|
+
override fun createCxxPart(): CxxPart {
|
|
268
|
+
return CxxPart(this)
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
companion object {
|
|
272
|
+
protected const val TAG = "HybridReactNativeJpushSpec"
|
|
273
|
+
}
|
|
274
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// reactnativejpushOnLoad.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.reactnativejpush
|
|
9
|
+
|
|
10
|
+
import android.util.Log
|
|
11
|
+
|
|
12
|
+
internal class reactnativejpushOnLoad {
|
|
13
|
+
companion object {
|
|
14
|
+
private const val TAG = "reactnativejpushOnLoad"
|
|
15
|
+
private var didLoad = false
|
|
16
|
+
/**
|
|
17
|
+
* Initializes the native part of "reactnativejpush".
|
|
18
|
+
* This method is idempotent and can be called more than once.
|
|
19
|
+
*/
|
|
20
|
+
@JvmStatic
|
|
21
|
+
fun initializeNative() {
|
|
22
|
+
if (didLoad) return
|
|
23
|
+
try {
|
|
24
|
+
Log.i(TAG, "Loading reactnativejpush C++ library...")
|
|
25
|
+
System.loadLibrary("reactnativejpush")
|
|
26
|
+
Log.i(TAG, "Successfully loaded reactnativejpush C++ library!")
|
|
27
|
+
didLoad = true
|
|
28
|
+
} catch (e: Error) {
|
|
29
|
+
Log.e(TAG, "Failed to load reactnativejpush C++ library! Is it properly installed and linked? " +
|
|
30
|
+
"Is the name correct? (see `CMakeLists.txt`, at `add_library(...)`)", e)
|
|
31
|
+
throw e
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#
|
|
2
|
+
# reactnativejpush+autolinking.cmake
|
|
3
|
+
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
# https://github.com/mrousavy/nitro
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
# This is a CMake file that adds all files generated by Nitrogen
|
|
9
|
+
# to the current CMake project.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your CMakeLists.txt:
|
|
12
|
+
# ```cmake
|
|
13
|
+
# include(${CMAKE_SOURCE_DIR}/../nitrogen/generated/android/reactnativejpush+autolinking.cmake)
|
|
14
|
+
# ```
|
|
15
|
+
|
|
16
|
+
# Define a flag to check if we are building properly
|
|
17
|
+
add_definitions(-DBUILDING_REACTNATIVEJPUSH_WITH_GENERATED_CMAKE_PROJECT)
|
|
18
|
+
|
|
19
|
+
# Enable Raw Props parsing in react-native (for Nitro Views)
|
|
20
|
+
add_definitions(-DRN_SERIALIZABLE_STATE)
|
|
21
|
+
|
|
22
|
+
# Add all headers that were generated by Nitrogen
|
|
23
|
+
include_directories(
|
|
24
|
+
"../nitrogen/generated/shared/c++"
|
|
25
|
+
"../nitrogen/generated/android/c++"
|
|
26
|
+
"../nitrogen/generated/android/"
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
# Add all .cpp sources that were generated by Nitrogen
|
|
30
|
+
target_sources(
|
|
31
|
+
# CMake project name (Android C++ library name)
|
|
32
|
+
reactnativejpush PRIVATE
|
|
33
|
+
# Autolinking Setup
|
|
34
|
+
../nitrogen/generated/android/reactnativejpushOnLoad.cpp
|
|
35
|
+
# Shared Nitrogen C++ sources
|
|
36
|
+
../nitrogen/generated/shared/c++/HybridReactNativeJpushSpec.cpp
|
|
37
|
+
# Android-specific Nitrogen C++ sources
|
|
38
|
+
../nitrogen/generated/android/c++/JHybridReactNativeJpushSpec.cpp
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
# From node_modules/react-native/ReactAndroid/cmake-utils/folly-flags.cmake
|
|
42
|
+
# Used in node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake
|
|
43
|
+
target_compile_definitions(
|
|
44
|
+
reactnativejpush PRIVATE
|
|
45
|
+
-DFOLLY_NO_CONFIG=1
|
|
46
|
+
-DFOLLY_HAVE_CLOCK_GETTIME=1
|
|
47
|
+
-DFOLLY_USE_LIBCPP=1
|
|
48
|
+
-DFOLLY_CFG_NO_COROUTINES=1
|
|
49
|
+
-DFOLLY_MOBILE=1
|
|
50
|
+
-DFOLLY_HAVE_RECVMMSG=1
|
|
51
|
+
-DFOLLY_HAVE_PTHREAD=1
|
|
52
|
+
# Once we target android-23 above, we can comment
|
|
53
|
+
# the following line. NDK uses GNU style stderror_r() after API 23.
|
|
54
|
+
-DFOLLY_HAVE_XSI_STRERROR_R=1
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# Add all libraries required by the generated specs
|
|
58
|
+
find_package(fbjni REQUIRED) # <-- Used for communication between Java <-> C++
|
|
59
|
+
find_package(ReactAndroid REQUIRED) # <-- Used to set up React Native bindings (e.g. CallInvoker/TurboModule)
|
|
60
|
+
find_package(react-native-nitro-modules REQUIRED) # <-- Used to create all HybridObjects and use the Nitro core library
|
|
61
|
+
|
|
62
|
+
# Link all libraries together
|
|
63
|
+
target_link_libraries(
|
|
64
|
+
reactnativejpush
|
|
65
|
+
fbjni::fbjni # <-- Facebook C++ JNI helpers
|
|
66
|
+
ReactAndroid::jsi # <-- RN: JSI
|
|
67
|
+
react-native-nitro-modules::NitroModules # <-- NitroModules Core :)
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
# Link react-native (different prefab between RN 0.75 and RN 0.76)
|
|
71
|
+
if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
|
|
72
|
+
target_link_libraries(
|
|
73
|
+
reactnativejpush
|
|
74
|
+
ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
|
|
75
|
+
)
|
|
76
|
+
else()
|
|
77
|
+
target_link_libraries(
|
|
78
|
+
reactnativejpush
|
|
79
|
+
ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
|
|
80
|
+
)
|
|
81
|
+
endif()
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// reactnativejpush+autolinking.gradle
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
/// This is a Gradle file that adds all files generated by Nitrogen
|
|
9
|
+
/// to the current Gradle project.
|
|
10
|
+
///
|
|
11
|
+
/// To use it, add this to your build.gradle:
|
|
12
|
+
/// ```gradle
|
|
13
|
+
/// apply from: '../nitrogen/generated/android/reactnativejpush+autolinking.gradle'
|
|
14
|
+
/// ```
|
|
15
|
+
|
|
16
|
+
logger.warn("[NitroModules] 🔥 reactnativejpush is boosted by nitro!")
|
|
17
|
+
|
|
18
|
+
android {
|
|
19
|
+
sourceSets {
|
|
20
|
+
main {
|
|
21
|
+
java.srcDirs += [
|
|
22
|
+
// Nitrogen files
|
|
23
|
+
"${project.projectDir}/../nitrogen/generated/android/kotlin"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// reactnativejpushOnLoad.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#ifndef BUILDING_REACTNATIVEJPUSH_WITH_GENERATED_CMAKE_PROJECT
|
|
9
|
+
#error reactnativejpushOnLoad.cpp is not being built with the autogenerated CMakeLists.txt project. Is a different CMakeLists.txt building this?
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
#include "reactnativejpushOnLoad.hpp"
|
|
13
|
+
|
|
14
|
+
#include <jni.h>
|
|
15
|
+
#include <fbjni/fbjni.h>
|
|
16
|
+
#include <NitroModules/HybridObjectRegistry.hpp>
|
|
17
|
+
|
|
18
|
+
#include "JHybridReactNativeJpushSpec.hpp"
|
|
19
|
+
#include "JFunc_void_bool.hpp"
|
|
20
|
+
#include "JFunc_void_std__string_std__string.hpp"
|
|
21
|
+
#include <NitroModules/DefaultConstructableObject.hpp>
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::reactnativejpush {
|
|
24
|
+
|
|
25
|
+
int initialize(JavaVM* vm) {
|
|
26
|
+
return facebook::jni::initialize(vm, []() {
|
|
27
|
+
::margelo::nitro::reactnativejpush::registerAllNatives();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
struct JHybridReactNativeJpushSpecImpl: public jni::JavaClass<JHybridReactNativeJpushSpecImpl, JHybridReactNativeJpushSpec::JavaPart> {
|
|
32
|
+
static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/reactnativejpush/ReactNativeJpush;";
|
|
33
|
+
static std::shared_ptr<JHybridReactNativeJpushSpec> create() {
|
|
34
|
+
static const auto constructorFn = javaClassStatic()->getConstructor<JHybridReactNativeJpushSpecImpl::javaobject()>();
|
|
35
|
+
jni::local_ref<JHybridReactNativeJpushSpec::JavaPart> javaPart = javaClassStatic()->newObject(constructorFn);
|
|
36
|
+
return javaPart->getJHybridReactNativeJpushSpec();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
void registerAllNatives() {
|
|
41
|
+
using namespace margelo::nitro;
|
|
42
|
+
using namespace margelo::nitro::reactnativejpush;
|
|
43
|
+
|
|
44
|
+
// Register native JNI methods
|
|
45
|
+
margelo::nitro::reactnativejpush::JHybridReactNativeJpushSpec::CxxPart::registerNatives();
|
|
46
|
+
margelo::nitro::reactnativejpush::JFunc_void_bool_cxx::registerNatives();
|
|
47
|
+
margelo::nitro::reactnativejpush::JFunc_void_std__string_std__string_cxx::registerNatives();
|
|
48
|
+
|
|
49
|
+
// Register Nitro Hybrid Objects
|
|
50
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
51
|
+
"ReactNativeJpush",
|
|
52
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
53
|
+
return JHybridReactNativeJpushSpecImpl::create();
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
} // namespace margelo::nitro::reactnativejpush
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// reactnativejpushOnLoad.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include <jni.h>
|
|
9
|
+
#include <functional>
|
|
10
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
11
|
+
|
|
12
|
+
namespace margelo::nitro::reactnativejpush {
|
|
13
|
+
|
|
14
|
+
[[deprecated("Use registerNatives() instead.")]]
|
|
15
|
+
int initialize(JavaVM* vm);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Register the native (C++) part of reactnativejpush, and autolinks all Hybrid Objects.
|
|
19
|
+
* Call this in your `JNI_OnLoad` function (probably inside `cpp-adapter.cpp`),
|
|
20
|
+
* inside a `facebook::jni::initialize(vm, ...)` call.
|
|
21
|
+
* Example:
|
|
22
|
+
* ```cpp (cpp-adapter.cpp)
|
|
23
|
+
* JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void*) {
|
|
24
|
+
* return facebook::jni::initialize(vm, []() {
|
|
25
|
+
* // register all reactnativejpush HybridObjects
|
|
26
|
+
* margelo::nitro::reactnativejpush::registerNatives();
|
|
27
|
+
* // any other custom registrations go here.
|
|
28
|
+
* });
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
void registerAllNatives();
|
|
33
|
+
|
|
34
|
+
} // namespace margelo::nitro::reactnativejpush
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#
|
|
2
|
+
# ReactNativeJpush+autolinking.rb
|
|
3
|
+
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
# https://github.com/mrousavy/nitro
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
# This is a Ruby script that adds all files generated by Nitrogen
|
|
9
|
+
# to the given podspec.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your .podspec:
|
|
12
|
+
# ```ruby
|
|
13
|
+
# Pod::Spec.new do |spec|
|
|
14
|
+
# # ...
|
|
15
|
+
#
|
|
16
|
+
# # Add all files generated by Nitrogen
|
|
17
|
+
# load 'nitrogen/generated/ios/ReactNativeJpush+autolinking.rb'
|
|
18
|
+
# add_nitrogen_files(spec)
|
|
19
|
+
# end
|
|
20
|
+
# ```
|
|
21
|
+
|
|
22
|
+
def add_nitrogen_files(spec)
|
|
23
|
+
Pod::UI.puts "[NitroModules] 🔥 ReactNativeJpush is boosted by nitro!"
|
|
24
|
+
|
|
25
|
+
spec.dependency "NitroModules"
|
|
26
|
+
|
|
27
|
+
current_source_files = Array(spec.attributes_hash['source_files'])
|
|
28
|
+
spec.source_files = current_source_files + [
|
|
29
|
+
# Generated cross-platform specs
|
|
30
|
+
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
|
|
31
|
+
# Generated bridges for the cross-platform specs
|
|
32
|
+
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
current_public_header_files = Array(spec.attributes_hash['public_header_files'])
|
|
36
|
+
spec.public_header_files = current_public_header_files + [
|
|
37
|
+
# Generated specs
|
|
38
|
+
"nitrogen/generated/shared/**/*.{h,hpp}",
|
|
39
|
+
# Swift to C++ bridging helpers
|
|
40
|
+
"nitrogen/generated/ios/ReactNativeJpush-Swift-Cxx-Bridge.hpp"
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
current_private_header_files = Array(spec.attributes_hash['private_header_files'])
|
|
44
|
+
spec.private_header_files = current_private_header_files + [
|
|
45
|
+
# iOS specific specs
|
|
46
|
+
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
+
# Views are framework-specific and should be private
|
|
48
|
+
"nitrogen/generated/shared/**/views/**/*"
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
52
|
+
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
|
+
# Use C++ 20
|
|
54
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only ObjC)
|
|
56
|
+
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
|
+
# Enables stricter modular headers
|
|
58
|
+
"DEFINES_MODULE" => "YES",
|
|
59
|
+
# Disable auto-generated ObjC header for Swift (Static linkage on Xcode 26.4 breaks here)
|
|
60
|
+
"SWIFT_INSTALL_OBJC_HEADER" => "NO",
|
|
61
|
+
})
|
|
62
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ReactNativeJpush-Swift-Cxx-Bridge.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "ReactNativeJpush-Swift-Cxx-Bridge.hpp"
|
|
9
|
+
|
|
10
|
+
// Include C++ implementation defined types
|
|
11
|
+
#include "HybridReactNativeJpushSpecSwift.hpp"
|
|
12
|
+
#include "ReactNativeJpush-Swift-Cxx-Umbrella.hpp"
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::reactnativejpush::bridge::swift {
|
|
16
|
+
|
|
17
|
+
// pragma MARK: std::function<void(bool /* enabled */)>
|
|
18
|
+
Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
19
|
+
auto swiftClosure = ReactNativeJpush::Func_void_bool::fromUnsafe(swiftClosureWrapper);
|
|
20
|
+
return [swiftClosure = std::move(swiftClosure)](bool enabled) mutable -> void {
|
|
21
|
+
swiftClosure.call(enabled);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// pragma MARK: std::function<void(const std::string& /* eventName */, const std::string& /* payloadJson */)>
|
|
26
|
+
Func_void_std__string_std__string create_Func_void_std__string_std__string(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
27
|
+
auto swiftClosure = ReactNativeJpush::Func_void_std__string_std__string::fromUnsafe(swiftClosureWrapper);
|
|
28
|
+
return [swiftClosure = std::move(swiftClosure)](const std::string& eventName, const std::string& payloadJson) mutable -> void {
|
|
29
|
+
swiftClosure.call(eventName, payloadJson);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// pragma MARK: std::shared_ptr<HybridReactNativeJpushSpec>
|
|
34
|
+
std::shared_ptr<HybridReactNativeJpushSpec> create_std__shared_ptr_HybridReactNativeJpushSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
35
|
+
ReactNativeJpush::HybridReactNativeJpushSpec_cxx swiftPart = ReactNativeJpush::HybridReactNativeJpushSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
36
|
+
return std::make_shared<margelo::nitro::reactnativejpush::HybridReactNativeJpushSpecSwift>(swiftPart);
|
|
37
|
+
}
|
|
38
|
+
void* NON_NULL get_std__shared_ptr_HybridReactNativeJpushSpec_(std__shared_ptr_HybridReactNativeJpushSpec_ cppType) {
|
|
39
|
+
std::shared_ptr<margelo::nitro::reactnativejpush::HybridReactNativeJpushSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::reactnativejpush::HybridReactNativeJpushSpecSwift>(cppType);
|
|
40
|
+
#ifdef NITRO_DEBUG
|
|
41
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
42
|
+
throw std::runtime_error("Class \"HybridReactNativeJpushSpec\" is not implemented in Swift!");
|
|
43
|
+
}
|
|
44
|
+
#endif
|
|
45
|
+
ReactNativeJpush::HybridReactNativeJpushSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
46
|
+
return swiftPart.toUnsafe();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
} // namespace margelo::nitro::reactnativejpush::bridge::swift
|