@rownd/react-native 2.2.2 → 2.2.3
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/ios/RowndPlugin.swift +13 -13
- package/package.json +1 -1
- package/rownd-react-native.podspec +1 -1
package/ios/RowndPlugin.swift
CHANGED
|
@@ -5,14 +5,14 @@ import AnyCodable
|
|
|
5
5
|
|
|
6
6
|
@objc(RowndPlugin)
|
|
7
7
|
class RowndPlugin: NSObject {
|
|
8
|
-
|
|
8
|
+
|
|
9
9
|
@ObservedObject private var state = Rownd.getInstance().state().subscribe { $0 }
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
private var stateCancellable: AnyCancellable?
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
override init() {
|
|
14
14
|
super.init()
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
stateCancellable = state.$current.sink { newState in
|
|
17
17
|
do {
|
|
18
18
|
RowndPluginEventEmitter.emitter.sendEvent(withName: "update_state", body: try newState.toDictionary())
|
|
@@ -21,7 +21,7 @@ class RowndPlugin: NSObject {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
@objc(configure:withResolver:withRejecter:)
|
|
26
26
|
func configure(appKey: String, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) -> Void {
|
|
27
27
|
Task.init {
|
|
@@ -29,47 +29,47 @@ class RowndPlugin: NSObject {
|
|
|
29
29
|
}
|
|
30
30
|
resolve(appKey)
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
|
|
33
33
|
@objc
|
|
34
34
|
func requestSignIn() -> Void {
|
|
35
35
|
DispatchQueue.main.async {
|
|
36
36
|
Rownd.requestSignIn()
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
@objc
|
|
41
41
|
func signOut() -> Void {
|
|
42
42
|
DispatchQueue.main.async {
|
|
43
43
|
Rownd.signOut()
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
|
|
47
47
|
@objc
|
|
48
48
|
func manageAccount() -> Void {
|
|
49
49
|
DispatchQueue.main.async {
|
|
50
|
-
Rownd.
|
|
50
|
+
Rownd.manageAccount()
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
@objc(getAccessToken:withResolver:)
|
|
55
55
|
func getAccessToken(resolve: @escaping RCTPromiseResolveBlock) async -> Void {
|
|
56
56
|
let accessToken = await Rownd.getAccessToken()
|
|
57
57
|
resolve(accessToken)
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
@objc(setUserData:)
|
|
61
61
|
func setUserData(data: Dictionary<String, Any>) -> Void {
|
|
62
62
|
do {
|
|
63
63
|
let jsonData = try JSONSerialization.data(withJSONObject: data, options: .prettyPrinted)
|
|
64
64
|
let decoder = JSONDecoder()
|
|
65
65
|
let dictionary = try! decoder.decode([String: AnyCodable].self, from: jsonData)
|
|
66
|
-
|
|
66
|
+
|
|
67
67
|
Rownd.user.set(data: dictionary)
|
|
68
68
|
} catch {
|
|
69
69
|
print("FAILED TO SET USER DATA: ",error)
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
|
|
73
73
|
@objc(setUserDataValue:withValue:)
|
|
74
74
|
func setUserDataValue(key: String, value: Any) -> Void {
|
|
75
75
|
let json = """
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
|
|
|
17
17
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
18
18
|
|
|
19
19
|
s.dependency "React-Core"
|
|
20
|
-
s.dependency "Rownd"
|
|
20
|
+
s.dependency "Rownd", "~> 1.9.0"
|
|
21
21
|
|
|
22
22
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|
|
23
23
|
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|