react-native-acoustic-connect-beta 18.0.26 → 18.0.28
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/AcousticConnectRN.podspec +7 -4
- package/README.md +36 -7
- package/android/CMakeLists.txt +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/assets/ConnectBasicConfig.properties +1 -1
- package/android/src/main/java/com/acousticconnectrn/AcousticConnectRNPackage.java +1 -1
- package/android/src/main/java/com/acousticconnectrn/HybridAcousticConnectRN.kt +221 -13
- package/ios/Bridge.h +1 -1
- package/ios/HybridAcousticConnectRN.swift +179 -2
- package/lib/commonjs/TLTRN.js +23 -3
- package/lib/commonjs/TLTRN.js.map +1 -1
- package/lib/commonjs/components/Connect.js +1 -1
- package/lib/commonjs/index.js +13 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/withAcousticAutoDialog.js +1 -1
- package/lib/module/TLTRN.js +23 -3
- package/lib/module/TLTRN.js.map +1 -1
- package/lib/module/components/Connect.js +1 -1
- package/lib/module/index.js +14 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/withAcousticAutoDialog.js +1 -1
- package/lib/typescript/src/TLTRN.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts +109 -0
- package/lib/typescript/src/specs/react-native-acoustic-connect.nitro.d.ts.map +1 -1
- package/lib/typescript/src/utils/withAcousticAutoDialog.d.ts +1 -1
- package/nitrogen/generated/android/AcousticConnectRN+autolinking.cmake +1 -0
- package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.cpp +137 -1
- package/nitrogen/generated/android/c++/JHybridAcousticConnectRNSpec.hpp +7 -0
- package/nitrogen/generated/android/c++/JPushErrorInfo.hpp +66 -0
- package/nitrogen/generated/android/c++/JPushPermissionResult.hpp +66 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_Boolean.cpp +26 -0
- package/nitrogen/generated/android/c++/JVariant_NullType_Boolean.hpp +69 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/HybridAcousticConnectRNSpec.kt +30 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/PushErrorInfo.kt +61 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/PushPermissionResult.kt +56 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/acousticconnectrn/Variant_NullType_Boolean.kt +62 -0
- package/nitrogen/generated/ios/AcousticConnectRN-Swift-Cxx-Bridge.cpp +32 -0
- package/nitrogen/generated/ios/AcousticConnectRN-Swift-Cxx-Bridge.hpp +249 -0
- package/nitrogen/generated/ios/AcousticConnectRN-Swift-Cxx-Umbrella.hpp +8 -0
- package/nitrogen/generated/ios/c++/HybridAcousticConnectRNSpecSwift.hpp +67 -1
- package/nitrogen/generated/ios/swift/Func_void_PushPermissionResult.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_bool.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +46 -0
- package/nitrogen/generated/ios/swift/Func_void_std__variant_nitro__NullType__bool_.swift +58 -0
- package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec.swift +7 -0
- package/nitrogen/generated/ios/swift/HybridAcousticConnectRNSpec_cxx.swift +205 -0
- package/nitrogen/generated/ios/swift/PushErrorInfo.swift +65 -0
- package/nitrogen/generated/ios/swift/PushPermissionResult.swift +66 -0
- package/nitrogen/generated/ios/swift/Variant_NullType_Bool.swift +30 -0
- package/nitrogen/generated/shared/c++/HybridAcousticConnectRNSpec.cpp +7 -0
- package/nitrogen/generated/shared/c++/HybridAcousticConnectRNSpec.hpp +15 -1
- package/nitrogen/generated/shared/c++/PushErrorInfo.hpp +92 -0
- package/nitrogen/generated/shared/c++/PushPermissionResult.hpp +90 -0
- package/package.json +5 -5
- package/src/TLTRN.ts +31 -11
- package/src/components/Connect.tsx +1 -1
- package/src/index.ts +19 -2
- package/src/specs/react-native-acoustic-connect.nitro.ts +129 -1
- package/src/utils/withAcousticAutoDialog.tsx +1 -1
|
@@ -603,4 +603,209 @@ open class HybridAcousticConnectRNSpec_cxx {
|
|
|
603
603
|
return bridge.create_Result_bool_(__exceptionPtr)
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
|
+
|
|
607
|
+
@inline(__always)
|
|
608
|
+
public final func pushDidRegisterWithToken(deviceToken: ArrayBuffer) -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
609
|
+
do {
|
|
610
|
+
let __result = try self.__implementation.pushDidRegisterWithToken(deviceToken: deviceToken)
|
|
611
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
612
|
+
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
613
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
614
|
+
__result
|
|
615
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
616
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
617
|
+
return __promise
|
|
618
|
+
}()
|
|
619
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
620
|
+
} catch (let __error) {
|
|
621
|
+
let __exceptionPtr = __error.toCpp()
|
|
622
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
@inline(__always)
|
|
627
|
+
public final func pushDidFailToRegister(error: PushErrorInfo) -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
628
|
+
do {
|
|
629
|
+
let __result = try self.__implementation.pushDidFailToRegister(error: error)
|
|
630
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
631
|
+
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
632
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
633
|
+
__result
|
|
634
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
635
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
636
|
+
return __promise
|
|
637
|
+
}()
|
|
638
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
639
|
+
} catch (let __error) {
|
|
640
|
+
let __exceptionPtr = __error.toCpp()
|
|
641
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
@inline(__always)
|
|
646
|
+
public final func pushDidReceiveNotification(userInfo: bridge.std__unordered_map_std__string__std__variant_bool__std__string__double__) -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
647
|
+
do {
|
|
648
|
+
let __result = try self.__implementation.pushDidReceiveNotification(userInfo: { () -> Dictionary<String, Variant_Bool_String_Double> in
|
|
649
|
+
var __dictionary = Dictionary<String, Variant_Bool_String_Double>(minimumCapacity: userInfo.size())
|
|
650
|
+
let __keys = bridge.get_std__unordered_map_std__string__std__variant_bool__std__string__double___keys(userInfo)
|
|
651
|
+
for __key in __keys {
|
|
652
|
+
let __value = bridge.get_std__unordered_map_std__string__std__variant_bool__std__string__double___value(userInfo, __key)
|
|
653
|
+
__dictionary[String(__key)] = { () -> Variant_Bool_String_Double in
|
|
654
|
+
let __variant = bridge.std__variant_bool__std__string__double_(__value)
|
|
655
|
+
switch __variant.index() {
|
|
656
|
+
case 0:
|
|
657
|
+
let __actual = __variant.get_0()
|
|
658
|
+
return .first(__actual)
|
|
659
|
+
case 1:
|
|
660
|
+
let __actual = __variant.get_1()
|
|
661
|
+
return .second(String(__actual))
|
|
662
|
+
case 2:
|
|
663
|
+
let __actual = __variant.get_2()
|
|
664
|
+
return .third(__actual)
|
|
665
|
+
default:
|
|
666
|
+
fatalError("Variant can never have index \(__variant.index())!")
|
|
667
|
+
}
|
|
668
|
+
}()
|
|
669
|
+
}
|
|
670
|
+
return __dictionary
|
|
671
|
+
}())
|
|
672
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
673
|
+
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
674
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
675
|
+
__result
|
|
676
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
677
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
678
|
+
return __promise
|
|
679
|
+
}()
|
|
680
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
681
|
+
} catch (let __error) {
|
|
682
|
+
let __exceptionPtr = __error.toCpp()
|
|
683
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
@inline(__always)
|
|
688
|
+
public final func pushDidReceiveResponse(actionIdentifier: std.string, userInfo: bridge.std__unordered_map_std__string__std__variant_bool__std__string__double__) -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
689
|
+
do {
|
|
690
|
+
let __result = try self.__implementation.pushDidReceiveResponse(actionIdentifier: String(actionIdentifier), userInfo: { () -> Dictionary<String, Variant_Bool_String_Double> in
|
|
691
|
+
var __dictionary = Dictionary<String, Variant_Bool_String_Double>(minimumCapacity: userInfo.size())
|
|
692
|
+
let __keys = bridge.get_std__unordered_map_std__string__std__variant_bool__std__string__double___keys(userInfo)
|
|
693
|
+
for __key in __keys {
|
|
694
|
+
let __value = bridge.get_std__unordered_map_std__string__std__variant_bool__std__string__double___value(userInfo, __key)
|
|
695
|
+
__dictionary[String(__key)] = { () -> Variant_Bool_String_Double in
|
|
696
|
+
let __variant = bridge.std__variant_bool__std__string__double_(__value)
|
|
697
|
+
switch __variant.index() {
|
|
698
|
+
case 0:
|
|
699
|
+
let __actual = __variant.get_0()
|
|
700
|
+
return .first(__actual)
|
|
701
|
+
case 1:
|
|
702
|
+
let __actual = __variant.get_1()
|
|
703
|
+
return .second(String(__actual))
|
|
704
|
+
case 2:
|
|
705
|
+
let __actual = __variant.get_2()
|
|
706
|
+
return .third(__actual)
|
|
707
|
+
default:
|
|
708
|
+
fatalError("Variant can never have index \(__variant.index())!")
|
|
709
|
+
}
|
|
710
|
+
}()
|
|
711
|
+
}
|
|
712
|
+
return __dictionary
|
|
713
|
+
}())
|
|
714
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
715
|
+
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
716
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
717
|
+
__result
|
|
718
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
719
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
720
|
+
return __promise
|
|
721
|
+
}()
|
|
722
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
723
|
+
} catch (let __error) {
|
|
724
|
+
let __exceptionPtr = __error.toCpp()
|
|
725
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
@inline(__always)
|
|
730
|
+
public final func pushDidReceiveAuthorization(granted: bridge.std__optional_std__variant_nitro__NullType__bool__, error: bridge.std__optional_PushErrorInfo_) -> bridge.Result_std__shared_ptr_Promise_bool___ {
|
|
731
|
+
do {
|
|
732
|
+
let __result = try self.__implementation.pushDidReceiveAuthorization(granted: { () -> Variant_NullType_Bool? in
|
|
733
|
+
if bridge.has_value_std__optional_std__variant_nitro__NullType__bool__(granted) {
|
|
734
|
+
let __unwrapped = bridge.get_std__optional_std__variant_nitro__NullType__bool__(granted)
|
|
735
|
+
return { () -> Variant_NullType_Bool in
|
|
736
|
+
let __variant = bridge.std__variant_nitro__NullType__bool_(__unwrapped)
|
|
737
|
+
switch __variant.index() {
|
|
738
|
+
case 0:
|
|
739
|
+
let __actual = __variant.get_0()
|
|
740
|
+
return .first(NullType.null)
|
|
741
|
+
case 1:
|
|
742
|
+
let __actual = __variant.get_1()
|
|
743
|
+
return .second(__actual)
|
|
744
|
+
default:
|
|
745
|
+
fatalError("Variant can never have index \(__variant.index())!")
|
|
746
|
+
}
|
|
747
|
+
}()
|
|
748
|
+
} else {
|
|
749
|
+
return nil
|
|
750
|
+
}
|
|
751
|
+
}(), error: error.value)
|
|
752
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_bool__ in
|
|
753
|
+
let __promise = bridge.create_std__shared_ptr_Promise_bool__()
|
|
754
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_bool__(__promise)
|
|
755
|
+
__result
|
|
756
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
757
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
758
|
+
return __promise
|
|
759
|
+
}()
|
|
760
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__resultCpp)
|
|
761
|
+
} catch (let __error) {
|
|
762
|
+
let __exceptionPtr = __error.toCpp()
|
|
763
|
+
return bridge.create_Result_std__shared_ptr_Promise_bool___(__exceptionPtr)
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
@inline(__always)
|
|
768
|
+
public final func pushRequestPermission() -> bridge.Result_std__shared_ptr_Promise_PushPermissionResult___ {
|
|
769
|
+
do {
|
|
770
|
+
let __result = try self.__implementation.pushRequestPermission()
|
|
771
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_PushPermissionResult__ in
|
|
772
|
+
let __promise = bridge.create_std__shared_ptr_Promise_PushPermissionResult__()
|
|
773
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_PushPermissionResult__(__promise)
|
|
774
|
+
__result
|
|
775
|
+
.then({ __result in __promiseHolder.resolve(__result) })
|
|
776
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
777
|
+
return __promise
|
|
778
|
+
}()
|
|
779
|
+
return bridge.create_Result_std__shared_ptr_Promise_PushPermissionResult___(__resultCpp)
|
|
780
|
+
} catch (let __error) {
|
|
781
|
+
let __exceptionPtr = __error.toCpp()
|
|
782
|
+
return bridge.create_Result_std__shared_ptr_Promise_PushPermissionResult___(__exceptionPtr)
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
@inline(__always)
|
|
787
|
+
public final func pushGetPermissionState() -> bridge.Result_std__shared_ptr_Promise_std__variant_nitro__NullType__bool____ {
|
|
788
|
+
do {
|
|
789
|
+
let __result = try self.__implementation.pushGetPermissionState()
|
|
790
|
+
let __resultCpp = { () -> bridge.std__shared_ptr_Promise_std__variant_nitro__NullType__bool___ in
|
|
791
|
+
let __promise = bridge.create_std__shared_ptr_Promise_std__variant_nitro__NullType__bool___()
|
|
792
|
+
let __promiseHolder = bridge.wrap_std__shared_ptr_Promise_std__variant_nitro__NullType__bool___(__promise)
|
|
793
|
+
__result
|
|
794
|
+
.then({ __result in __promiseHolder.resolve({ () -> bridge.std__variant_nitro__NullType__bool_ in
|
|
795
|
+
switch __result {
|
|
796
|
+
case .first(let __value):
|
|
797
|
+
return bridge.create_std__variant_nitro__NullType__bool_(margelo.nitro.NullType.null)
|
|
798
|
+
case .second(let __value):
|
|
799
|
+
return bridge.create_std__variant_nitro__NullType__bool_(__value)
|
|
800
|
+
}
|
|
801
|
+
}().variant) })
|
|
802
|
+
.catch({ __error in __promiseHolder.reject(__error.toCpp()) })
|
|
803
|
+
return __promise
|
|
804
|
+
}()
|
|
805
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__bool____(__resultCpp)
|
|
806
|
+
} catch (let __error) {
|
|
807
|
+
let __exceptionPtr = __error.toCpp()
|
|
808
|
+
return bridge.create_Result_std__shared_ptr_Promise_std__variant_nitro__NullType__bool____(__exceptionPtr)
|
|
809
|
+
}
|
|
810
|
+
}
|
|
606
811
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PushErrorInfo.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
|
+
* Represents an instance of `PushErrorInfo`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias PushErrorInfo = margelo.nitro.acousticconnectrn.PushErrorInfo
|
|
14
|
+
|
|
15
|
+
public extension PushErrorInfo {
|
|
16
|
+
private typealias bridge = margelo.nitro.acousticconnectrn.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `PushErrorInfo`.
|
|
20
|
+
*/
|
|
21
|
+
init(code: Double?, domain: String?, message: String) {
|
|
22
|
+
self.init({ () -> bridge.std__optional_double_ in
|
|
23
|
+
if let __unwrappedValue = code {
|
|
24
|
+
return bridge.create_std__optional_double_(__unwrappedValue)
|
|
25
|
+
} else {
|
|
26
|
+
return .init()
|
|
27
|
+
}
|
|
28
|
+
}(), { () -> bridge.std__optional_std__string_ in
|
|
29
|
+
if let __unwrappedValue = domain {
|
|
30
|
+
return bridge.create_std__optional_std__string_(std.string(__unwrappedValue))
|
|
31
|
+
} else {
|
|
32
|
+
return .init()
|
|
33
|
+
}
|
|
34
|
+
}(), std.string(message))
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@inline(__always)
|
|
38
|
+
var code: Double? {
|
|
39
|
+
return { () -> Double? in
|
|
40
|
+
if bridge.has_value_std__optional_double_(self.__code) {
|
|
41
|
+
let __unwrapped = bridge.get_std__optional_double_(self.__code)
|
|
42
|
+
return __unwrapped
|
|
43
|
+
} else {
|
|
44
|
+
return nil
|
|
45
|
+
}
|
|
46
|
+
}()
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@inline(__always)
|
|
50
|
+
var domain: String? {
|
|
51
|
+
return { () -> String? in
|
|
52
|
+
if bridge.has_value_std__optional_std__string_(self.__domain) {
|
|
53
|
+
let __unwrapped = bridge.get_std__optional_std__string_(self.__domain)
|
|
54
|
+
return String(__unwrapped)
|
|
55
|
+
} else {
|
|
56
|
+
return nil
|
|
57
|
+
}
|
|
58
|
+
}()
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@inline(__always)
|
|
62
|
+
var message: String {
|
|
63
|
+
return String(self.__message)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PushPermissionResult.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
|
+
* Represents an instance of `PushPermissionResult`, backed by a C++ struct.
|
|
12
|
+
*/
|
|
13
|
+
public typealias PushPermissionResult = margelo.nitro.acousticconnectrn.PushPermissionResult
|
|
14
|
+
|
|
15
|
+
public extension PushPermissionResult {
|
|
16
|
+
private typealias bridge = margelo.nitro.acousticconnectrn.bridge.swift
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of `PushPermissionResult`.
|
|
20
|
+
*/
|
|
21
|
+
init(granted: Bool, error: Variant_NullType_String?) {
|
|
22
|
+
self.init(granted, { () -> bridge.std__optional_std__variant_nitro__NullType__std__string__ in
|
|
23
|
+
if let __unwrappedValue = error {
|
|
24
|
+
return bridge.create_std__optional_std__variant_nitro__NullType__std__string__({ () -> bridge.std__variant_nitro__NullType__std__string_ in
|
|
25
|
+
switch __unwrappedValue {
|
|
26
|
+
case .first(let __value):
|
|
27
|
+
return bridge.create_std__variant_nitro__NullType__std__string_(margelo.nitro.NullType.null)
|
|
28
|
+
case .second(let __value):
|
|
29
|
+
return bridge.create_std__variant_nitro__NullType__std__string_(std.string(__value))
|
|
30
|
+
}
|
|
31
|
+
}().variant)
|
|
32
|
+
} else {
|
|
33
|
+
return .init()
|
|
34
|
+
}
|
|
35
|
+
}())
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@inline(__always)
|
|
39
|
+
var granted: Bool {
|
|
40
|
+
return self.__granted
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@inline(__always)
|
|
44
|
+
var error: Variant_NullType_String? {
|
|
45
|
+
return { () -> Variant_NullType_String? in
|
|
46
|
+
if bridge.has_value_std__optional_std__variant_nitro__NullType__std__string__(self.__error) {
|
|
47
|
+
let __unwrapped = bridge.get_std__optional_std__variant_nitro__NullType__std__string__(self.__error)
|
|
48
|
+
return { () -> Variant_NullType_String in
|
|
49
|
+
let __variant = bridge.std__variant_nitro__NullType__std__string_(__unwrapped)
|
|
50
|
+
switch __variant.index() {
|
|
51
|
+
case 0:
|
|
52
|
+
let __actual = __variant.get_0()
|
|
53
|
+
return .first(NullType.null)
|
|
54
|
+
case 1:
|
|
55
|
+
let __actual = __variant.get_1()
|
|
56
|
+
return .second(String(__actual))
|
|
57
|
+
default:
|
|
58
|
+
fatalError("Variant can never have index \(__variant.index())!")
|
|
59
|
+
}
|
|
60
|
+
}()
|
|
61
|
+
} else {
|
|
62
|
+
return nil
|
|
63
|
+
}
|
|
64
|
+
}()
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// Variant_NullType_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
|
+
* An Swift enum with associated values representing a Variant/Union type.
|
|
12
|
+
* JS type: `null | boolean`
|
|
13
|
+
*/
|
|
14
|
+
@frozen
|
|
15
|
+
public enum Variant_NullType_Bool {
|
|
16
|
+
case first(NullType)
|
|
17
|
+
case second(Bool)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public extension Variant_NullType_Bool {
|
|
21
|
+
func asType<T>(_ type: T.Type = T.self) -> T? {
|
|
22
|
+
switch self {
|
|
23
|
+
case .first(let value): return value as? T
|
|
24
|
+
case .second(let value): return value as? T
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
func isType<T>(_ type: T.Type = T.self) -> Bool {
|
|
28
|
+
return self.asType(type) != nil
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -38,6 +38,13 @@ namespace margelo::nitro::acousticconnectrn {
|
|
|
38
38
|
prototype.registerHybridMethod("logDialogDismissEvent", &HybridAcousticConnectRNSpec::logDialogDismissEvent);
|
|
39
39
|
prototype.registerHybridMethod("logDialogButtonClickEvent", &HybridAcousticConnectRNSpec::logDialogButtonClickEvent);
|
|
40
40
|
prototype.registerHybridMethod("logDialogCustomEvent", &HybridAcousticConnectRNSpec::logDialogCustomEvent);
|
|
41
|
+
prototype.registerHybridMethod("pushDidRegisterWithToken", &HybridAcousticConnectRNSpec::pushDidRegisterWithToken);
|
|
42
|
+
prototype.registerHybridMethod("pushDidFailToRegister", &HybridAcousticConnectRNSpec::pushDidFailToRegister);
|
|
43
|
+
prototype.registerHybridMethod("pushDidReceiveNotification", &HybridAcousticConnectRNSpec::pushDidReceiveNotification);
|
|
44
|
+
prototype.registerHybridMethod("pushDidReceiveResponse", &HybridAcousticConnectRNSpec::pushDidReceiveResponse);
|
|
45
|
+
prototype.registerHybridMethod("pushDidReceiveAuthorization", &HybridAcousticConnectRNSpec::pushDidReceiveAuthorization);
|
|
46
|
+
prototype.registerHybridMethod("pushRequestPermission", &HybridAcousticConnectRNSpec::pushRequestPermission);
|
|
47
|
+
prototype.registerHybridMethod("pushGetPermissionState", &HybridAcousticConnectRNSpec::pushGetPermissionState);
|
|
41
48
|
});
|
|
42
49
|
}
|
|
43
50
|
|
|
@@ -13,13 +13,20 @@
|
|
|
13
13
|
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
14
|
#endif
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
// Forward declaration of `PushErrorInfo` to properly resolve imports.
|
|
17
|
+
namespace margelo::nitro::acousticconnectrn { struct PushErrorInfo; }
|
|
18
|
+
// Forward declaration of `PushPermissionResult` to properly resolve imports.
|
|
19
|
+
namespace margelo::nitro::acousticconnectrn { struct PushPermissionResult; }
|
|
17
20
|
|
|
18
21
|
#include <string>
|
|
19
22
|
#include <variant>
|
|
20
23
|
#include <NitroModules/Null.hpp>
|
|
21
24
|
#include <optional>
|
|
22
25
|
#include <unordered_map>
|
|
26
|
+
#include <NitroModules/Promise.hpp>
|
|
27
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
28
|
+
#include "PushErrorInfo.hpp"
|
|
29
|
+
#include "PushPermissionResult.hpp"
|
|
23
30
|
|
|
24
31
|
namespace margelo::nitro::acousticconnectrn {
|
|
25
32
|
|
|
@@ -76,6 +83,13 @@ namespace margelo::nitro::acousticconnectrn {
|
|
|
76
83
|
virtual bool logDialogDismissEvent(const std::string& dialogId, const std::string& dismissReason) = 0;
|
|
77
84
|
virtual bool logDialogButtonClickEvent(const std::string& dialogId, const std::string& buttonText, double buttonIndex) = 0;
|
|
78
85
|
virtual bool logDialogCustomEvent(const std::string& dialogId, const std::string& eventName, const std::unordered_map<std::string, std::variant<bool, std::string, double>>& values) = 0;
|
|
86
|
+
virtual std::shared_ptr<Promise<bool>> pushDidRegisterWithToken(const std::shared_ptr<ArrayBuffer>& deviceToken) = 0;
|
|
87
|
+
virtual std::shared_ptr<Promise<bool>> pushDidFailToRegister(const PushErrorInfo& error) = 0;
|
|
88
|
+
virtual std::shared_ptr<Promise<bool>> pushDidReceiveNotification(const std::unordered_map<std::string, std::variant<bool, std::string, double>>& userInfo) = 0;
|
|
89
|
+
virtual std::shared_ptr<Promise<bool>> pushDidReceiveResponse(const std::string& actionIdentifier, const std::unordered_map<std::string, std::variant<bool, std::string, double>>& userInfo) = 0;
|
|
90
|
+
virtual std::shared_ptr<Promise<bool>> pushDidReceiveAuthorization(const std::optional<std::variant<nitro::NullType, bool>>& granted, const std::optional<PushErrorInfo>& error) = 0;
|
|
91
|
+
virtual std::shared_ptr<Promise<PushPermissionResult>> pushRequestPermission() = 0;
|
|
92
|
+
virtual std::shared_ptr<Promise<std::variant<nitro::NullType, bool>>> pushGetPermissionState() = 0;
|
|
79
93
|
|
|
80
94
|
protected:
|
|
81
95
|
// Hybrid Setup
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PushErrorInfo.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
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <optional>
|
|
34
|
+
#include <string>
|
|
35
|
+
|
|
36
|
+
namespace margelo::nitro::acousticconnectrn {
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A struct which can be represented as a JavaScript object (PushErrorInfo).
|
|
40
|
+
*/
|
|
41
|
+
struct PushErrorInfo final {
|
|
42
|
+
public:
|
|
43
|
+
std::optional<double> code SWIFT_PRIVATE;
|
|
44
|
+
std::optional<std::string> domain SWIFT_PRIVATE;
|
|
45
|
+
std::string message SWIFT_PRIVATE;
|
|
46
|
+
|
|
47
|
+
public:
|
|
48
|
+
PushErrorInfo() = default;
|
|
49
|
+
explicit PushErrorInfo(std::optional<double> code, std::optional<std::string> domain, std::string message): code(code), domain(domain), message(message) {}
|
|
50
|
+
|
|
51
|
+
public:
|
|
52
|
+
friend bool operator==(const PushErrorInfo& lhs, const PushErrorInfo& rhs) = default;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
} // namespace margelo::nitro::acousticconnectrn
|
|
56
|
+
|
|
57
|
+
namespace margelo::nitro {
|
|
58
|
+
|
|
59
|
+
// C++ PushErrorInfo <> JS PushErrorInfo (object)
|
|
60
|
+
template <>
|
|
61
|
+
struct JSIConverter<margelo::nitro::acousticconnectrn::PushErrorInfo> final {
|
|
62
|
+
static inline margelo::nitro::acousticconnectrn::PushErrorInfo fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
63
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
64
|
+
return margelo::nitro::acousticconnectrn::PushErrorInfo(
|
|
65
|
+
JSIConverter<std::optional<double>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "code"))),
|
|
66
|
+
JSIConverter<std::optional<std::string>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "domain"))),
|
|
67
|
+
JSIConverter<std::string>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "message")))
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::acousticconnectrn::PushErrorInfo& arg) {
|
|
71
|
+
jsi::Object obj(runtime);
|
|
72
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "code"), JSIConverter<std::optional<double>>::toJSI(runtime, arg.code));
|
|
73
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "domain"), JSIConverter<std::optional<std::string>>::toJSI(runtime, arg.domain));
|
|
74
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "message"), JSIConverter<std::string>::toJSI(runtime, arg.message));
|
|
75
|
+
return obj;
|
|
76
|
+
}
|
|
77
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
78
|
+
if (!value.isObject()) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
jsi::Object obj = value.getObject(runtime);
|
|
82
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
if (!JSIConverter<std::optional<double>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "code")))) return false;
|
|
86
|
+
if (!JSIConverter<std::optional<std::string>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "domain")))) return false;
|
|
87
|
+
if (!JSIConverter<std::string>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "message")))) return false;
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
} // namespace margelo::nitro
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PushPermissionResult.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
|
+
#if __has_include(<NitroModules/JSIConverter.hpp>)
|
|
11
|
+
#include <NitroModules/JSIConverter.hpp>
|
|
12
|
+
#else
|
|
13
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
14
|
+
#endif
|
|
15
|
+
#if __has_include(<NitroModules/NitroDefines.hpp>)
|
|
16
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
17
|
+
#else
|
|
18
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
19
|
+
#endif
|
|
20
|
+
#if __has_include(<NitroModules/JSIHelpers.hpp>)
|
|
21
|
+
#include <NitroModules/JSIHelpers.hpp>
|
|
22
|
+
#else
|
|
23
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
24
|
+
#endif
|
|
25
|
+
#if __has_include(<NitroModules/PropNameIDCache.hpp>)
|
|
26
|
+
#include <NitroModules/PropNameIDCache.hpp>
|
|
27
|
+
#else
|
|
28
|
+
#error NitroModules cannot be found! Are you sure you installed NitroModules properly?
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
#include <NitroModules/Null.hpp>
|
|
34
|
+
#include <string>
|
|
35
|
+
#include <variant>
|
|
36
|
+
#include <optional>
|
|
37
|
+
|
|
38
|
+
namespace margelo::nitro::acousticconnectrn {
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A struct which can be represented as a JavaScript object (PushPermissionResult).
|
|
42
|
+
*/
|
|
43
|
+
struct PushPermissionResult final {
|
|
44
|
+
public:
|
|
45
|
+
bool granted SWIFT_PRIVATE;
|
|
46
|
+
std::optional<std::variant<nitro::NullType, std::string>> error SWIFT_PRIVATE;
|
|
47
|
+
|
|
48
|
+
public:
|
|
49
|
+
PushPermissionResult() = default;
|
|
50
|
+
explicit PushPermissionResult(bool granted, std::optional<std::variant<nitro::NullType, std::string>> error): granted(granted), error(error) {}
|
|
51
|
+
|
|
52
|
+
public:
|
|
53
|
+
friend bool operator==(const PushPermissionResult& lhs, const PushPermissionResult& rhs) = default;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
} // namespace margelo::nitro::acousticconnectrn
|
|
57
|
+
|
|
58
|
+
namespace margelo::nitro {
|
|
59
|
+
|
|
60
|
+
// C++ PushPermissionResult <> JS PushPermissionResult (object)
|
|
61
|
+
template <>
|
|
62
|
+
struct JSIConverter<margelo::nitro::acousticconnectrn::PushPermissionResult> final {
|
|
63
|
+
static inline margelo::nitro::acousticconnectrn::PushPermissionResult fromJSI(jsi::Runtime& runtime, const jsi::Value& arg) {
|
|
64
|
+
jsi::Object obj = arg.asObject(runtime);
|
|
65
|
+
return margelo::nitro::acousticconnectrn::PushPermissionResult(
|
|
66
|
+
JSIConverter<bool>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "granted"))),
|
|
67
|
+
JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::fromJSI(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "error")))
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
static inline jsi::Value toJSI(jsi::Runtime& runtime, const margelo::nitro::acousticconnectrn::PushPermissionResult& arg) {
|
|
71
|
+
jsi::Object obj(runtime);
|
|
72
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "granted"), JSIConverter<bool>::toJSI(runtime, arg.granted));
|
|
73
|
+
obj.setProperty(runtime, PropNameIDCache::get(runtime, "error"), JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::toJSI(runtime, arg.error));
|
|
74
|
+
return obj;
|
|
75
|
+
}
|
|
76
|
+
static inline bool canConvert(jsi::Runtime& runtime, const jsi::Value& value) {
|
|
77
|
+
if (!value.isObject()) {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
jsi::Object obj = value.getObject(runtime);
|
|
81
|
+
if (!nitro::isPlainObject(runtime, obj)) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
if (!JSIConverter<bool>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "granted")))) return false;
|
|
85
|
+
if (!JSIConverter<std::optional<std::variant<nitro::NullType, std::string>>>::canConvert(runtime, obj.getProperty(runtime, PropNameIDCache::get(runtime, "error")))) return false;
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
} // namespace margelo::nitro
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"author": "Acoustic, L.P.,
|
|
2
|
+
"author": "Acoustic, L.P., Radoslaw Serek, Aksana Naskalava",
|
|
3
3
|
"dependencies": {
|
|
4
4
|
"@prettier/plugin-xml": "^2.2.0",
|
|
5
5
|
"fast-xml-parser": "^4.0.8",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"@types/jest": "^29.5.12",
|
|
15
15
|
"@types/react": "^19.0.10",
|
|
16
16
|
"jetifier": "^1.6.3",
|
|
17
|
-
"nitrogen": "0.35.
|
|
17
|
+
"nitrogen": "0.35.9",
|
|
18
18
|
"prettier-plugin-kotlin": "^2.1.0",
|
|
19
19
|
"react": "19.1.1",
|
|
20
20
|
"react-native": "0.82.1",
|
|
21
21
|
"react-native-builder-bob": "^0.37.0",
|
|
22
|
-
"react-native-nitro-modules": "0.35.
|
|
22
|
+
"react-native-nitro-modules": "0.35.9",
|
|
23
23
|
"release-it": "^19.0.2",
|
|
24
24
|
"typescript": "5.0.4"
|
|
25
25
|
},
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"peerDependencies": {
|
|
100
100
|
"react": ">=19.1.1 <20.0.0",
|
|
101
101
|
"react-native": ">=0.82.0 <0.86.0",
|
|
102
|
-
"react-native-nitro-modules": "
|
|
102
|
+
"react-native-nitro-modules": "0.35.9"
|
|
103
103
|
},
|
|
104
104
|
"prettier": {
|
|
105
105
|
"quoteProps": "consistent",
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
"source": "src/index",
|
|
196
196
|
"summary": "react-native ios android tealeaf connect cxa wxca er enhanced-replay",
|
|
197
197
|
"types": "./lib/typescript/src/index.d.ts",
|
|
198
|
-
"version": "18.0.
|
|
198
|
+
"version": "18.0.28",
|
|
199
199
|
"workspaces": [
|
|
200
200
|
"example",
|
|
201
201
|
"Examples/bare-workflow"
|