@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,147 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ReactNativeJpush-Swift-Cxx-Bridge.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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridReactNativeJpushSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::reactnativejpush { class HybridReactNativeJpushSpec; }
|
|
13
|
+
|
|
14
|
+
// Forward declarations of Swift defined types
|
|
15
|
+
// Forward declaration of `HybridReactNativeJpushSpec_cxx` to properly resolve imports.
|
|
16
|
+
namespace ReactNativeJpush { class HybridReactNativeJpushSpec_cxx; }
|
|
17
|
+
|
|
18
|
+
// Include C++ defined types
|
|
19
|
+
#include "HybridReactNativeJpushSpec.hpp"
|
|
20
|
+
#include <NitroModules/Result.hpp>
|
|
21
|
+
#include <exception>
|
|
22
|
+
#include <functional>
|
|
23
|
+
#include <memory>
|
|
24
|
+
#include <string>
|
|
25
|
+
#include <vector>
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
29
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
30
|
+
*/
|
|
31
|
+
namespace margelo::nitro::reactnativejpush::bridge::swift {
|
|
32
|
+
|
|
33
|
+
// pragma MARK: std::function<void(bool /* enabled */)>
|
|
34
|
+
/**
|
|
35
|
+
* Specialized version of `std::function<void(bool)>`.
|
|
36
|
+
*/
|
|
37
|
+
using Func_void_bool = std::function<void(bool /* enabled */)>;
|
|
38
|
+
/**
|
|
39
|
+
* Wrapper class for a `std::function<void(bool / * enabled * /)>`, this can be used from Swift.
|
|
40
|
+
*/
|
|
41
|
+
class Func_void_bool_Wrapper final {
|
|
42
|
+
public:
|
|
43
|
+
explicit Func_void_bool_Wrapper(std::function<void(bool /* enabled */)>&& func): _function(std::make_unique<std::function<void(bool /* enabled */)>>(std::move(func))) {}
|
|
44
|
+
inline void call(bool enabled) const noexcept {
|
|
45
|
+
_function->operator()(enabled);
|
|
46
|
+
}
|
|
47
|
+
private:
|
|
48
|
+
std::unique_ptr<std::function<void(bool /* enabled */)>> _function;
|
|
49
|
+
} SWIFT_NONCOPYABLE;
|
|
50
|
+
Func_void_bool create_Func_void_bool(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
51
|
+
inline Func_void_bool_Wrapper wrap_Func_void_bool(Func_void_bool value) noexcept {
|
|
52
|
+
return Func_void_bool_Wrapper(std::move(value));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// pragma MARK: std::vector<std::string>
|
|
56
|
+
/**
|
|
57
|
+
* Specialized version of `std::vector<std::string>`.
|
|
58
|
+
*/
|
|
59
|
+
using std__vector_std__string_ = std::vector<std::string>;
|
|
60
|
+
inline std::vector<std::string> create_std__vector_std__string_(size_t size) noexcept {
|
|
61
|
+
std::vector<std::string> vector;
|
|
62
|
+
vector.reserve(size);
|
|
63
|
+
return vector;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// pragma MARK: std::vector<double>
|
|
67
|
+
/**
|
|
68
|
+
* Specialized version of `std::vector<double>`.
|
|
69
|
+
*/
|
|
70
|
+
using std__vector_double_ = std::vector<double>;
|
|
71
|
+
inline std::vector<double> create_std__vector_double_(size_t size) noexcept {
|
|
72
|
+
std::vector<double> vector;
|
|
73
|
+
vector.reserve(size);
|
|
74
|
+
return vector;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// pragma MARK: std::function<void(const std::string& /* eventName */, const std::string& /* payloadJson */)>
|
|
78
|
+
/**
|
|
79
|
+
* Specialized version of `std::function<void(const std::string&, const std::string&)>`.
|
|
80
|
+
*/
|
|
81
|
+
using Func_void_std__string_std__string = std::function<void(const std::string& /* eventName */, const std::string& /* payloadJson */)>;
|
|
82
|
+
/**
|
|
83
|
+
* Wrapper class for a `std::function<void(const std::string& / * eventName * /, const std::string& / * payloadJson * /)>`, this can be used from Swift.
|
|
84
|
+
*/
|
|
85
|
+
class Func_void_std__string_std__string_Wrapper final {
|
|
86
|
+
public:
|
|
87
|
+
explicit Func_void_std__string_std__string_Wrapper(std::function<void(const std::string& /* eventName */, const std::string& /* payloadJson */)>&& func): _function(std::make_unique<std::function<void(const std::string& /* eventName */, const std::string& /* payloadJson */)>>(std::move(func))) {}
|
|
88
|
+
inline void call(std::string eventName, std::string payloadJson) const noexcept {
|
|
89
|
+
_function->operator()(eventName, payloadJson);
|
|
90
|
+
}
|
|
91
|
+
private:
|
|
92
|
+
std::unique_ptr<std::function<void(const std::string& /* eventName */, const std::string& /* payloadJson */)>> _function;
|
|
93
|
+
} SWIFT_NONCOPYABLE;
|
|
94
|
+
Func_void_std__string_std__string create_Func_void_std__string_std__string(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
95
|
+
inline Func_void_std__string_std__string_Wrapper wrap_Func_void_std__string_std__string(Func_void_std__string_std__string value) noexcept {
|
|
96
|
+
return Func_void_std__string_std__string_Wrapper(std::move(value));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// pragma MARK: std::shared_ptr<HybridReactNativeJpushSpec>
|
|
100
|
+
/**
|
|
101
|
+
* Specialized version of `std::shared_ptr<HybridReactNativeJpushSpec>`.
|
|
102
|
+
*/
|
|
103
|
+
using std__shared_ptr_HybridReactNativeJpushSpec_ = std::shared_ptr<HybridReactNativeJpushSpec>;
|
|
104
|
+
std::shared_ptr<HybridReactNativeJpushSpec> create_std__shared_ptr_HybridReactNativeJpushSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
105
|
+
void* NON_NULL get_std__shared_ptr_HybridReactNativeJpushSpec_(std__shared_ptr_HybridReactNativeJpushSpec_ cppType);
|
|
106
|
+
|
|
107
|
+
// pragma MARK: std::weak_ptr<HybridReactNativeJpushSpec>
|
|
108
|
+
using std__weak_ptr_HybridReactNativeJpushSpec_ = std::weak_ptr<HybridReactNativeJpushSpec>;
|
|
109
|
+
inline std__weak_ptr_HybridReactNativeJpushSpec_ weakify_std__shared_ptr_HybridReactNativeJpushSpec_(const std::shared_ptr<HybridReactNativeJpushSpec>& strong) noexcept { return strong; }
|
|
110
|
+
|
|
111
|
+
// pragma MARK: Result<void>
|
|
112
|
+
using Result_void_ = Result<void>;
|
|
113
|
+
inline Result_void_ create_Result_void_() noexcept {
|
|
114
|
+
return Result<void>::withValue();
|
|
115
|
+
}
|
|
116
|
+
inline Result_void_ create_Result_void_(const std::exception_ptr& error) noexcept {
|
|
117
|
+
return Result<void>::withError(error);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// pragma MARK: Result<bool>
|
|
121
|
+
using Result_bool_ = Result<bool>;
|
|
122
|
+
inline Result_bool_ create_Result_bool_(bool value) noexcept {
|
|
123
|
+
return Result<bool>::withValue(std::move(value));
|
|
124
|
+
}
|
|
125
|
+
inline Result_bool_ create_Result_bool_(const std::exception_ptr& error) noexcept {
|
|
126
|
+
return Result<bool>::withError(error);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// pragma MARK: Result<std::string>
|
|
130
|
+
using Result_std__string_ = Result<std::string>;
|
|
131
|
+
inline Result_std__string_ create_Result_std__string_(const std::string& value) noexcept {
|
|
132
|
+
return Result<std::string>::withValue(value);
|
|
133
|
+
}
|
|
134
|
+
inline Result_std__string_ create_Result_std__string_(const std::exception_ptr& error) noexcept {
|
|
135
|
+
return Result<std::string>::withError(error);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// pragma MARK: Result<double>
|
|
139
|
+
using Result_double_ = Result<double>;
|
|
140
|
+
inline Result_double_ create_Result_double_(double value) noexcept {
|
|
141
|
+
return Result<double>::withValue(std::move(value));
|
|
142
|
+
}
|
|
143
|
+
inline Result_double_ create_Result_double_(const std::exception_ptr& error) noexcept {
|
|
144
|
+
return Result<double>::withError(error);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
} // namespace margelo::nitro::reactnativejpush::bridge::swift
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ReactNativeJpush-Swift-Cxx-Umbrella.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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridReactNativeJpushSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::reactnativejpush { class HybridReactNativeJpushSpec; }
|
|
13
|
+
|
|
14
|
+
// Include C++ defined types
|
|
15
|
+
#include "HybridReactNativeJpushSpec.hpp"
|
|
16
|
+
#include <NitroModules/Result.hpp>
|
|
17
|
+
#include <exception>
|
|
18
|
+
#include <functional>
|
|
19
|
+
#include <memory>
|
|
20
|
+
#include <string>
|
|
21
|
+
#include <vector>
|
|
22
|
+
|
|
23
|
+
// C++ helpers for Swift
|
|
24
|
+
#include "ReactNativeJpush-Swift-Cxx-Bridge.hpp"
|
|
25
|
+
|
|
26
|
+
// Common C++ types used in Swift
|
|
27
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
28
|
+
#include <NitroModules/AnyMapUtils.hpp>
|
|
29
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
30
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
31
|
+
|
|
32
|
+
// Forward declarations of Swift defined types
|
|
33
|
+
// Forward declaration of `HybridReactNativeJpushSpec_cxx` to properly resolve imports.
|
|
34
|
+
namespace ReactNativeJpush { class HybridReactNativeJpushSpec_cxx; }
|
|
35
|
+
|
|
36
|
+
// Include Swift defined types
|
|
37
|
+
#if __has_include("ReactNativeJpush-Swift.h")
|
|
38
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
39
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "ReactNativeJpush".
|
|
40
|
+
#include "ReactNativeJpush-Swift.h"
|
|
41
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
42
|
+
#elif __has_include(<ReactNativeJpush/ReactNativeJpush-Swift.h>)
|
|
43
|
+
#include <ReactNativeJpush/ReactNativeJpush-Swift.h>
|
|
44
|
+
#else
|
|
45
|
+
#error ReactNativeJpush's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "ReactNativeJpush", and try building the app first.
|
|
46
|
+
#endif
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ReactNativeJpushAutolinking.mm
|
|
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
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
#import "ReactNativeJpush-Swift-Cxx-Umbrella.hpp"
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridReactNativeJpushSpecSwift.hpp"
|
|
14
|
+
|
|
15
|
+
@interface ReactNativeJpushAutolinking : NSObject
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@implementation ReactNativeJpushAutolinking
|
|
19
|
+
|
|
20
|
+
+ (void) load {
|
|
21
|
+
using namespace margelo::nitro;
|
|
22
|
+
using namespace margelo::nitro::reactnativejpush;
|
|
23
|
+
|
|
24
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
+
"ReactNativeJpush",
|
|
26
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
+
std::shared_ptr<HybridReactNativeJpushSpec> hybridObject = ReactNativeJpush::ReactNativeJpushAutolinking::createReactNativeJpush();
|
|
28
|
+
return hybridObject;
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ReactNativeJpushAutolinking.swift
|
|
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
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
// TODO: Use empty enums once Swift supports exporting them as namespaces
|
|
11
|
+
// See: https://github.com/swiftlang/swift/pull/83616
|
|
12
|
+
public final class ReactNativeJpushAutolinking {
|
|
13
|
+
public typealias bridge = margelo.nitro.reactnativejpush.bridge.swift
|
|
14
|
+
|
|
15
|
+
public static func createReactNativeJpush() -> bridge.std__shared_ptr_HybridReactNativeJpushSpec_ {
|
|
16
|
+
let hybridObject = ReactNativeJpush()
|
|
17
|
+
return { () -> bridge.std__shared_ptr_HybridReactNativeJpushSpec_ in
|
|
18
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
19
|
+
return __cxxWrapped.getCxxPart()
|
|
20
|
+
}()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public static func isReactNativeJpushRecyclable() -> Bool {
|
|
24
|
+
return ReactNativeJpush.self is any RecyclableView.Type
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridReactNativeJpushSpecSwift.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 "HybridReactNativeJpushSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::reactnativejpush {
|
|
11
|
+
} // namespace margelo::nitro::reactnativejpush
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridReactNativeJpushSpecSwift.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
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
#include "HybridReactNativeJpushSpec.hpp"
|
|
11
|
+
|
|
12
|
+
// Forward declaration of `HybridReactNativeJpushSpec_cxx` to properly resolve imports.
|
|
13
|
+
namespace ReactNativeJpush { class HybridReactNativeJpushSpec_cxx; }
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
#include <string>
|
|
18
|
+
#include <functional>
|
|
19
|
+
#include <vector>
|
|
20
|
+
|
|
21
|
+
#include "ReactNativeJpush-Swift-Cxx-Umbrella.hpp"
|
|
22
|
+
|
|
23
|
+
namespace margelo::nitro::reactnativejpush {
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The C++ part of HybridReactNativeJpushSpec_cxx.swift.
|
|
27
|
+
*
|
|
28
|
+
* HybridReactNativeJpushSpecSwift (C++) accesses HybridReactNativeJpushSpec_cxx (Swift), and might
|
|
29
|
+
* contain some additional bridging code for C++ <> Swift interop.
|
|
30
|
+
*
|
|
31
|
+
* Since this obviously introduces an overhead, I hope at some point in
|
|
32
|
+
* the future, HybridReactNativeJpushSpec_cxx can directly inherit from the C++ class HybridReactNativeJpushSpec
|
|
33
|
+
* to simplify the whole structure and memory management.
|
|
34
|
+
*/
|
|
35
|
+
class HybridReactNativeJpushSpecSwift: public virtual HybridReactNativeJpushSpec {
|
|
36
|
+
public:
|
|
37
|
+
// Constructor from a Swift instance
|
|
38
|
+
explicit HybridReactNativeJpushSpecSwift(const ReactNativeJpush::HybridReactNativeJpushSpec_cxx& swiftPart):
|
|
39
|
+
HybridObject(HybridReactNativeJpushSpec::TAG),
|
|
40
|
+
_swiftPart(swiftPart) { }
|
|
41
|
+
|
|
42
|
+
public:
|
|
43
|
+
// Get the Swift part
|
|
44
|
+
inline ReactNativeJpush::HybridReactNativeJpushSpec_cxx& getSwiftPart() noexcept {
|
|
45
|
+
return _swiftPart;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
inline size_t getExternalMemorySize() noexcept override {
|
|
50
|
+
return _swiftPart.getMemorySize();
|
|
51
|
+
}
|
|
52
|
+
bool equals(const std::shared_ptr<HybridObject>& other) override {
|
|
53
|
+
if (auto otherCast = std::dynamic_pointer_cast<HybridReactNativeJpushSpecSwift>(other)) {
|
|
54
|
+
return _swiftPart.equals(otherCast->_swiftPart);
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
void dispose() noexcept override {
|
|
59
|
+
_swiftPart.dispose();
|
|
60
|
+
}
|
|
61
|
+
std::string toString() override {
|
|
62
|
+
return _swiftPart.toString();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
public:
|
|
66
|
+
// Properties
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
public:
|
|
70
|
+
// Methods
|
|
71
|
+
inline void setDebugMode(bool enable) override {
|
|
72
|
+
auto __result = _swiftPart.setDebugMode(std::forward<decltype(enable)>(enable));
|
|
73
|
+
if (__result.hasError()) [[unlikely]] {
|
|
74
|
+
std::rethrow_exception(__result.error());
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
inline void initPush() override {
|
|
78
|
+
auto __result = _swiftPart.initPush();
|
|
79
|
+
if (__result.hasError()) [[unlikely]] {
|
|
80
|
+
std::rethrow_exception(__result.error());
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
inline void setupWithConfig(const std::string& appKey, const std::string& channel, bool production) override {
|
|
84
|
+
auto __result = _swiftPart.setupWithConfig(appKey, channel, std::forward<decltype(production)>(production));
|
|
85
|
+
if (__result.hasError()) [[unlikely]] {
|
|
86
|
+
std::rethrow_exception(__result.error());
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
inline void loadJS() override {
|
|
90
|
+
auto __result = _swiftPart.loadJS();
|
|
91
|
+
if (__result.hasError()) [[unlikely]] {
|
|
92
|
+
std::rethrow_exception(__result.error());
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
inline void stopPush() override {
|
|
96
|
+
auto __result = _swiftPart.stopPush();
|
|
97
|
+
if (__result.hasError()) [[unlikely]] {
|
|
98
|
+
std::rethrow_exception(__result.error());
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
inline void resumePush() override {
|
|
102
|
+
auto __result = _swiftPart.resumePush();
|
|
103
|
+
if (__result.hasError()) [[unlikely]] {
|
|
104
|
+
std::rethrow_exception(__result.error());
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
inline bool isPushStopped() override {
|
|
108
|
+
auto __result = _swiftPart.isPushStopped();
|
|
109
|
+
if (__result.hasError()) [[unlikely]] {
|
|
110
|
+
std::rethrow_exception(__result.error());
|
|
111
|
+
}
|
|
112
|
+
auto __value = std::move(__result.value());
|
|
113
|
+
return __value;
|
|
114
|
+
}
|
|
115
|
+
inline std::string getRegistrationID() override {
|
|
116
|
+
auto __result = _swiftPart.getRegistrationID();
|
|
117
|
+
if (__result.hasError()) [[unlikely]] {
|
|
118
|
+
std::rethrow_exception(__result.error());
|
|
119
|
+
}
|
|
120
|
+
auto __value = std::move(__result.value());
|
|
121
|
+
return __value;
|
|
122
|
+
}
|
|
123
|
+
inline void isNotificationEnabled(const std::function<void(bool /* enabled */)>& callback) override {
|
|
124
|
+
auto __result = _swiftPart.isNotificationEnabled(callback);
|
|
125
|
+
if (__result.hasError()) [[unlikely]] {
|
|
126
|
+
std::rethrow_exception(__result.error());
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
inline void addTags(double sequence, const std::vector<std::string>& tags) override {
|
|
130
|
+
auto __result = _swiftPart.addTags(std::forward<decltype(sequence)>(sequence), tags);
|
|
131
|
+
if (__result.hasError()) [[unlikely]] {
|
|
132
|
+
std::rethrow_exception(__result.error());
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
inline void setTags(double sequence, const std::vector<std::string>& tags) override {
|
|
136
|
+
auto __result = _swiftPart.setTags(std::forward<decltype(sequence)>(sequence), tags);
|
|
137
|
+
if (__result.hasError()) [[unlikely]] {
|
|
138
|
+
std::rethrow_exception(__result.error());
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
inline void deleteTags(double sequence, const std::vector<std::string>& tags) override {
|
|
142
|
+
auto __result = _swiftPart.deleteTags(std::forward<decltype(sequence)>(sequence), tags);
|
|
143
|
+
if (__result.hasError()) [[unlikely]] {
|
|
144
|
+
std::rethrow_exception(__result.error());
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
inline void cleanTags(double sequence) override {
|
|
148
|
+
auto __result = _swiftPart.cleanTags(std::forward<decltype(sequence)>(sequence));
|
|
149
|
+
if (__result.hasError()) [[unlikely]] {
|
|
150
|
+
std::rethrow_exception(__result.error());
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
inline void getAllTags(double sequence) override {
|
|
154
|
+
auto __result = _swiftPart.getAllTags(std::forward<decltype(sequence)>(sequence));
|
|
155
|
+
if (__result.hasError()) [[unlikely]] {
|
|
156
|
+
std::rethrow_exception(__result.error());
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
inline void checkTagBindState(double sequence, const std::string& tag) override {
|
|
160
|
+
auto __result = _swiftPart.checkTagBindState(std::forward<decltype(sequence)>(sequence), tag);
|
|
161
|
+
if (__result.hasError()) [[unlikely]] {
|
|
162
|
+
std::rethrow_exception(__result.error());
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
inline void setAlias(double sequence, const std::string& alias) override {
|
|
166
|
+
auto __result = _swiftPart.setAlias(std::forward<decltype(sequence)>(sequence), alias);
|
|
167
|
+
if (__result.hasError()) [[unlikely]] {
|
|
168
|
+
std::rethrow_exception(__result.error());
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
inline void deleteAlias(double sequence) override {
|
|
172
|
+
auto __result = _swiftPart.deleteAlias(std::forward<decltype(sequence)>(sequence));
|
|
173
|
+
if (__result.hasError()) [[unlikely]] {
|
|
174
|
+
std::rethrow_exception(__result.error());
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
inline void getAlias(double sequence) override {
|
|
178
|
+
auto __result = _swiftPart.getAlias(std::forward<decltype(sequence)>(sequence));
|
|
179
|
+
if (__result.hasError()) [[unlikely]] {
|
|
180
|
+
std::rethrow_exception(__result.error());
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
inline void setProperties(double sequence, const std::string& propertiesJson) override {
|
|
184
|
+
auto __result = _swiftPart.setProperties(std::forward<decltype(sequence)>(sequence), propertiesJson);
|
|
185
|
+
if (__result.hasError()) [[unlikely]] {
|
|
186
|
+
std::rethrow_exception(__result.error());
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
inline void deleteProperties(double sequence, const std::vector<std::string>& keys) override {
|
|
190
|
+
auto __result = _swiftPart.deleteProperties(std::forward<decltype(sequence)>(sequence), keys);
|
|
191
|
+
if (__result.hasError()) [[unlikely]] {
|
|
192
|
+
std::rethrow_exception(__result.error());
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
inline void cleanProperties(double sequence) override {
|
|
196
|
+
auto __result = _swiftPart.cleanProperties(std::forward<decltype(sequence)>(sequence));
|
|
197
|
+
if (__result.hasError()) [[unlikely]] {
|
|
198
|
+
std::rethrow_exception(__result.error());
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
inline void setBadge(double badge, double appBadge) override {
|
|
202
|
+
auto __result = _swiftPart.setBadge(std::forward<decltype(badge)>(badge), std::forward<decltype(appBadge)>(appBadge));
|
|
203
|
+
if (__result.hasError()) [[unlikely]] {
|
|
204
|
+
std::rethrow_exception(__result.error());
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
inline void setMobileNumber(double sequence, const std::string& mobileNumber) override {
|
|
208
|
+
auto __result = _swiftPart.setMobileNumber(std::forward<decltype(sequence)>(sequence), mobileNumber);
|
|
209
|
+
if (__result.hasError()) [[unlikely]] {
|
|
210
|
+
std::rethrow_exception(__result.error());
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
inline void initCrashHandler() override {
|
|
214
|
+
auto __result = _swiftPart.initCrashHandler();
|
|
215
|
+
if (__result.hasError()) [[unlikely]] {
|
|
216
|
+
std::rethrow_exception(__result.error());
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
inline void setPowerSaveMode(bool enable) override {
|
|
220
|
+
auto __result = _swiftPart.setPowerSaveMode(std::forward<decltype(enable)>(enable));
|
|
221
|
+
if (__result.hasError()) [[unlikely]] {
|
|
222
|
+
std::rethrow_exception(__result.error());
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
inline void addLocalNotification(const std::string& messageID, const std::string& title, const std::string& content, const std::string& broadcastTime, const std::string& extrasJson) override {
|
|
226
|
+
auto __result = _swiftPart.addLocalNotification(messageID, title, content, broadcastTime, extrasJson);
|
|
227
|
+
if (__result.hasError()) [[unlikely]] {
|
|
228
|
+
std::rethrow_exception(__result.error());
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
inline void removeLocalNotification(const std::string& messageID) override {
|
|
232
|
+
auto __result = _swiftPart.removeLocalNotification(messageID);
|
|
233
|
+
if (__result.hasError()) [[unlikely]] {
|
|
234
|
+
std::rethrow_exception(__result.error());
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
inline void clearLocalNotifications() override {
|
|
238
|
+
auto __result = _swiftPart.clearLocalNotifications();
|
|
239
|
+
if (__result.hasError()) [[unlikely]] {
|
|
240
|
+
std::rethrow_exception(__result.error());
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
inline void clearAllNotifications() override {
|
|
244
|
+
auto __result = _swiftPart.clearAllNotifications();
|
|
245
|
+
if (__result.hasError()) [[unlikely]] {
|
|
246
|
+
std::rethrow_exception(__result.error());
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
inline void clearNotificationById(double notificationId) override {
|
|
250
|
+
auto __result = _swiftPart.clearNotificationById(std::forward<decltype(notificationId)>(notificationId));
|
|
251
|
+
if (__result.hasError()) [[unlikely]] {
|
|
252
|
+
std::rethrow_exception(__result.error());
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
inline void requestPermission() override {
|
|
256
|
+
auto __result = _swiftPart.requestPermission();
|
|
257
|
+
if (__result.hasError()) [[unlikely]] {
|
|
258
|
+
std::rethrow_exception(__result.error());
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
inline void setPushTime(const std::vector<double>& days, double startHour, double endHour) override {
|
|
262
|
+
auto __result = _swiftPart.setPushTime(days, std::forward<decltype(startHour)>(startHour), std::forward<decltype(endHour)>(endHour));
|
|
263
|
+
if (__result.hasError()) [[unlikely]] {
|
|
264
|
+
std::rethrow_exception(__result.error());
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
inline void setSilenceTime(double startHour, double startMinute, double endHour, double endMinute) override {
|
|
268
|
+
auto __result = _swiftPart.setSilenceTime(std::forward<decltype(startHour)>(startHour), std::forward<decltype(startMinute)>(startMinute), std::forward<decltype(endHour)>(endHour), std::forward<decltype(endMinute)>(endMinute));
|
|
269
|
+
if (__result.hasError()) [[unlikely]] {
|
|
270
|
+
std::rethrow_exception(__result.error());
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
inline void setLatestNotificationNumber(double maxNumber) override {
|
|
274
|
+
auto __result = _swiftPart.setLatestNotificationNumber(std::forward<decltype(maxNumber)>(maxNumber));
|
|
275
|
+
if (__result.hasError()) [[unlikely]] {
|
|
276
|
+
std::rethrow_exception(__result.error());
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
inline void setChannel(const std::string& channel) override {
|
|
280
|
+
auto __result = _swiftPart.setChannel(channel);
|
|
281
|
+
if (__result.hasError()) [[unlikely]] {
|
|
282
|
+
std::rethrow_exception(__result.error());
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
inline void setChannelAndSound(const std::string& channel, const std::string& channelId, const std::string& sound) override {
|
|
286
|
+
auto __result = _swiftPart.setChannelAndSound(channel, channelId, sound);
|
|
287
|
+
if (__result.hasError()) [[unlikely]] {
|
|
288
|
+
std::rethrow_exception(__result.error());
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
inline void setLinkMergeEnable(bool enable) override {
|
|
292
|
+
auto __result = _swiftPart.setLinkMergeEnable(std::forward<decltype(enable)>(enable));
|
|
293
|
+
if (__result.hasError()) [[unlikely]] {
|
|
294
|
+
std::rethrow_exception(__result.error());
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
inline void setSmartPushEnable(bool enable) override {
|
|
298
|
+
auto __result = _swiftPart.setSmartPushEnable(std::forward<decltype(enable)>(enable));
|
|
299
|
+
if (__result.hasError()) [[unlikely]] {
|
|
300
|
+
std::rethrow_exception(__result.error());
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
inline void setDataInsightsEnable(bool enable) override {
|
|
304
|
+
auto __result = _swiftPart.setDataInsightsEnable(std::forward<decltype(enable)>(enable));
|
|
305
|
+
if (__result.hasError()) [[unlikely]] {
|
|
306
|
+
std::rethrow_exception(__result.error());
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
inline void setGeofenceEnable(bool enable) override {
|
|
310
|
+
auto __result = _swiftPart.setGeofenceEnable(std::forward<decltype(enable)>(enable));
|
|
311
|
+
if (__result.hasError()) [[unlikely]] {
|
|
312
|
+
std::rethrow_exception(__result.error());
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
inline void setBackgroundEnable(bool enable) override {
|
|
316
|
+
auto __result = _swiftPart.setBackgroundEnable(std::forward<decltype(enable)>(enable));
|
|
317
|
+
if (__result.hasError()) [[unlikely]] {
|
|
318
|
+
std::rethrow_exception(__result.error());
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
inline void setMaxGeofenceNumber(double maxNumber) override {
|
|
322
|
+
auto __result = _swiftPart.setMaxGeofenceNumber(std::forward<decltype(maxNumber)>(maxNumber));
|
|
323
|
+
if (__result.hasError()) [[unlikely]] {
|
|
324
|
+
std::rethrow_exception(__result.error());
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
inline void deleteGeofence(const std::string& geoFenceID) override {
|
|
328
|
+
auto __result = _swiftPart.deleteGeofence(geoFenceID);
|
|
329
|
+
if (__result.hasError()) [[unlikely]] {
|
|
330
|
+
std::rethrow_exception(__result.error());
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
inline void pageEnterTo(const std::string& pageName) override {
|
|
334
|
+
auto __result = _swiftPart.pageEnterTo(pageName);
|
|
335
|
+
if (__result.hasError()) [[unlikely]] {
|
|
336
|
+
std::rethrow_exception(__result.error());
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
inline void pageLeave(const std::string& pageName) override {
|
|
340
|
+
auto __result = _swiftPart.pageLeave(pageName);
|
|
341
|
+
if (__result.hasError()) [[unlikely]] {
|
|
342
|
+
std::rethrow_exception(__result.error());
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
inline void setCollectControl(bool imei, bool imsi, bool mac, bool wifi, bool bssid, bool ssid, bool cell, bool gps) override {
|
|
346
|
+
auto __result = _swiftPart.setCollectControl(std::forward<decltype(imei)>(imei), std::forward<decltype(imsi)>(imsi), std::forward<decltype(mac)>(mac), std::forward<decltype(wifi)>(wifi), std::forward<decltype(bssid)>(bssid), std::forward<decltype(ssid)>(ssid), std::forward<decltype(cell)>(cell), std::forward<decltype(gps)>(gps));
|
|
347
|
+
if (__result.hasError()) [[unlikely]] {
|
|
348
|
+
std::rethrow_exception(__result.error());
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
inline void setAuth(bool auth) override {
|
|
352
|
+
auto __result = _swiftPart.setAuth(std::forward<decltype(auth)>(auth));
|
|
353
|
+
if (__result.hasError()) [[unlikely]] {
|
|
354
|
+
std::rethrow_exception(__result.error());
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
inline void setCountryCode(const std::string& code) override {
|
|
358
|
+
auto __result = _swiftPart.setCountryCode(code);
|
|
359
|
+
if (__result.hasError()) [[unlikely]] {
|
|
360
|
+
std::rethrow_exception(__result.error());
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
inline void enableAutoWakeup(bool enable) override {
|
|
364
|
+
auto __result = _swiftPart.enableAutoWakeup(std::forward<decltype(enable)>(enable));
|
|
365
|
+
if (__result.hasError()) [[unlikely]] {
|
|
366
|
+
std::rethrow_exception(__result.error());
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
inline void enableSDKLocalLog(bool enable, bool uploadJgToServer) override {
|
|
370
|
+
auto __result = _swiftPart.enableSDKLocalLog(std::forward<decltype(enable)>(enable), std::forward<decltype(uploadJgToServer)>(uploadJgToServer));
|
|
371
|
+
if (__result.hasError()) [[unlikely]] {
|
|
372
|
+
std::rethrow_exception(__result.error());
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
inline std::string readNewLogs() override {
|
|
376
|
+
auto __result = _swiftPart.readNewLogs();
|
|
377
|
+
if (__result.hasError()) [[unlikely]] {
|
|
378
|
+
std::rethrow_exception(__result.error());
|
|
379
|
+
}
|
|
380
|
+
auto __value = std::move(__result.value());
|
|
381
|
+
return __value;
|
|
382
|
+
}
|
|
383
|
+
inline double addEventListener(const std::function<void(const std::string& /* eventName */, const std::string& /* payloadJson */)>& callback) override {
|
|
384
|
+
auto __result = _swiftPart.addEventListener(callback);
|
|
385
|
+
if (__result.hasError()) [[unlikely]] {
|
|
386
|
+
std::rethrow_exception(__result.error());
|
|
387
|
+
}
|
|
388
|
+
auto __value = std::move(__result.value());
|
|
389
|
+
return __value;
|
|
390
|
+
}
|
|
391
|
+
inline void removeEventListener(double id) override {
|
|
392
|
+
auto __result = _swiftPart.removeEventListener(std::forward<decltype(id)>(id));
|
|
393
|
+
if (__result.hasError()) [[unlikely]] {
|
|
394
|
+
std::rethrow_exception(__result.error());
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
private:
|
|
399
|
+
ReactNativeJpush::HybridReactNativeJpushSpec_cxx _swiftPart;
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
} // namespace margelo::nitro::reactnativejpush
|