react-native-push-signal 0.1.4 → 0.1.7

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.
Files changed (103) hide show
  1. package/LICENSE +1 -1
  2. package/PushSignal.podspec +2 -12
  3. package/README.md +3 -11
  4. package/README.ru.md +3 -11
  5. package/android/build.gradle +1 -62
  6. package/android/consumer-rules.pro +3 -3
  7. package/android/src/main/AndroidManifest.xml +2 -2
  8. package/android/src/main/java/com/pushsignal/PushModels.kt +15 -0
  9. package/android/src/main/java/com/{margelo/nitro/pushsignal → pushsignal}/PushSignalCenter.kt +24 -71
  10. package/android/src/main/java/com/{margelo/nitro/pushsignal → pushsignal}/PushSignalInitProvider.kt +1 -1
  11. package/android/src/main/java/com/{margelo/nitro/pushsignal → pushsignal}/PushSignalMessagingService.kt +1 -1
  12. package/android/src/main/java/com/pushsignal/PushSignalModule.kt +88 -0
  13. package/android/src/main/java/com/pushsignal/PushSignalPackage.kt +30 -0
  14. package/ios/PushSignal.h +4 -0
  15. package/ios/PushSignal.mm +57 -0
  16. package/ios/PushSignalCenter.h +26 -0
  17. package/ios/PushSignalCenter.m +608 -0
  18. package/ios/PushSignalLaunchStore.m +6 -9
  19. package/lib/module/NativePushSignal.js +5 -0
  20. package/lib/module/NativePushSignal.js.map +1 -0
  21. package/lib/module/pushSignal.native.js +36 -12
  22. package/lib/module/pushSignal.native.js.map +1 -1
  23. package/lib/module/types.js +2 -0
  24. package/lib/module/types.js.map +1 -0
  25. package/lib/typescript/src/NativePushSignal.d.ts +22 -0
  26. package/lib/typescript/src/NativePushSignal.d.ts.map +1 -0
  27. package/lib/typescript/src/index.d.ts +1 -1
  28. package/lib/typescript/src/index.d.ts.map +1 -1
  29. package/lib/typescript/src/pushSignal.d.ts +1 -1
  30. package/lib/typescript/src/pushSignal.d.ts.map +1 -1
  31. package/lib/typescript/src/pushSignal.native.d.ts +1 -1
  32. package/lib/typescript/src/pushSignal.native.d.ts.map +1 -1
  33. package/lib/typescript/src/types.d.ts +22 -0
  34. package/lib/typescript/src/types.d.ts.map +1 -0
  35. package/package.json +14 -19
  36. package/src/NativePushSignal.ts +25 -0
  37. package/src/index.tsx +1 -1
  38. package/src/pushSignal.native.tsx +60 -22
  39. package/src/pushSignal.tsx +1 -1
  40. package/src/types.ts +25 -0
  41. package/android/CMakeLists.txt +0 -24
  42. package/android/src/main/cpp/cpp-adapter.cpp +0 -11
  43. package/android/src/main/java/com/margelo/nitro/pushsignal/PushSignal.kt +0 -38
  44. package/android/src/main/java/com/margelo/nitro/pushsignal/PushSignalPackage.kt +0 -22
  45. package/ios/PushSignal.swift +0 -29
  46. package/ios/PushSignalCenter.swift +0 -588
  47. package/lib/module/PushSignal.nitro.js +0 -4
  48. package/lib/module/PushSignal.nitro.js.map +0 -1
  49. package/lib/typescript/src/PushSignal.nitro.d.ts +0 -32
  50. package/lib/typescript/src/PushSignal.nitro.d.ts.map +0 -1
  51. package/nitro.json +0 -23
  52. package/nitrogen/generated/android/c++/JAndroidFirebaseConfig.hpp +0 -70
  53. package/nitrogen/generated/android/c++/JFunc_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage.hpp +0 -128
  54. package/nitrogen/generated/android/c++/JFunc_void_PushMessage.hpp +0 -80
  55. package/nitrogen/generated/android/c++/JHybridPushSignalSpec.cpp +0 -115
  56. package/nitrogen/generated/android/c++/JHybridPushSignalSpec.hpp +0 -66
  57. package/nitrogen/generated/android/c++/JPushCredentials.hpp +0 -70
  58. package/nitrogen/generated/android/c++/JPushEnvironment.hpp +0 -58
  59. package/nitrogen/generated/android/c++/JPushMessage.hpp +0 -84
  60. package/nitrogen/generated/android/c++/JPushPlatform.hpp +0 -58
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/AndroidFirebaseConfig.kt +0 -66
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage.kt +0 -78
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/Func_void_PushMessage.kt +0 -78
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/HybridPushSignalSpec.kt +0 -79
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushCredentials.kt +0 -61
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushEnvironment.kt +0 -23
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushMessage.kt +0 -66
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/PushPlatform.kt +0 -23
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/pushsignal/pushsignalOnLoad.kt +0 -35
  70. package/nitrogen/generated/android/pushsignal+autolinking.cmake +0 -81
  71. package/nitrogen/generated/android/pushsignal+autolinking.gradle +0 -27
  72. package/nitrogen/generated/android/pushsignalOnLoad.cpp +0 -58
  73. package/nitrogen/generated/android/pushsignalOnLoad.hpp +0 -34
  74. package/nitrogen/generated/ios/PushSignal+autolinking.rb +0 -62
  75. package/nitrogen/generated/ios/PushSignal-Swift-Cxx-Bridge.cpp +0 -90
  76. package/nitrogen/generated/ios/PushSignal-Swift-Cxx-Bridge.hpp +0 -345
  77. package/nitrogen/generated/ios/PushSignal-Swift-Cxx-Umbrella.hpp +0 -63
  78. package/nitrogen/generated/ios/PushSignalAutolinking.mm +0 -33
  79. package/nitrogen/generated/ios/PushSignalAutolinking.swift +0 -26
  80. package/nitrogen/generated/ios/c++/HybridPushSignalSpecSwift.cpp +0 -11
  81. package/nitrogen/generated/ios/c++/HybridPushSignalSpecSwift.hpp +0 -120
  82. package/nitrogen/generated/ios/swift/AndroidFirebaseConfig.swift +0 -96
  83. package/nitrogen/generated/ios/swift/Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage.swift +0 -61
  84. package/nitrogen/generated/ios/swift/Func_void.swift +0 -46
  85. package/nitrogen/generated/ios/swift/Func_void_PushCredentials.swift +0 -46
  86. package/nitrogen/generated/ios/swift/Func_void_PushMessage.swift +0 -46
  87. package/nitrogen/generated/ios/swift/Func_void_bool.swift +0 -46
  88. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +0 -46
  89. package/nitrogen/generated/ios/swift/Func_void_std__shared_ptr_Promise_bool__.swift +0 -66
  90. package/nitrogen/generated/ios/swift/HybridPushSignalSpec.swift +0 -58
  91. package/nitrogen/generated/ios/swift/HybridPushSignalSpec_cxx.swift +0 -217
  92. package/nitrogen/generated/ios/swift/PushCredentials.swift +0 -45
  93. package/nitrogen/generated/ios/swift/PushEnvironment.swift +0 -40
  94. package/nitrogen/generated/ios/swift/PushMessage.swift +0 -97
  95. package/nitrogen/generated/ios/swift/PushPlatform.swift +0 -40
  96. package/nitrogen/generated/shared/c++/AndroidFirebaseConfig.hpp +0 -96
  97. package/nitrogen/generated/shared/c++/HybridPushSignalSpec.cpp +0 -24
  98. package/nitrogen/generated/shared/c++/HybridPushSignalSpec.hpp +0 -74
  99. package/nitrogen/generated/shared/c++/PushCredentials.hpp +0 -97
  100. package/nitrogen/generated/shared/c++/PushEnvironment.hpp +0 -76
  101. package/nitrogen/generated/shared/c++/PushMessage.hpp +0 -97
  102. package/nitrogen/generated/shared/c++/PushPlatform.hpp +0 -76
  103. package/src/PushSignal.nitro.ts +0 -39
