@ua/react-native-airship 24.5.1 → 25.0.0
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/README.md +4 -3
- package/android/build.gradle +1 -1
- package/android/generated/jni/CMakeLists.txt +1 -9
- package/android/generated/jni/react/renderer/components/RNAirshipSpec/EventEmitters.cpp +22 -22
- package/android/generated/jni/react/renderer/components/RNAirshipSpec/Props.cpp +48 -4
- package/android/generated/jni/react/renderer/components/RNAirshipSpec/Props.h +12 -0
- package/android/generated/jni/react/renderer/components/RNAirshipSpec/States.h +4 -23
- package/android/gradle.properties +3 -3
- package/android/src/main/java/com/urbanairship/reactnative/AirshipPackage.kt +10 -14
- package/android/src/main/java/com/urbanairship/reactnative/ReactEmbeddedViewManager.kt +7 -2
- package/android/src/main/java/com/urbanairship/reactnative/ReactMessageViewManager.kt +6 -2
- package/ios/AirshipReactNative.swift +1 -1
- package/ios/generated/RNAirshipSpec/EventEmitters.cpp +22 -22
- package/ios/generated/RNAirshipSpec/Props.cpp +48 -4
- package/ios/generated/RNAirshipSpec/Props.h +12 -0
- package/ios/generated/RNAirshipSpec/States.h +4 -23
- package/lib/module/NativeRNAirship.js +5 -0
- package/lib/module/NativeRNAirship.js.map +1 -0
- package/package.json +14 -10
- package/react-native-airship.podspec +1 -23
- package/lib/module/NativeRNAirship.ts +0 -139
package/README.md
CHANGED
|
@@ -6,12 +6,13 @@ A React Native module for Airship's iOS and Android SDK.
|
|
|
6
6
|
|
|
7
7
|
| RN Version | Airship RN Version | Support level |
|
|
8
8
|
| --------------- | -------------------------- | ------------- |
|
|
9
|
+
| 0.81.x | 25.x | Active |
|
|
9
10
|
| 0.80.x | 24.x | Active |
|
|
10
|
-
| 0.79.x | 24.x |
|
|
11
|
-
| 0.78.x | 23.x |
|
|
11
|
+
| 0.79.x | 24.x | End of Cycle |
|
|
12
|
+
| 0.78.x | 23.x | Unsupported |
|
|
12
13
|
| 0.70.x<=0.77.x | 21.x | Unsupported |
|
|
13
14
|
|
|
14
|
-
*Last Updated:
|
|
15
|
+
*Last Updated: August 20, 2025*
|
|
15
16
|
|
|
16
17
|
Airship adheres to the [React Native Support Policy](https://github.com/reactwg/react-native-releases/blob/main/docs/support.md)
|
|
17
18
|
and will support at least two major React Native versions at any given time.
|
package/android/build.gradle
CHANGED
|
@@ -11,7 +11,7 @@ buildscript {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
dependencies {
|
|
14
|
-
classpath "com.android.tools.build:gradle:8.
|
|
14
|
+
classpath "com.android.tools.build:gradle:8.11.1"
|
|
15
15
|
// noinspection DifferentKotlinGradleVersion
|
|
16
16
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
17
17
|
}
|
|
@@ -25,12 +25,4 @@ target_link_libraries(
|
|
|
25
25
|
reactnative
|
|
26
26
|
)
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
react_codegen_RNAirshipSpec
|
|
30
|
-
PRIVATE
|
|
31
|
-
-DLOG_TAG=\"ReactNative\"
|
|
32
|
-
-fexceptions
|
|
33
|
-
-frtti
|
|
34
|
-
-std=c++20
|
|
35
|
-
-Wall
|
|
36
|
-
)
|
|
28
|
+
target_compile_reactnative_options(react_codegen_RNAirshipSpec PRIVATE)
|
|
@@ -14,40 +14,40 @@
|
|
|
14
14
|
namespace facebook::react {
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
void RNAirshipMessageViewEventEmitter::onLoadStarted(OnLoadStarted
|
|
18
|
-
dispatchEvent("topLoadStarted", [
|
|
19
|
-
auto
|
|
20
|
-
|
|
21
|
-
return
|
|
17
|
+
void RNAirshipMessageViewEventEmitter::onLoadStarted(OnLoadStarted event) const {
|
|
18
|
+
dispatchEvent("topLoadStarted", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
19
|
+
auto payload = jsi::Object(runtime);
|
|
20
|
+
payload.setProperty(runtime, "messageId", event.messageId);
|
|
21
|
+
return payload;
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
void RNAirshipMessageViewEventEmitter::onLoadFinished(OnLoadFinished
|
|
27
|
-
dispatchEvent("topLoadFinished", [
|
|
28
|
-
auto
|
|
29
|
-
|
|
30
|
-
return
|
|
26
|
+
void RNAirshipMessageViewEventEmitter::onLoadFinished(OnLoadFinished event) const {
|
|
27
|
+
dispatchEvent("topLoadFinished", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
28
|
+
auto payload = jsi::Object(runtime);
|
|
29
|
+
payload.setProperty(runtime, "messageId", event.messageId);
|
|
30
|
+
return payload;
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
void RNAirshipMessageViewEventEmitter::onLoadError(OnLoadError
|
|
36
|
-
dispatchEvent("topLoadError", [
|
|
37
|
-
auto
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return
|
|
35
|
+
void RNAirshipMessageViewEventEmitter::onLoadError(OnLoadError event) const {
|
|
36
|
+
dispatchEvent("topLoadError", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
37
|
+
auto payload = jsi::Object(runtime);
|
|
38
|
+
payload.setProperty(runtime, "messageId", event.messageId);
|
|
39
|
+
payload.setProperty(runtime, "retryable", event.retryable);
|
|
40
|
+
payload.setProperty(runtime, "error", event.error);
|
|
41
|
+
return payload;
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
void RNAirshipMessageViewEventEmitter::onClose(OnClose
|
|
47
|
-
dispatchEvent("topClose", [
|
|
48
|
-
auto
|
|
49
|
-
|
|
50
|
-
return
|
|
46
|
+
void RNAirshipMessageViewEventEmitter::onClose(OnClose event) const {
|
|
47
|
+
dispatchEvent("topClose", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
48
|
+
auto payload = jsi::Object(runtime);
|
|
49
|
+
payload.setProperty(runtime, "messageId", event.messageId);
|
|
50
|
+
return payload;
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -19,14 +19,58 @@ RNAirshipEmbeddedViewProps::RNAirshipEmbeddedViewProps(
|
|
|
19
19
|
const RNAirshipEmbeddedViewProps &sourceProps,
|
|
20
20
|
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
21
21
|
|
|
22
|
-
embeddedId(convertRawProp(context, rawProps, "embeddedId", sourceProps.embeddedId, {}))
|
|
23
|
-
|
|
22
|
+
embeddedId(convertRawProp(context, rawProps, "embeddedId", sourceProps.embeddedId, {})) {}
|
|
23
|
+
|
|
24
|
+
#ifdef RN_SERIALIZABLE_STATE
|
|
25
|
+
ComponentName RNAirshipEmbeddedViewProps::getDiffPropsImplementationTarget() const {
|
|
26
|
+
return "RNAirshipEmbeddedView";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
folly::dynamic RNAirshipEmbeddedViewProps::getDiffProps(
|
|
30
|
+
const Props* prevProps) const {
|
|
31
|
+
static const auto defaultProps = RNAirshipEmbeddedViewProps();
|
|
32
|
+
const RNAirshipEmbeddedViewProps* oldProps = prevProps == nullptr
|
|
33
|
+
? &defaultProps
|
|
34
|
+
: static_cast<const RNAirshipEmbeddedViewProps*>(prevProps);
|
|
35
|
+
if (this == oldProps) {
|
|
36
|
+
return folly::dynamic::object();
|
|
37
|
+
}
|
|
38
|
+
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
|
|
39
|
+
|
|
40
|
+
if (embeddedId != oldProps->embeddedId) {
|
|
41
|
+
result["embeddedId"] = embeddedId;
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
#endif
|
|
24
46
|
RNAirshipMessageViewProps::RNAirshipMessageViewProps(
|
|
25
47
|
const PropsParserContext &context,
|
|
26
48
|
const RNAirshipMessageViewProps &sourceProps,
|
|
27
49
|
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
28
50
|
|
|
29
|
-
messageId(convertRawProp(context, rawProps, "messageId", sourceProps.messageId, {}))
|
|
30
|
-
|
|
51
|
+
messageId(convertRawProp(context, rawProps, "messageId", sourceProps.messageId, {})) {}
|
|
52
|
+
|
|
53
|
+
#ifdef RN_SERIALIZABLE_STATE
|
|
54
|
+
ComponentName RNAirshipMessageViewProps::getDiffPropsImplementationTarget() const {
|
|
55
|
+
return "RNAirshipMessageView";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
folly::dynamic RNAirshipMessageViewProps::getDiffProps(
|
|
59
|
+
const Props* prevProps) const {
|
|
60
|
+
static const auto defaultProps = RNAirshipMessageViewProps();
|
|
61
|
+
const RNAirshipMessageViewProps* oldProps = prevProps == nullptr
|
|
62
|
+
? &defaultProps
|
|
63
|
+
: static_cast<const RNAirshipMessageViewProps*>(prevProps);
|
|
64
|
+
if (this == oldProps) {
|
|
65
|
+
return folly::dynamic::object();
|
|
66
|
+
}
|
|
67
|
+
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
|
|
68
|
+
|
|
69
|
+
if (messageId != oldProps->messageId) {
|
|
70
|
+
result["messageId"] = messageId;
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
#endif
|
|
31
75
|
|
|
32
76
|
} // namespace facebook::react
|
|
@@ -22,6 +22,12 @@ class RNAirshipEmbeddedViewProps final : public ViewProps {
|
|
|
22
22
|
#pragma mark - Props
|
|
23
23
|
|
|
24
24
|
std::string embeddedId{};
|
|
25
|
+
|
|
26
|
+
#ifdef RN_SERIALIZABLE_STATE
|
|
27
|
+
ComponentName getDiffPropsImplementationTarget() const override;
|
|
28
|
+
|
|
29
|
+
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
|
30
|
+
#endif
|
|
25
31
|
};
|
|
26
32
|
|
|
27
33
|
class RNAirshipMessageViewProps final : public ViewProps {
|
|
@@ -32,6 +38,12 @@ class RNAirshipMessageViewProps final : public ViewProps {
|
|
|
32
38
|
#pragma mark - Props
|
|
33
39
|
|
|
34
40
|
std::string messageId{};
|
|
41
|
+
|
|
42
|
+
#ifdef RN_SERIALIZABLE_STATE
|
|
43
|
+
ComponentName getDiffPropsImplementationTarget() const override;
|
|
44
|
+
|
|
45
|
+
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
|
46
|
+
#endif
|
|
35
47
|
};
|
|
36
48
|
|
|
37
49
|
} // namespace facebook::react
|
|
@@ -8,34 +8,15 @@
|
|
|
8
8
|
*/
|
|
9
9
|
#pragma once
|
|
10
10
|
|
|
11
|
-
#
|
|
11
|
+
#include <react/renderer/core/StateData.h>
|
|
12
|
+
#ifdef RN_SERIALIZABLE_STATE
|
|
12
13
|
#include <folly/dynamic.h>
|
|
13
14
|
#endif
|
|
14
15
|
|
|
15
16
|
namespace facebook::react {
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
public:
|
|
19
|
-
RNAirshipEmbeddedViewState() = default;
|
|
18
|
+
using RNAirshipEmbeddedViewState = StateData;
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
RNAirshipEmbeddedViewState(RNAirshipEmbeddedViewState const &previousState, folly::dynamic data){};
|
|
23
|
-
folly::dynamic getDynamic() const {
|
|
24
|
-
return {};
|
|
25
|
-
};
|
|
26
|
-
#endif
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
class RNAirshipMessageViewState {
|
|
30
|
-
public:
|
|
31
|
-
RNAirshipMessageViewState() = default;
|
|
32
|
-
|
|
33
|
-
#ifdef ANDROID
|
|
34
|
-
RNAirshipMessageViewState(RNAirshipMessageViewState const &previousState, folly::dynamic data){};
|
|
35
|
-
folly::dynamic getDynamic() const {
|
|
36
|
-
return {};
|
|
37
|
-
};
|
|
38
|
-
#endif
|
|
39
|
-
};
|
|
20
|
+
using RNAirshipMessageViewState = StateData;
|
|
40
21
|
|
|
41
22
|
} // namespace facebook::react
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Airship_kotlinVersion=1.
|
|
1
|
+
Airship_kotlinVersion=2.1.20
|
|
2
2
|
Airship_minSdkVersion=23
|
|
3
|
-
Airship_targetSdkVersion=
|
|
4
|
-
Airship_compileSdkVersion=
|
|
3
|
+
Airship_targetSdkVersion=36
|
|
4
|
+
Airship_compileSdkVersion=36
|
|
5
5
|
Airship_ndkversion=26.1.10909125
|
|
6
6
|
Airship_airshipProxyVersion=14.6.1
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
package com.urbanairship.reactnative
|
|
2
2
|
|
|
3
|
-
import com.facebook.react.
|
|
4
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
3
|
+
import com.facebook.react.BaseReactPackage
|
|
5
4
|
import com.facebook.react.bridge.NativeModule
|
|
6
|
-
import com.facebook.react.
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
6
|
import com.facebook.react.module.model.ReactModuleInfo
|
|
7
|
+
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
8
8
|
import com.facebook.react.uimanager.ViewManager
|
|
9
|
-
import java.util.HashMap
|
|
10
9
|
|
|
11
|
-
class AirshipPackage :
|
|
10
|
+
class AirshipPackage : BaseReactPackage() {
|
|
12
11
|
override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
|
|
13
12
|
return if (name == AirshipModule.NAME) {
|
|
14
13
|
AirshipModule(reactContext)
|
|
@@ -20,21 +19,18 @@ class AirshipPackage : TurboReactPackage() {
|
|
|
20
19
|
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
|
|
21
20
|
return ReactModuleInfoProvider {
|
|
22
21
|
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
|
|
23
|
-
val isTurboModule: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
|
24
22
|
moduleInfos[AirshipModule.NAME] = ReactModuleInfo(
|
|
25
|
-
AirshipModule.NAME,
|
|
26
|
-
AirshipModule.NAME,
|
|
27
|
-
false,
|
|
28
|
-
false,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
isTurboModule // isTurboModule
|
|
23
|
+
name =AirshipModule.NAME,
|
|
24
|
+
className = AirshipModule.NAME,
|
|
25
|
+
canOverrideExistingModule = false,
|
|
26
|
+
needsEagerInit = false,
|
|
27
|
+
isCxxModule = false, // isCxxModule
|
|
28
|
+
isTurboModule = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED // isTurboModule
|
|
32
29
|
)
|
|
33
30
|
moduleInfos
|
|
34
31
|
}
|
|
35
32
|
}
|
|
36
33
|
|
|
37
|
-
|
|
38
34
|
override fun createViewManagers(reactContext: ReactApplicationContext): List<ViewManager<*, *>> {
|
|
39
35
|
return listOf<ViewManager<*, *>>(ReactMessageViewManager(), ReactEmbeddedViewManager())
|
|
40
36
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
package com.urbanairship.reactnative
|
|
4
4
|
|
|
5
|
+
import com.facebook.react.bridge.ReadableArray
|
|
5
6
|
import com.facebook.react.uimanager.SimpleViewManager
|
|
6
7
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
7
8
|
import com.facebook.react.uimanager.ViewManagerDelegate
|
|
@@ -20,8 +21,12 @@ class ReactEmbeddedViewManager : SimpleViewManager<ReactEmbeddedView>(),
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
|
|
23
|
-
override fun receiveCommand(
|
|
24
|
-
|
|
24
|
+
override fun receiveCommand(
|
|
25
|
+
view: ReactEmbeddedView,
|
|
26
|
+
commandName: String,
|
|
27
|
+
args: ReadableArray
|
|
28
|
+
) {
|
|
29
|
+
// No commands supported
|
|
25
30
|
}
|
|
26
31
|
}
|
|
27
32
|
|
|
@@ -22,8 +22,12 @@ class ReactMessageViewManager : SimpleViewManager<ReactMessageView>(),
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
override fun receiveCommand(
|
|
26
|
-
|
|
25
|
+
override fun receiveCommand(
|
|
26
|
+
view: ReactMessageView,
|
|
27
|
+
commandName: String,
|
|
28
|
+
args: ReadableArray
|
|
29
|
+
) {
|
|
30
|
+
// No commands supported
|
|
27
31
|
}
|
|
28
32
|
}
|
|
29
33
|
|
|
@@ -14,40 +14,40 @@
|
|
|
14
14
|
namespace facebook::react {
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
void RNAirshipMessageViewEventEmitter::onLoadStarted(OnLoadStarted
|
|
18
|
-
dispatchEvent("topLoadStarted", [
|
|
19
|
-
auto
|
|
20
|
-
|
|
21
|
-
return
|
|
17
|
+
void RNAirshipMessageViewEventEmitter::onLoadStarted(OnLoadStarted event) const {
|
|
18
|
+
dispatchEvent("topLoadStarted", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
19
|
+
auto payload = jsi::Object(runtime);
|
|
20
|
+
payload.setProperty(runtime, "messageId", event.messageId);
|
|
21
|
+
return payload;
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
void RNAirshipMessageViewEventEmitter::onLoadFinished(OnLoadFinished
|
|
27
|
-
dispatchEvent("topLoadFinished", [
|
|
28
|
-
auto
|
|
29
|
-
|
|
30
|
-
return
|
|
26
|
+
void RNAirshipMessageViewEventEmitter::onLoadFinished(OnLoadFinished event) const {
|
|
27
|
+
dispatchEvent("topLoadFinished", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
28
|
+
auto payload = jsi::Object(runtime);
|
|
29
|
+
payload.setProperty(runtime, "messageId", event.messageId);
|
|
30
|
+
return payload;
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
void RNAirshipMessageViewEventEmitter::onLoadError(OnLoadError
|
|
36
|
-
dispatchEvent("topLoadError", [
|
|
37
|
-
auto
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return
|
|
35
|
+
void RNAirshipMessageViewEventEmitter::onLoadError(OnLoadError event) const {
|
|
36
|
+
dispatchEvent("topLoadError", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
37
|
+
auto payload = jsi::Object(runtime);
|
|
38
|
+
payload.setProperty(runtime, "messageId", event.messageId);
|
|
39
|
+
payload.setProperty(runtime, "retryable", event.retryable);
|
|
40
|
+
payload.setProperty(runtime, "error", event.error);
|
|
41
|
+
return payload;
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
void RNAirshipMessageViewEventEmitter::onClose(OnClose
|
|
47
|
-
dispatchEvent("topClose", [
|
|
48
|
-
auto
|
|
49
|
-
|
|
50
|
-
return
|
|
46
|
+
void RNAirshipMessageViewEventEmitter::onClose(OnClose event) const {
|
|
47
|
+
dispatchEvent("topClose", [event=std::move(event)](jsi::Runtime &runtime) {
|
|
48
|
+
auto payload = jsi::Object(runtime);
|
|
49
|
+
payload.setProperty(runtime, "messageId", event.messageId);
|
|
50
|
+
return payload;
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -19,14 +19,58 @@ RNAirshipEmbeddedViewProps::RNAirshipEmbeddedViewProps(
|
|
|
19
19
|
const RNAirshipEmbeddedViewProps &sourceProps,
|
|
20
20
|
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
21
21
|
|
|
22
|
-
embeddedId(convertRawProp(context, rawProps, "embeddedId", sourceProps.embeddedId, {}))
|
|
23
|
-
|
|
22
|
+
embeddedId(convertRawProp(context, rawProps, "embeddedId", sourceProps.embeddedId, {})) {}
|
|
23
|
+
|
|
24
|
+
#ifdef RN_SERIALIZABLE_STATE
|
|
25
|
+
ComponentName RNAirshipEmbeddedViewProps::getDiffPropsImplementationTarget() const {
|
|
26
|
+
return "RNAirshipEmbeddedView";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
folly::dynamic RNAirshipEmbeddedViewProps::getDiffProps(
|
|
30
|
+
const Props* prevProps) const {
|
|
31
|
+
static const auto defaultProps = RNAirshipEmbeddedViewProps();
|
|
32
|
+
const RNAirshipEmbeddedViewProps* oldProps = prevProps == nullptr
|
|
33
|
+
? &defaultProps
|
|
34
|
+
: static_cast<const RNAirshipEmbeddedViewProps*>(prevProps);
|
|
35
|
+
if (this == oldProps) {
|
|
36
|
+
return folly::dynamic::object();
|
|
37
|
+
}
|
|
38
|
+
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
|
|
39
|
+
|
|
40
|
+
if (embeddedId != oldProps->embeddedId) {
|
|
41
|
+
result["embeddedId"] = embeddedId;
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
#endif
|
|
24
46
|
RNAirshipMessageViewProps::RNAirshipMessageViewProps(
|
|
25
47
|
const PropsParserContext &context,
|
|
26
48
|
const RNAirshipMessageViewProps &sourceProps,
|
|
27
49
|
const RawProps &rawProps): ViewProps(context, sourceProps, rawProps),
|
|
28
50
|
|
|
29
|
-
messageId(convertRawProp(context, rawProps, "messageId", sourceProps.messageId, {}))
|
|
30
|
-
|
|
51
|
+
messageId(convertRawProp(context, rawProps, "messageId", sourceProps.messageId, {})) {}
|
|
52
|
+
|
|
53
|
+
#ifdef RN_SERIALIZABLE_STATE
|
|
54
|
+
ComponentName RNAirshipMessageViewProps::getDiffPropsImplementationTarget() const {
|
|
55
|
+
return "RNAirshipMessageView";
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
folly::dynamic RNAirshipMessageViewProps::getDiffProps(
|
|
59
|
+
const Props* prevProps) const {
|
|
60
|
+
static const auto defaultProps = RNAirshipMessageViewProps();
|
|
61
|
+
const RNAirshipMessageViewProps* oldProps = prevProps == nullptr
|
|
62
|
+
? &defaultProps
|
|
63
|
+
: static_cast<const RNAirshipMessageViewProps*>(prevProps);
|
|
64
|
+
if (this == oldProps) {
|
|
65
|
+
return folly::dynamic::object();
|
|
66
|
+
}
|
|
67
|
+
folly::dynamic result = HostPlatformViewProps::getDiffProps(prevProps);
|
|
68
|
+
|
|
69
|
+
if (messageId != oldProps->messageId) {
|
|
70
|
+
result["messageId"] = messageId;
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
#endif
|
|
31
75
|
|
|
32
76
|
} // namespace facebook::react
|
|
@@ -22,6 +22,12 @@ class RNAirshipEmbeddedViewProps final : public ViewProps {
|
|
|
22
22
|
#pragma mark - Props
|
|
23
23
|
|
|
24
24
|
std::string embeddedId{};
|
|
25
|
+
|
|
26
|
+
#ifdef RN_SERIALIZABLE_STATE
|
|
27
|
+
ComponentName getDiffPropsImplementationTarget() const override;
|
|
28
|
+
|
|
29
|
+
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
|
30
|
+
#endif
|
|
25
31
|
};
|
|
26
32
|
|
|
27
33
|
class RNAirshipMessageViewProps final : public ViewProps {
|
|
@@ -32,6 +38,12 @@ class RNAirshipMessageViewProps final : public ViewProps {
|
|
|
32
38
|
#pragma mark - Props
|
|
33
39
|
|
|
34
40
|
std::string messageId{};
|
|
41
|
+
|
|
42
|
+
#ifdef RN_SERIALIZABLE_STATE
|
|
43
|
+
ComponentName getDiffPropsImplementationTarget() const override;
|
|
44
|
+
|
|
45
|
+
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
|
46
|
+
#endif
|
|
35
47
|
};
|
|
36
48
|
|
|
37
49
|
} // namespace facebook::react
|
|
@@ -8,34 +8,15 @@
|
|
|
8
8
|
*/
|
|
9
9
|
#pragma once
|
|
10
10
|
|
|
11
|
-
#
|
|
11
|
+
#include <react/renderer/core/StateData.h>
|
|
12
|
+
#ifdef RN_SERIALIZABLE_STATE
|
|
12
13
|
#include <folly/dynamic.h>
|
|
13
14
|
#endif
|
|
14
15
|
|
|
15
16
|
namespace facebook::react {
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
public:
|
|
19
|
-
RNAirshipEmbeddedViewState() = default;
|
|
18
|
+
using RNAirshipEmbeddedViewState = StateData;
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
RNAirshipEmbeddedViewState(RNAirshipEmbeddedViewState const &previousState, folly::dynamic data){};
|
|
23
|
-
folly::dynamic getDynamic() const {
|
|
24
|
-
return {};
|
|
25
|
-
};
|
|
26
|
-
#endif
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
class RNAirshipMessageViewState {
|
|
30
|
-
public:
|
|
31
|
-
RNAirshipMessageViewState() = default;
|
|
32
|
-
|
|
33
|
-
#ifdef ANDROID
|
|
34
|
-
RNAirshipMessageViewState(RNAirshipMessageViewState const &previousState, folly::dynamic data){};
|
|
35
|
-
folly::dynamic getDynamic() const {
|
|
36
|
-
return {};
|
|
37
|
-
};
|
|
38
|
-
#endif
|
|
39
|
-
};
|
|
20
|
+
using RNAirshipMessageViewState = StateData;
|
|
40
21
|
|
|
41
22
|
} // namespace facebook::react
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeRNAirship.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAyIlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,WAAW,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ua/react-native-airship",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0",
|
|
4
4
|
"description": "Airship plugin for React Native apps.",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/module/index.js",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
38
38
|
"prepare": "bob build",
|
|
39
39
|
"example": "npm run --prefix example ${COMMAND}",
|
|
40
|
-
"bootstrap": "npm ci && npm --prefix example ci && npm run --prefix example pods",
|
|
41
40
|
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
42
41
|
"docs": "typedoc --tsconfig ./tsconfig.build.json --out docs src/index.tsx"
|
|
43
42
|
},
|
|
@@ -63,11 +62,13 @@
|
|
|
63
62
|
"@eslint/compat": "^1.2.7",
|
|
64
63
|
"@eslint/eslintrc": "^3.3.0",
|
|
65
64
|
"@eslint/js": "^9.22.0",
|
|
66
|
-
"@react-native-community/cli": "
|
|
67
|
-
"@react-native/
|
|
68
|
-
"@react-native/
|
|
65
|
+
"@react-native-community/cli": "20.0.0",
|
|
66
|
+
"@react-native-community/cli-platform-android": "20.0.0",
|
|
67
|
+
"@react-native-community/cli-platform-ios": "20.0.0",
|
|
68
|
+
"@react-native/babel-preset": "0.81.0",
|
|
69
|
+
"@react-native/eslint-config": "0.81.0",
|
|
69
70
|
"@types/jest": "^29.5.5",
|
|
70
|
-
"@types/react": "^19.
|
|
71
|
+
"@types/react": "^19.1.0",
|
|
71
72
|
"commitlint": "^19.6.1",
|
|
72
73
|
"del-cli": "^5.1.0",
|
|
73
74
|
"eslint": "^9.22.0",
|
|
@@ -75,17 +76,20 @@
|
|
|
75
76
|
"eslint-plugin-prettier": "^5.2.3",
|
|
76
77
|
"jest": "^29.7.0",
|
|
77
78
|
"prettier": "^3.0.3",
|
|
78
|
-
"react": "19.
|
|
79
|
-
"react-native": "0.
|
|
80
|
-
"react-native-builder-bob": "^0.40.
|
|
79
|
+
"react": "19.1.0",
|
|
80
|
+
"react-native": "0.81.0",
|
|
81
|
+
"react-native-builder-bob": "^0.40.13",
|
|
81
82
|
"turbo": "^1.10.7",
|
|
82
83
|
"typedoc": "^0.27.9",
|
|
83
|
-
"typescript": "^5.
|
|
84
|
+
"typescript": "^5.8.3"
|
|
84
85
|
},
|
|
85
86
|
"peerDependencies": {
|
|
86
87
|
"react": "*",
|
|
87
88
|
"react-native": "*"
|
|
88
89
|
},
|
|
90
|
+
"workspaces": [
|
|
91
|
+
"example"
|
|
92
|
+
],
|
|
89
93
|
"commitlint": {
|
|
90
94
|
"extends": [
|
|
91
95
|
"@commitlint/config-conventional"
|
|
@@ -16,29 +16,7 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
|
|
17
17
|
s.private_header_files = "ios/generated/**/*.h"
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
21
|
-
if respond_to?(:install_modules_dependencies, true)
|
|
22
|
-
install_modules_dependencies(s)
|
|
23
|
-
else
|
|
24
|
-
s.dependency "React-Core"
|
|
25
|
-
|
|
26
|
-
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
27
|
-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
28
|
-
s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
|
|
29
|
-
s.pod_target_xcconfig = {
|
|
30
|
-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
31
|
-
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
32
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
33
|
-
}
|
|
34
|
-
s.dependency "React-RCTFabric"
|
|
35
|
-
s.dependency "React-Codegen"
|
|
36
|
-
s.dependency "RCT-Folly"
|
|
37
|
-
s.dependency "RCTRequired"
|
|
38
|
-
s.dependency "RCTTypeSafety"
|
|
39
|
-
s.dependency "ReactCommon/turbomodule/core"
|
|
40
|
-
end
|
|
41
|
-
end
|
|
19
|
+
install_modules_dependencies(s)
|
|
42
20
|
|
|
43
21
|
s.dependency "AirshipFrameworkProxy", "14.6.1"
|
|
44
22
|
end
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import type { TurboModule } from 'react-native';
|
|
2
|
-
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
-
|
|
4
|
-
export interface Spec extends TurboModule {
|
|
5
|
-
// Airship
|
|
6
|
-
takeOff(config: Object): Promise<boolean>;
|
|
7
|
-
isFlying(): Promise<boolean>;
|
|
8
|
-
airshipListenerAdded(eventName: string): void;
|
|
9
|
-
takePendingEvents(
|
|
10
|
-
eventName: string,
|
|
11
|
-
isHeadlessJS: boolean
|
|
12
|
-
): Promise<Object[]>;
|
|
13
|
-
addListener: (eventType: string) => void;
|
|
14
|
-
removeListeners: (count: number) => void;
|
|
15
|
-
|
|
16
|
-
// Channel
|
|
17
|
-
channelEnableChannelCreation(): Promise<void>;
|
|
18
|
-
channelAddTag(tag: string): Promise<void>;
|
|
19
|
-
channelRemoveTag(tag: string): Promise<void>;
|
|
20
|
-
channelEditTags(operations: Object[]): Promise<void>;
|
|
21
|
-
channelGetTags(): Promise<string[]>;
|
|
22
|
-
channelGetChannelId(): Promise<string | null | undefined>;
|
|
23
|
-
channelWaitForChannelId(): Promise<string>;
|
|
24
|
-
channelGetSubscriptionLists(): Promise<string[]>;
|
|
25
|
-
channelEditTagGroups(operations: Object[]): Promise<void>;
|
|
26
|
-
channelEditAttributes(operations: Object[]): Promise<void>;
|
|
27
|
-
channelEditSubscriptionLists(operations: Object[]): Promise<void>;
|
|
28
|
-
|
|
29
|
-
// Push
|
|
30
|
-
pushSetUserNotificationsEnabled(enabled: boolean): Promise<void>;
|
|
31
|
-
pushIsUserNotificationsEnabled(): Promise<boolean>;
|
|
32
|
-
pushEnableUserNotifications(options?: Object): Promise<boolean>;
|
|
33
|
-
pushGetNotificationStatus(): Promise<Object>;
|
|
34
|
-
pushGetRegistrationToken(): Promise<string | null | undefined>;
|
|
35
|
-
pushGetActiveNotifications(): Promise<Object[]>;
|
|
36
|
-
pushClearNotifications(): void;
|
|
37
|
-
pushClearNotification(identifier: string): void;
|
|
38
|
-
|
|
39
|
-
// // Push.ios
|
|
40
|
-
pushIosSetForegroundPresentationOptions(options: string[]): Promise<void>;
|
|
41
|
-
pushIosSetNotificationOptions(options: string[]): Promise<void>;
|
|
42
|
-
pushIosSetAutobadgeEnabled(enabled: boolean): Promise<void>;
|
|
43
|
-
pushIosIsAutobadgeEnabled(): Promise<boolean>;
|
|
44
|
-
pushIosSetBadgeNumber(badgeNumber: number): Promise<void>;
|
|
45
|
-
pushIosGetBadgeNumber(): Promise<number>;
|
|
46
|
-
pushIosIsOverridePresentationOptionsEnabled(enabled: boolean): void;
|
|
47
|
-
pushIosOverridePresentationOptions(requestId: string, options?: string[]): void;
|
|
48
|
-
pushIosGetAuthorizedNotificationSettings(): Promise<string[]>;
|
|
49
|
-
pushIosGetAuthorizedNotificationStatus(): Promise<string>;
|
|
50
|
-
|
|
51
|
-
// Push.android
|
|
52
|
-
pushAndroidIsNotificationChannelEnabled(channel: string): Promise<boolean>;
|
|
53
|
-
pushAndroidSetNotificationConfig(config: Object): void;
|
|
54
|
-
pushAndroidIsOverrideForegroundDisplayEnabled(enabled: boolean): void;
|
|
55
|
-
pushAndroidOverrideForegroundDisplay(requestId: string, shouldDisplay: boolean): void;
|
|
56
|
-
|
|
57
|
-
// Contact
|
|
58
|
-
contactIdentify(namedUser: string): Promise<void>;
|
|
59
|
-
contactReset(): Promise<void>;
|
|
60
|
-
contactNotifyRemoteLogin(): Promise<void>;
|
|
61
|
-
contactGetNamedUserId(): Promise<string | null | undefined>;
|
|
62
|
-
contactGetSubscriptionLists(): Promise<Object>;
|
|
63
|
-
contactEditTagGroups(operations: Object[]): Promise<void>;
|
|
64
|
-
contactEditAttributes(operations: Object[]): Promise<void>;
|
|
65
|
-
contactEditSubscriptionLists(operations: Object[]): Promise<void>;
|
|
66
|
-
|
|
67
|
-
// Analytics
|
|
68
|
-
analyticsTrackScreen(screen?: string): Promise<void>;
|
|
69
|
-
analyticsAssociateIdentifier(key: string, identifier?: string): Promise<void>;
|
|
70
|
-
addCustomEvent(event: Object): Promise<void>;
|
|
71
|
-
analyticsGetSessionId(): Promise<string>;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
// Action
|
|
75
|
-
actionRun(action: Object): Promise<Object | Error>;
|
|
76
|
-
|
|
77
|
-
// Privacy Manager
|
|
78
|
-
privacyManagerSetEnabledFeatures(features: string[]): Promise<void>;
|
|
79
|
-
privacyManagerGetEnabledFeatures(): Promise<string[]>;
|
|
80
|
-
privacyManagerEnableFeature(features: string[]): Promise<void>;
|
|
81
|
-
privacyManagerDisableFeature(features: string[]): Promise<void>;
|
|
82
|
-
privacyManagerIsFeatureEnabled(features: string[]): Promise<void>;
|
|
83
|
-
|
|
84
|
-
// InApp
|
|
85
|
-
inAppSetDisplayInterval(milliseconds: number): Promise<void>;
|
|
86
|
-
inAppGetDisplayInterval(): Promise<number>;
|
|
87
|
-
inAppSetPaused(paused: boolean): Promise<void>;
|
|
88
|
-
inAppIsPaused(): Promise<boolean>;
|
|
89
|
-
inAppResendPendingEmbeddedEvent(): void;
|
|
90
|
-
|
|
91
|
-
// Message Center
|
|
92
|
-
messageCenterGetUnreadCount(): Promise<number>;
|
|
93
|
-
messageCenterDismiss(): Promise<void>;
|
|
94
|
-
messageCenterDisplay(messageId?: string): Promise<void>;
|
|
95
|
-
messageCenterGetMessages(): Promise<Object[]>;
|
|
96
|
-
messageCenterDeleteMessage(messageId: string): Promise<void>;
|
|
97
|
-
messageCenterMarkMessageRead(messageId: string): Promise<void>;
|
|
98
|
-
messageCenterRefresh(): Promise<void>;
|
|
99
|
-
messageCenterSetAutoLaunchDefaultMessageCenter(enabled: boolean): void;
|
|
100
|
-
messageCenterShowMessageCenter(messageId?: string): Promise<void>;
|
|
101
|
-
messageCenterShowMessageView(messageId: string): Promise<void>;
|
|
102
|
-
|
|
103
|
-
// Preference Center
|
|
104
|
-
preferenceCenterDisplay(preferenceCenterId: string): Promise<void>;
|
|
105
|
-
preferenceCenterGetConfig(preferenceCenterId: string): Promise<Object>;
|
|
106
|
-
preferenceCenterAutoLaunchDefaultPreferenceCenter(
|
|
107
|
-
preferenceCenterId: string,
|
|
108
|
-
autoLaunch: boolean
|
|
109
|
-
): void;
|
|
110
|
-
|
|
111
|
-
// Locale
|
|
112
|
-
localeSetLocaleOverride(localeIdentifier: string): Promise<void>;
|
|
113
|
-
localeGetLocale(): Promise<string>;
|
|
114
|
-
localeClearLocaleOverride(): Promise<void>;
|
|
115
|
-
|
|
116
|
-
// Feature Flag Manager
|
|
117
|
-
featureFlagManagerFlag(flagName: string, useResultCache: boolean):Promise<Object>;
|
|
118
|
-
featureFlagManagerTrackInteraction(flag: Object): Promise<void>;
|
|
119
|
-
featureFlagManagerResultCacheGetFlag(flagName: string): Promise<Object>;
|
|
120
|
-
featureFlagManagerResultCacheSetFlag(flag: Object, ttl: number): Promise<void>;
|
|
121
|
-
featureFlagManagerResultCacheRemoveFlag(flagName: string): Promise<void>;
|
|
122
|
-
|
|
123
|
-
// Live Activity
|
|
124
|
-
liveActivityListAll(): Promise<Object>;
|
|
125
|
-
liveActivityList(request: Object): Promise<Object>;
|
|
126
|
-
liveActivityStart(request: Object): Promise<Object>;
|
|
127
|
-
liveActivityUpdate(request: Object): Promise<void>;
|
|
128
|
-
liveActivityEnd(request: Object): Promise<void>;
|
|
129
|
-
|
|
130
|
-
// Live Update
|
|
131
|
-
liveUpdateListAll(): Promise<Object>;
|
|
132
|
-
liveUpdateList(request: Object): Promise<Object>;
|
|
133
|
-
liveUpdateStart(request: Object): Promise<void>;
|
|
134
|
-
liveUpdateUpdate(request: Object): Promise<void>;
|
|
135
|
-
liveUpdateEnd(request: Object): Promise<void>;
|
|
136
|
-
liveUpdateClearAll(): Promise<void>;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export default TurboModuleRegistry.getEnforcing<Spec>('RNAirship');
|