react-native-carrot-quest 0.1.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.
Files changed (121) hide show
  1. package/CarrotQuest.podspec +34 -0
  2. package/LICENSE +20 -0
  3. package/README.md +457 -0
  4. package/android/CMakeLists.txt +24 -0
  5. package/android/build.gradle +136 -0
  6. package/android/src/main/AndroidManifest.xml +2 -0
  7. package/android/src/main/cpp/cpp-adapter.cpp +11 -0
  8. package/android/src/main/java/com/margelo/nitro/carrotquest/CarrotQuest.kt +585 -0
  9. package/android/src/main/java/com/margelo/nitro/carrotquest/CarrotQuestPackage.kt +22 -0
  10. package/android/src/main/java/com/margelo/nitro/carrotquest/CarrotQuestSetup.kt +472 -0
  11. package/ios/CarrotQuest.swift +588 -0
  12. package/ios/CarrotQuestSetup.swift +333 -0
  13. package/lib/module/CarrotQuest.nitro.js +4 -0
  14. package/lib/module/CarrotQuest.nitro.js.map +1 -0
  15. package/lib/module/carrot-quest.js +136 -0
  16. package/lib/module/carrot-quest.js.map +1 -0
  17. package/lib/module/carrot-quest.native.js +155 -0
  18. package/lib/module/carrot-quest.native.js.map +1 -0
  19. package/lib/module/index.js +6 -0
  20. package/lib/module/index.js.map +1 -0
  21. package/lib/module/package.json +1 -0
  22. package/lib/module/subscriptions.js +76 -0
  23. package/lib/module/subscriptions.js.map +1 -0
  24. package/lib/typescript/package.json +1 -0
  25. package/lib/typescript/src/CarrotQuest.nitro.d.ts +394 -0
  26. package/lib/typescript/src/CarrotQuest.nitro.d.ts.map +1 -0
  27. package/lib/typescript/src/carrot-quest.d.ts +37 -0
  28. package/lib/typescript/src/carrot-quest.d.ts.map +1 -0
  29. package/lib/typescript/src/carrot-quest.native.d.ts +37 -0
  30. package/lib/typescript/src/carrot-quest.native.d.ts.map +1 -0
  31. package/lib/typescript/src/index.d.ts +6 -0
  32. package/lib/typescript/src/index.d.ts.map +1 -0
  33. package/lib/typescript/src/subscriptions.d.ts +32 -0
  34. package/lib/typescript/src/subscriptions.d.ts.map +1 -0
  35. package/nitro.json +23 -0
  36. package/nitrogen/generated/android/c++/JCarrotQuestEventValue.cpp +30 -0
  37. package/nitrogen/generated/android/c++/JCarrotQuestEventValue.hpp +83 -0
  38. package/nitrogen/generated/android/c++/JCarrotQuestLogCategory.hpp +76 -0
  39. package/nitrogen/generated/android/c++/JCarrotQuestLogEntry.hpp +100 -0
  40. package/nitrogen/generated/android/c++/JCarrotQuestLogLevel.hpp +70 -0
  41. package/nitrogen/generated/android/c++/JCarrotQuestProperty.hpp +74 -0
  42. package/nitrogen/generated/android/c++/JCarrotQuestPropertyKind.hpp +61 -0
  43. package/nitrogen/generated/android/c++/JCarrotQuestPropertyOperation.hpp +73 -0
  44. package/nitrogen/generated/android/c++/JCarrotQuestSetupOptions.hpp +94 -0
  45. package/nitrogen/generated/android/c++/JCarrotQuestTheme.hpp +64 -0
  46. package/nitrogen/generated/android/c++/JCarrotQuestUrlSource.hpp +64 -0
  47. package/nitrogen/generated/android/c++/JCarrotQuestUserProperties.hpp +84 -0
  48. package/nitrogen/generated/android/c++/JFunc_void_CarrotQuestLogEntry.hpp +84 -0
  49. package/nitrogen/generated/android/c++/JFunc_void_bool.hpp +75 -0
  50. package/nitrogen/generated/android/c++/JFunc_void_double.hpp +75 -0
  51. package/nitrogen/generated/android/c++/JFunc_void_std__string.hpp +76 -0
  52. package/nitrogen/generated/android/c++/JHybridCarrotQuestSpec.cpp +388 -0
  53. package/nitrogen/generated/android/c++/JHybridCarrotQuestSpec.hpp +96 -0
  54. package/nitrogen/generated/android/carrotquest+autolinking.cmake +82 -0
  55. package/nitrogen/generated/android/carrotquest+autolinking.gradle +27 -0
  56. package/nitrogen/generated/android/carrotquestOnLoad.cpp +62 -0
  57. package/nitrogen/generated/android/carrotquestOnLoad.hpp +34 -0
  58. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestEventValue.kt +75 -0
  59. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestLogCategory.kt +29 -0
  60. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestLogEntry.kt +81 -0
  61. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestLogLevel.kt +27 -0
  62. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestProperty.kt +66 -0
  63. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestPropertyKind.kt +24 -0
  64. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestPropertyOperation.kt +28 -0
  65. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestSetupOptions.kt +91 -0
  66. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestTheme.kt +25 -0
  67. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestUrlSource.kt +25 -0
  68. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/CarrotQuestUserProperties.kt +66 -0
  69. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_CarrotQuestLogEntry.kt +80 -0
  70. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_bool.kt +80 -0
  71. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_double.kt +80 -0
  72. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/Func_void_std__string.kt +80 -0
  73. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/HybridCarrotQuestSpec.kt +209 -0
  74. package/nitrogen/generated/android/kotlin/com/margelo/nitro/carrotquest/carrotquestOnLoad.kt +35 -0
  75. package/nitrogen/generated/ios/CarrotQuest+autolinking.rb +62 -0
  76. package/nitrogen/generated/ios/CarrotQuest-Swift-Cxx-Bridge.cpp +97 -0
  77. package/nitrogen/generated/ios/CarrotQuest-Swift-Cxx-Bridge.hpp +637 -0
  78. package/nitrogen/generated/ios/CarrotQuest-Swift-Cxx-Umbrella.hpp +80 -0
  79. package/nitrogen/generated/ios/CarrotQuestAutolinking.mm +33 -0
  80. package/nitrogen/generated/ios/CarrotQuestAutolinking.swift +26 -0
  81. package/nitrogen/generated/ios/c++/HybridCarrotQuestSpecSwift.cpp +11 -0
  82. package/nitrogen/generated/ios/c++/HybridCarrotQuestSpecSwift.hpp +344 -0
  83. package/nitrogen/generated/ios/swift/CarrotQuestEventValue.swift +32 -0
  84. package/nitrogen/generated/ios/swift/CarrotQuestLogCategory.swift +64 -0
  85. package/nitrogen/generated/ios/swift/CarrotQuestLogEntry.swift +86 -0
  86. package/nitrogen/generated/ios/swift/CarrotQuestLogLevel.swift +56 -0
  87. package/nitrogen/generated/ios/swift/CarrotQuestProperty.swift +56 -0
  88. package/nitrogen/generated/ios/swift/CarrotQuestPropertyKind.swift +44 -0
  89. package/nitrogen/generated/ios/swift/CarrotQuestPropertyOperation.swift +60 -0
  90. package/nitrogen/generated/ios/swift/CarrotQuestSetupOptions.swift +172 -0
  91. package/nitrogen/generated/ios/swift/CarrotQuestTheme.swift +48 -0
  92. package/nitrogen/generated/ios/swift/CarrotQuestUrlSource.swift +48 -0
  93. package/nitrogen/generated/ios/swift/CarrotQuestUserProperties.swift +110 -0
  94. package/nitrogen/generated/ios/swift/Func_void.swift +46 -0
  95. package/nitrogen/generated/ios/swift/Func_void_CarrotQuestLogEntry.swift +46 -0
  96. package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
  97. package/nitrogen/generated/ios/swift/Func_void_double.swift +46 -0
  98. package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
  99. package/nitrogen/generated/ios/swift/Func_void_std__optional_double_.swift +53 -0
  100. package/nitrogen/generated/ios/swift/Func_void_std__optional_std__string_.swift +53 -0
  101. package/nitrogen/generated/ios/swift/Func_void_std__string.swift +46 -0
  102. package/nitrogen/generated/ios/swift/HybridCarrotQuestSpec.swift +88 -0
  103. package/nitrogen/generated/ios/swift/HybridCarrotQuestSpec_cxx.swift +674 -0
  104. package/nitrogen/generated/shared/c++/CarrotQuestLogCategory.hpp +100 -0
  105. package/nitrogen/generated/shared/c++/CarrotQuestLogEntry.hpp +114 -0
  106. package/nitrogen/generated/shared/c++/CarrotQuestLogLevel.hpp +92 -0
  107. package/nitrogen/generated/shared/c++/CarrotQuestProperty.hpp +101 -0
  108. package/nitrogen/generated/shared/c++/CarrotQuestPropertyKind.hpp +80 -0
  109. package/nitrogen/generated/shared/c++/CarrotQuestPropertyOperation.hpp +96 -0
  110. package/nitrogen/generated/shared/c++/CarrotQuestSetupOptions.hpp +121 -0
  111. package/nitrogen/generated/shared/c++/CarrotQuestTheme.hpp +84 -0
  112. package/nitrogen/generated/shared/c++/CarrotQuestUrlSource.hpp +84 -0
  113. package/nitrogen/generated/shared/c++/CarrotQuestUserProperties.hpp +97 -0
  114. package/nitrogen/generated/shared/c++/HybridCarrotQuestSpec.cpp +55 -0
  115. package/nitrogen/generated/shared/c++/HybridCarrotQuestSpec.hpp +118 -0
  116. package/package.json +140 -0
  117. package/src/CarrotQuest.nitro.ts +493 -0
  118. package/src/carrot-quest.native.tsx +241 -0
  119. package/src/carrot-quest.tsx +207 -0
  120. package/src/index.tsx +57 -0
  121. package/src/subscriptions.ts +83 -0
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// Func_void_bool.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
+ /**
11
+ * Wraps a Swift `(_ visible: Bool) -> Void` as a class.
12
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
13
+ */
14
+ public final class Func_void_bool {
15
+ public typealias bridge = margelo.nitro.carrotquest.bridge.swift
16
+
17
+ private let closure: (_ visible: Bool) -> Void
18
+
19
+ public init(_ closure: @escaping (_ visible: Bool) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(visible: Bool) -> Void {
25
+ self.closure(visible)
26
+ }
27
+
28
+ /**
29
+ * Casts this instance to a retained unsafe raw pointer.
30
+ * This acquires one additional strong reference on the object!
31
+ */
32
+ @inline(__always)
33
+ public func toUnsafe() -> UnsafeMutableRawPointer {
34
+ return Unmanaged.passRetained(self).toOpaque()
35
+ }
36
+
37
+ /**
38
+ * Casts an unsafe pointer to a `Func_void_bool`.
39
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_bool>`.
40
+ * This removes one strong reference from the object!
41
+ */
42
+ @inline(__always)
43
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_bool {
44
+ return Unmanaged<Func_void_bool>.fromOpaque(pointer).takeRetainedValue()
45
+ }
46
+ }
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// Func_void_double.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
+ /**
11
+ * Wraps a Swift `(_ value: Double) -> Void` as a class.
12
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
13
+ */
14
+ public final class Func_void_double {
15
+ public typealias bridge = margelo.nitro.carrotquest.bridge.swift
16
+
17
+ private let closure: (_ value: Double) -> Void
18
+
19
+ public init(_ closure: @escaping (_ value: Double) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(value: Double) -> Void {
25
+ self.closure(value)
26
+ }
27
+
28
+ /**
29
+ * Casts this instance to a retained unsafe raw pointer.
30
+ * This acquires one additional strong reference on the object!
31
+ */
32
+ @inline(__always)
33
+ public func toUnsafe() -> UnsafeMutableRawPointer {
34
+ return Unmanaged.passRetained(self).toOpaque()
35
+ }
36
+
37
+ /**
38
+ * Casts an unsafe pointer to a `Func_void_double`.
39
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_double>`.
40
+ * This removes one strong reference from the object!
41
+ */
42
+ @inline(__always)
43
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_double {
44
+ return Unmanaged<Func_void_double>.fromOpaque(pointer).takeRetainedValue()
45
+ }
46
+ }
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// Func_void_std__exception_ptr.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
+ /**
11
+ * Wraps a Swift `(_ error: Error) -> Void` as a class.
12
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
13
+ */
14
+ public final class Func_void_std__exception_ptr {
15
+ public typealias bridge = margelo.nitro.carrotquest.bridge.swift
16
+
17
+ private let closure: (_ error: Error) -> Void
18
+
19
+ public init(_ closure: @escaping (_ error: Error) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(error: std.exception_ptr) -> Void {
25
+ self.closure(RuntimeError.from(cppError: error))
26
+ }
27
+
28
+ /**
29
+ * Casts this instance to a retained unsafe raw pointer.
30
+ * This acquires one additional strong reference on the object!
31
+ */
32
+ @inline(__always)
33
+ public func toUnsafe() -> UnsafeMutableRawPointer {
34
+ return Unmanaged.passRetained(self).toOpaque()
35
+ }
36
+
37
+ /**
38
+ * Casts an unsafe pointer to a `Func_void_std__exception_ptr`.
39
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_std__exception_ptr>`.
40
+ * This removes one strong reference from the object!
41
+ */
42
+ @inline(__always)
43
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__exception_ptr {
44
+ return Unmanaged<Func_void_std__exception_ptr>.fromOpaque(pointer).takeRetainedValue()
45
+ }
46
+ }
@@ -0,0 +1,53 @@
1
+ ///
2
+ /// Func_void_std__optional_double_.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
+ /**
11
+ * Wraps a Swift `(_ value: Double?) -> Void` as a class.
12
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
13
+ */
14
+ public final class Func_void_std__optional_double_ {
15
+ public typealias bridge = margelo.nitro.carrotquest.bridge.swift
16
+
17
+ private let closure: (_ value: Double?) -> Void
18
+
19
+ public init(_ closure: @escaping (_ value: Double?) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(value: bridge.std__optional_double_) -> Void {
25
+ self.closure({ () -> Double? in
26
+ if bridge.has_value_std__optional_double_(value) {
27
+ let __unwrapped = bridge.get_std__optional_double_(value)
28
+ return __unwrapped
29
+ } else {
30
+ return nil
31
+ }
32
+ }())
33
+ }
34
+
35
+ /**
36
+ * Casts this instance to a retained unsafe raw pointer.
37
+ * This acquires one additional strong reference on the object!
38
+ */
39
+ @inline(__always)
40
+ public func toUnsafe() -> UnsafeMutableRawPointer {
41
+ return Unmanaged.passRetained(self).toOpaque()
42
+ }
43
+
44
+ /**
45
+ * Casts an unsafe pointer to a `Func_void_std__optional_double_`.
46
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_std__optional_double_>`.
47
+ * This removes one strong reference from the object!
48
+ */
49
+ @inline(__always)
50
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__optional_double_ {
51
+ return Unmanaged<Func_void_std__optional_double_>.fromOpaque(pointer).takeRetainedValue()
52
+ }
53
+ }
@@ -0,0 +1,53 @@
1
+ ///
2
+ /// Func_void_std__optional_std__string_.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
+ /**
11
+ * Wraps a Swift `(_ value: String?) -> Void` as a class.
12
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
13
+ */
14
+ public final class Func_void_std__optional_std__string_ {
15
+ public typealias bridge = margelo.nitro.carrotquest.bridge.swift
16
+
17
+ private let closure: (_ value: String?) -> Void
18
+
19
+ public init(_ closure: @escaping (_ value: String?) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(value: bridge.std__optional_std__string_) -> Void {
25
+ self.closure({ () -> String? in
26
+ if bridge.has_value_std__optional_std__string_(value) {
27
+ let __unwrapped = bridge.get_std__optional_std__string_(value)
28
+ return String(__unwrapped)
29
+ } else {
30
+ return nil
31
+ }
32
+ }())
33
+ }
34
+
35
+ /**
36
+ * Casts this instance to a retained unsafe raw pointer.
37
+ * This acquires one additional strong reference on the object!
38
+ */
39
+ @inline(__always)
40
+ public func toUnsafe() -> UnsafeMutableRawPointer {
41
+ return Unmanaged.passRetained(self).toOpaque()
42
+ }
43
+
44
+ /**
45
+ * Casts an unsafe pointer to a `Func_void_std__optional_std__string_`.
46
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_std__optional_std__string_>`.
47
+ * This removes one strong reference from the object!
48
+ */
49
+ @inline(__always)
50
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__optional_std__string_ {
51
+ return Unmanaged<Func_void_std__optional_std__string_>.fromOpaque(pointer).takeRetainedValue()
52
+ }
53
+ }
@@ -0,0 +1,46 @@
1
+ ///
2
+ /// Func_void_std__string.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
+ /**
11
+ * Wraps a Swift `(_ url: String) -> Void` as a class.
12
+ * This class can be used from C++, e.g. to wrap the Swift closure as a `std::function`.
13
+ */
14
+ public final class Func_void_std__string {
15
+ public typealias bridge = margelo.nitro.carrotquest.bridge.swift
16
+
17
+ private let closure: (_ url: String) -> Void
18
+
19
+ public init(_ closure: @escaping (_ url: String) -> Void) {
20
+ self.closure = closure
21
+ }
22
+
23
+ @inline(__always)
24
+ public func call(url: std.string) -> Void {
25
+ self.closure(String(url))
26
+ }
27
+
28
+ /**
29
+ * Casts this instance to a retained unsafe raw pointer.
30
+ * This acquires one additional strong reference on the object!
31
+ */
32
+ @inline(__always)
33
+ public func toUnsafe() -> UnsafeMutableRawPointer {
34
+ return Unmanaged.passRetained(self).toOpaque()
35
+ }
36
+
37
+ /**
38
+ * Casts an unsafe pointer to a `Func_void_std__string`.
39
+ * The pointer has to be a retained opaque `Unmanaged<Func_void_std__string>`.
40
+ * This removes one strong reference from the object!
41
+ */
42
+ @inline(__always)
43
+ public static func fromUnsafe(_ pointer: UnsafeMutableRawPointer) -> Func_void_std__string {
44
+ return Unmanaged<Func_void_std__string>.fromOpaque(pointer).takeRetainedValue()
45
+ }
46
+ }
@@ -0,0 +1,88 @@
1
+ ///
2
+ /// HybridCarrotQuestSpec.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
+ /// See ``HybridCarrotQuestSpec``
11
+ public protocol HybridCarrotQuestSpec_protocol: HybridObject {
12
+ // Properties
13
+ var isConfigured: Bool { get }
14
+ var isChatOpen: Bool { get }
15
+
16
+ // Methods
17
+ func setup(apiKey: String, options: CarrotQuestSetupOptions?) throws -> Promise<Void>
18
+ func getSdkVersion() throws -> String
19
+ func auth(userId: String, userAuthKey: String) throws -> Promise<String?>
20
+ func hashedAuth(userId: String, hash: String) throws -> Promise<String?>
21
+ func logout() throws -> Promise<Void>
22
+ func openChat() throws -> Promise<Void>
23
+ func closeChat() throws -> Promise<Void>
24
+ func onChatVisibilityChanged(listener: @escaping (_ visible: Bool) -> Void) throws -> Void
25
+ func setTheme(theme: CarrotQuestTheme) throws -> Void
26
+ func getUnreadConversationsCount() throws -> Promise<Double>
27
+ func getUnreadMessagesCount() throws -> Promise<Double?>
28
+ func onUnreadConversationsChanged(listener: @escaping (_ count: Double) -> Void) throws -> Void
29
+ func setUserProperties(properties: CarrotQuestUserProperties) throws -> Void
30
+ func setProperties(properties: [CarrotQuestProperty]) throws -> Void
31
+ func trackEvent(name: String, params: Dictionary<String, CarrotQuestEventValue>?) throws -> Void
32
+ func trackScreen(name: String) throws -> Void
33
+ func trackUtm(url: String) throws -> Void
34
+ func setPushToken(token: String) throws -> Void
35
+ func deletePushToken() throws -> Void
36
+ func pushNotificationsUnsubscribe() throws -> Promise<Void>
37
+ func pushCampaignsUnsubscribe() throws -> Promise<Void>
38
+ func isCarrotPush(payloadJson: String) throws -> Bool
39
+ func isAutoMessage(payloadJson: String) throws -> Bool
40
+ func handlePushNotification(payloadJson: String) throws -> Void
41
+ func handlePushClick(payloadJson: String, openLink: Bool) throws -> Void
42
+ func getPushLink(payloadJson: String) throws -> String?
43
+ func wasPushShownEarlier(payloadJson: String) throws -> Promise<Bool>
44
+ func onUrlOpen(source: CarrotQuestUrlSource, listener: @escaping (_ url: String) -> Void) throws -> Void
45
+ func openBrowserLink(url: String) throws -> Void
46
+ func openUniversalLink(url: String) throws -> Void
47
+ func getDiagnostics() throws -> String?
48
+ func onLog(listener: @escaping (_ entry: CarrotQuestLogEntry) -> Void) throws -> Void
49
+ func offLog() throws -> Void
50
+ }
51
+
52
+ public extension HybridCarrotQuestSpec_protocol {
53
+ /// Default implementation of ``HybridObject.toString``
54
+ func toString() -> String {
55
+ return "[HybridObject CarrotQuest]"
56
+ }
57
+ }
58
+
59
+ /// See ``HybridCarrotQuestSpec``
60
+ open class HybridCarrotQuestSpec_base {
61
+ private weak var cxxWrapper: HybridCarrotQuestSpec_cxx? = nil
62
+ public init() { }
63
+ public func getCxxWrapper() -> HybridCarrotQuestSpec_cxx {
64
+ #if DEBUG
65
+ guard self is any HybridCarrotQuestSpec else {
66
+ fatalError("`self` is not a `HybridCarrotQuestSpec`! Did you accidentally inherit from `HybridCarrotQuestSpec_base` instead of `HybridCarrotQuestSpec`?")
67
+ }
68
+ #endif
69
+ if let cxxWrapper = self.cxxWrapper {
70
+ return cxxWrapper
71
+ } else {
72
+ let cxxWrapper = HybridCarrotQuestSpec_cxx(self as! any HybridCarrotQuestSpec)
73
+ self.cxxWrapper = cxxWrapper
74
+ return cxxWrapper
75
+ }
76
+ }
77
+ }
78
+
79
+ /**
80
+ * A Swift base-protocol representing the CarrotQuest HybridObject.
81
+ * Implement this protocol to create Swift-based instances of CarrotQuest.
82
+ * ```swift
83
+ * class HybridCarrotQuest : HybridCarrotQuestSpec {
84
+ * // ...
85
+ * }
86
+ * ```
87
+ */
88
+ public typealias HybridCarrotQuestSpec = HybridCarrotQuestSpec_protocol & HybridCarrotQuestSpec_base