@@ -1,58 +0,0 @@
1
- ///
2
- /// JPushPlatform.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 <fbjni/fbjni.h>
11
- #include "PushPlatform.hpp"
12
-
13
- namespace margelo::nitro::pushsignal {
14
-
15
- using namespace facebook;
16
-
17
- /**
18
- * The C++ JNI bridge between the C++ enum "PushPlatform" and the Kotlin enum "PushPlatform".
19
- */
20
- struct JPushPlatform final: public jni::JavaClass<JPushPlatform> {
21
- public:
22
- static constexpr auto kJavaDescriptor = "Lcom/margelo/nitro/pushsignal/PushPlatform;";
23
-
24
- public:
25
- /**
26
- * Convert this Java/Kotlin-based enum to the C++ enum PushPlatform.
27
- */
28
- [[maybe_unused]]
29
- [[nodiscard]]
30
- PushPlatform toCpp() const {
31
- static const auto clazz = javaClassStatic();
32
- static const auto fieldOrdinal = clazz->getField<int>("value");
33
- int ordinal = this->getFieldValue(fieldOrdinal);
34
- return static_cast<PushPlatform>(ordinal);
35
- }
36
-
37
- public:
38
- /**
39
- * Create a Java/Kotlin-based enum with the given C++ enum's value.
40
- */
41
- [[maybe_unused]]
42
- static jni::alias_ref<JPushPlatform> fromCpp(PushPlatform value) {
43
- static const auto clazz = javaClassStatic();
44
- switch (value) {
45
- case PushPlatform::IOS:
46
- static const auto fieldIOS = clazz->getStaticField<JPushPlatform>("IOS");
47
- return clazz->getStaticFieldValue(fieldIOS);
48
- case PushPlatform::ANDROID_OS:
49
- static const auto fieldANDROID_OS = clazz->getStaticField<JPushPlatform>("ANDROID_OS");
50
- return clazz->getStaticFieldValue(fieldANDROID_OS);
51
- default:
52
- std::string stringValue = std::to_string(static_cast<int>(value));
53
- throw std::invalid_argument("Invalid enum value (" + stringValue + "!");
54
- }
55
- }
56
- };
57
-
58
- } // namespace margelo::nitro::pushsignal
@@ -1,66 +0,0 @@
1
- ///
2
- /// AndroidFirebaseConfig.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.pushsignal
9
-
10
- import androidx.annotation.Keep
11
- import com.facebook.proguard.annotations.DoNotStrip
12
- import java.util.Objects
13
-
14
-
15
- /**
16
- * Represents the JavaScript object/struct "AndroidFirebaseConfig".
17
- */
18
- @DoNotStrip
19
- @Keep
20
- data class AndroidFirebaseConfig(
21
- @DoNotStrip
22
- @Keep
23
- val project_id: String?,
24
- @DoNotStrip
25
- @Keep
26
- val mobilesdk_app_id: String?,
27
- @DoNotStrip
28
- @Keep
29
- val current_key: String?,
30
- @DoNotStrip
31
- @Keep
32
- val project_number: String?
33
- ) {
34
- /* primary constructor */
35
-
36
- override fun equals(other: Any?): Boolean {
37
- if (this === other) return true
38
- if (other !is AndroidFirebaseConfig) return false
39
- return Objects.deepEquals(this.project_id, other.project_id)
40
- && Objects.deepEquals(this.mobilesdk_app_id, other.mobilesdk_app_id)
41
- && Objects.deepEquals(this.current_key, other.current_key)
42
- && Objects.deepEquals(this.project_number, other.project_number)
43
- }
44
-
45
- override fun hashCode(): Int {
46
- return arrayOf<Any?>(
47
- project_id,
48
- mobilesdk_app_id,
49
- current_key,
50
- project_number
51
- ).contentDeepHashCode()
52
- }
53
-
54
- companion object {
55
- /**
56
- * Constructor called from C++
57
- */
58
- @DoNotStrip
59
- @Keep
60
- @Suppress("unused")
61
- @JvmStatic
62
- private fun fromCpp(project_id: String?, mobilesdk_app_id: String?, current_key: String?, project_number: String?): AndroidFirebaseConfig {
63
- return AndroidFirebaseConfig(project_id, mobilesdk_app_id, current_key, project_number)
64
- }
65
- }
66
- }
@@ -1,78 +0,0 @@
1
- ///
2
- /// Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage.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.pushsignal
9
-
10
- import androidx.annotation.Keep
11
- import com.facebook.jni.HybridData
12
- import com.facebook.proguard.annotations.DoNotStrip
13
- import com.margelo.nitro.core.Promise
14
-
15
- /**
16
- * Represents the JavaScript callback `(message: struct) => std::shared_ptr<Promise<std::shared_ptr<Promise<bool>>>>`.
17
- * This can be either implemented in C++ (in which case it might be a callback coming from JS),
18
- * or in Kotlin/Java (in which case it is a native callback).
19
- */
20
- @DoNotStrip
21
- @Keep
22
- @Suppress("ClassName", "RedundantUnitReturnType")
23
- fun interface Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage: (PushMessage) -> Promise<Promise<Boolean>> {
24
- /**
25
- * Call the given JS callback.
26
- * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
27
- */
28
- @DoNotStrip
29
- @Keep
30
- override fun invoke(message: PushMessage): Promise<Promise<Boolean>>
31
- }
32
-
33
- /**
34
- * Represents the JavaScript callback `(message: struct) => std::shared_ptr<Promise<std::shared_ptr<Promise<bool>>>>`.
35
- * This is implemented in C++, via a `std::function<...>`.
36
- * The callback might be coming from JS.
37
- */
38
- @DoNotStrip
39
- @Keep
40
- @Suppress(
41
- "KotlinJniMissingFunction", "unused",
42
- "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
43
- "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
44
- )
45
- class Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage_cxx: Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage {
46
- @DoNotStrip
47
- @Keep
48
- private val mHybridData: HybridData
49
-
50
- @DoNotStrip
51
- @Keep
52
- private constructor(hybridData: HybridData) {
53
- mHybridData = hybridData
54
- }
55
-
56
- @DoNotStrip
57
- @Keep
58
- override fun invoke(message: PushMessage): Promise<Promise<Boolean>>
59
- = invoke_cxx(message)
60
-
61
- private external fun invoke_cxx(message: PushMessage): Promise<Promise<Boolean>>
62
- }
63
-
64
- /**
65
- * Represents the JavaScript callback `(message: struct) => std::shared_ptr<Promise<std::shared_ptr<Promise<bool>>>>`.
66
- * This is implemented in Java/Kotlin, via a `(PushMessage) -> Promise<Promise<Boolean>>`.
67
- * The callback is always coming from native.
68
- */
69
- @DoNotStrip
70
- @Keep
71
- @Suppress("ClassName", "RedundantUnitReturnType", "unused")
72
- class Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage_java(private val function: (PushMessage) -> Promise<Promise<Boolean>>): Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage {
73
- @DoNotStrip
74
- @Keep
75
- override fun invoke(message: PushMessage): Promise<Promise<Boolean>> {
76
- return this.function(message)
77
- }
78
- }
@@ -1,78 +0,0 @@
1
- ///
2
- /// Func_void_PushMessage.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.pushsignal
9
-
10
- import androidx.annotation.Keep
11
- import com.facebook.jni.HybridData
12
- import com.facebook.proguard.annotations.DoNotStrip
13
-
14
-
15
- /**
16
- * Represents the JavaScript callback `(message: struct) => void`.
17
- * This can be either implemented in C++ (in which case it might be a callback coming from JS),
18
- * or in Kotlin/Java (in which case it is a native callback).
19
- */
20
- @DoNotStrip
21
- @Keep
22
- @Suppress("ClassName", "RedundantUnitReturnType")
23
- fun interface Func_void_PushMessage: (PushMessage) -> Unit {
24
- /**
25
- * Call the given JS callback.
26
- * @throws Throwable if the JS function itself throws an error, or if the JS function/runtime has already been deleted.
27
- */
28
- @DoNotStrip
29
- @Keep
30
- override fun invoke(message: PushMessage): Unit
31
- }
32
-
33
- /**
34
- * Represents the JavaScript callback `(message: struct) => void`.
35
- * This is implemented in C++, via a `std::function<...>`.
36
- * The callback might be coming from JS.
37
- */
38
- @DoNotStrip
39
- @Keep
40
- @Suppress(
41
- "KotlinJniMissingFunction", "unused",
42
- "RedundantSuppression", "RedundantUnitReturnType", "FunctionName",
43
- "ConvertSecondaryConstructorToPrimary", "ClassName", "LocalVariableName",
44
- )
45
- class Func_void_PushMessage_cxx: Func_void_PushMessage {
46
- @DoNotStrip
47
- @Keep
48
- private val mHybridData: HybridData
49
-
50
- @DoNotStrip
51
- @Keep
52
- private constructor(hybridData: HybridData) {
53
- mHybridData = hybridData
54
- }
55
-
56
- @DoNotStrip
57
- @Keep
58
- override fun invoke(message: PushMessage): Unit
59
- = invoke_cxx(message)
60
-
61
- private external fun invoke_cxx(message: PushMessage): Unit
62
- }
63
-
64
- /**
65
- * Represents the JavaScript callback `(message: struct) => void`.
66
- * This is implemented in Java/Kotlin, via a `(PushMessage) -> Unit`.
67
- * The callback is always coming from native.
68
- */
69
- @DoNotStrip
70
- @Keep
71
- @Suppress("ClassName", "RedundantUnitReturnType", "unused")
72
- class Func_void_PushMessage_java(private val function: (PushMessage) -> Unit): Func_void_PushMessage {
73
- @DoNotStrip
74
- @Keep
75
- override fun invoke(message: PushMessage): Unit {
76
- return this.function(message)
77
- }
78
- }
@@ -1,79 +0,0 @@
1
- ///
2
- /// HybridPushSignalSpec.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.pushsignal
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.Promise
15
- import com.margelo.nitro.core.HybridObject
16
-
17
- /**
18
- * A Kotlin class representing the PushSignal HybridObject.
19
- * Implement this abstract class to create Kotlin-based instances of PushSignal.
20
- */
21
- @DoNotStrip
22
- @Keep
23
- @Suppress(
24
- "KotlinJniMissingFunction", "unused",
25
- "RedundantSuppression", "RedundantUnitReturnType", "SimpleRedundantLet",
26
- "LocalVariableName", "PropertyName", "PrivatePropertyName", "FunctionName"
27
- )
28
- abstract class HybridPushSignalSpec: HybridObject() {
29
- // Properties
30
-
31
-
32
- // Methods
33
- @DoNotStrip
34
- @Keep
35
- abstract fun initialize(config: AndroidFirebaseConfig): Promise<Unit>
36
-
37
- @DoNotStrip
38
- @Keep
39
- abstract fun getCredentials(): Promise<PushCredentials>
40
-
41
- abstract fun setOnMessage(callback: (message: PushMessage) -> Promise<Promise<Boolean>>): Unit
42
-
43
- @DoNotStrip
44
- @Keep
45
- private fun setOnMessage_cxx(callback: Func_std__shared_ptr_Promise_std__shared_ptr_Promise_bool_____PushMessage): Unit {
46
- val __result = setOnMessage(callback)
47
- return __result
48
- }
49
-
50
- abstract fun setOnNotificationPress(callback: (message: PushMessage) -> Unit): Unit
51
-
52
- @DoNotStrip
53
- @Keep
54
- private fun setOnNotificationPress_cxx(callback: Func_void_PushMessage): Unit {
55
- val __result = setOnNotificationPress(callback)
56
- return __result
57
- }
58
-
59
- // Default implementation of `HybridObject.toString()`
60
- override fun toString(): String {
61
- return "[HybridObject PushSignal]"
62
- }
63
-
64
- // C++ backing class
65
- @DoNotStrip
66
- @Keep
67
- protected open class CxxPart(javaPart: HybridPushSignalSpec): HybridObject.CxxPart(javaPart) {
68
- // C++ JHybridPushSignalSpec::CxxPart::initHybrid(...)
69
- @FastNative
70
- external override fun initHybrid(): HybridData
71
- }
72
- override fun createCxxPart(): CxxPart {
73
- return CxxPart(this)
74
- }
75
-
76
- companion object {
77
- protected const val TAG = "HybridPushSignalSpec"
78
- }
79
- }
@@ -1,61 +0,0 @@
1
- ///
2
- /// PushCredentials.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.pushsignal
9
-
10
- import androidx.annotation.Keep
11
- import com.facebook.proguard.annotations.DoNotStrip
12
- import java.util.Objects
13
-
14
-
15
- /**
16
- * Represents the JavaScript object/struct "PushCredentials".
17
- */
18
- @DoNotStrip
19
- @Keep
20
- data class PushCredentials(
21
- @DoNotStrip
22
- @Keep
23
- val platform: PushPlatform,
24
- @DoNotStrip
25
- @Keep
26
- val token: String,
27
- @DoNotStrip
28
- @Keep
29
- val environment: PushEnvironment?
30
- ) {
31
- /* primary constructor */
32
-
33
- override fun equals(other: Any?): Boolean {
34
- if (this === other) return true
35
- if (other !is PushCredentials) return false
36
- return Objects.deepEquals(this.platform, other.platform)
37
- && Objects.deepEquals(this.token, other.token)
38
- && Objects.deepEquals(this.environment, other.environment)
39
- }
40
-
41
- override fun hashCode(): Int {
42
- return arrayOf<Any?>(
43
- platform,
44
- token,
45
- environment
46
- ).contentDeepHashCode()
47
- }
48
-
49
- companion object {
50
- /**
51
- * Constructor called from C++
52
- */
53
- @DoNotStrip
54
- @Keep
55
- @Suppress("unused")
56
- @JvmStatic
57
- private fun fromCpp(platform: PushPlatform, token: String, environment: PushEnvironment?): PushCredentials {
58
- return PushCredentials(platform, token, environment)
59
- }
60
- }
61
- }
@@ -1,23 +0,0 @@
1
- ///
2
- /// PushEnvironment.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.pushsignal
9
-
10
- import androidx.annotation.Keep
11
- import com.facebook.proguard.annotations.DoNotStrip
12
-
13
- /**
14
- * Represents the JavaScript enum/union "PushEnvironment".
15
- */
16
- @DoNotStrip
17
- @Keep
18
- enum class PushEnvironment(@DoNotStrip @Keep val value: Int) {
19
- SANDBOX(0),
20
- PRODUCTION(1);
21
-
22
- companion object
23
- }
@@ -1,66 +0,0 @@
1
- ///
2
- /// PushMessage.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.pushsignal
9
-
10
- import androidx.annotation.Keep
11
- import com.facebook.proguard.annotations.DoNotStrip
12
- import java.util.Objects
13
-
14
-
15
- /**
16
- * Represents the JavaScript object/struct "PushMessage".
17
- */
18
- @DoNotStrip
19
- @Keep
20
- data class PushMessage(
21
- @DoNotStrip
22
- @Keep
23
- val id: String?,
24
- @DoNotStrip
25
- @Keep
26
- val title: String?,
27
- @DoNotStrip
28
- @Keep
29
- val body: String?,
30
- @DoNotStrip
31
- @Keep
32
- val data: Map<String, String>
33
- ) {
34
- /* primary constructor */
35
-
36
- override fun equals(other: Any?): Boolean {
37
- if (this === other) return true
38
- if (other !is PushMessage) return false
39
- return Objects.deepEquals(this.id, other.id)
40
- && Objects.deepEquals(this.title, other.title)
41
- && Objects.deepEquals(this.body, other.body)
42
- && Objects.deepEquals(this.data, other.data)
43
- }
44
-
45
- override fun hashCode(): Int {
46
- return arrayOf<Any?>(
47
- id,
48
- title,
49
- body,
50
- data
51
- ).contentDeepHashCode()
52
- }
53
-
54
- companion object {
55
- /**
56
- * Constructor called from C++
57
- */
58
- @DoNotStrip
59
- @Keep
60
- @Suppress("unused")
61
- @JvmStatic
62
- private fun fromCpp(id: String?, title: String?, body: String?, data: Map<String, String>): PushMessage {
63
- return PushMessage(id, title, body, data)
64
- }
65
- }
66
- }
@@ -1,23 +0,0 @@
1
- ///
2
- /// PushPlatform.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.pushsignal
9
-
10
- import androidx.annotation.Keep
11
- import com.facebook.proguard.annotations.DoNotStrip
12
-
13
- /**
14
- * Represents the JavaScript enum/union "PushPlatform".
15
- */
16
- @DoNotStrip
17
- @Keep
18
- enum class PushPlatform(@DoNotStrip @Keep val value: Int) {
19
- IOS(0),
20
- ANDROID_OS(1);
21
-
22
- companion object
23
- }
@@ -1,35 +0,0 @@
1
- ///
2
- /// pushsignalOnLoad.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.pushsignal
9
-
10
- import android.util.Log
11
-
12
- internal class pushsignalOnLoad {
13
- companion object {
14
- private const val TAG = "pushsignalOnLoad"
15
- private var didLoad = false
16
- /**
17
- * Initializes the native part of "pushsignal".
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 pushsignal C++ library...")
25
- System.loadLibrary("pushsignal")
26
- Log.i(TAG, "Successfully loaded pushsignal C++ library!")
27
- didLoad = true
28
- } catch (e: Error) {
29
- Log.e(TAG, "Failed to load pushsignal 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
- }
@@ -1,81 +0,0 @@
1
- #
2
- # pushsignal+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/pushsignal+autolinking.cmake)
14
- # ```
15
-
16
- # Define a flag to check if we are building properly
17
- add_definitions(-DBUILDING_PUSHSIGNAL_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
- pushsignal PRIVATE
33
- # Autolinking Setup
34
- ../nitrogen/generated/android/pushsignalOnLoad.cpp
35
- # Shared Nitrogen C++ sources
36
- ../nitrogen/generated/shared/c++/HybridPushSignalSpec.cpp
37
- # Android-specific Nitrogen C++ sources
38
- ../nitrogen/generated/android/c++/JHybridPushSignalSpec.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
- pushsignal 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
- pushsignal
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
- pushsignal
74
- ReactAndroid::reactnative # <-- RN: Native Modules umbrella prefab
75
- )
76
- else()
77
- target_link_libraries(
78
- pushsignal
79
- ReactAndroid::react_nativemodule_core # <-- RN: TurboModules Core
80
- )
81
- endif()
@@ -1,27 +0,0 @@
1
- ///
2
- /// pushsignal+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/pushsignal+autolinking.gradle'
14
- /// ```
15
-
16
- logger.warn("[NitroModules] 🔥 pushsignal 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
- }