@rownd/react-native 3.2.2 → 3.4.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 (27) hide show
  1. package/android/.gradle/7.4/checksums/checksums.lock +0 -0
  2. package/android/.gradle/7.4/checksums/md5-checksums.bin +0 -0
  3. package/android/.gradle/7.4/checksums/sha1-checksums.bin +0 -0
  4. package/android/.gradle/7.4/dependencies-accessors/dependencies-accessors.lock +0 -0
  5. package/android/.gradle/7.4/executionHistory/executionHistory.lock +0 -0
  6. package/android/.gradle/7.4/fileHashes/fileHashes.bin +0 -0
  7. package/android/.gradle/7.4/fileHashes/fileHashes.lock +0 -0
  8. package/android/.gradle/7.4/fileHashes/resourceHashesCache.bin +0 -0
  9. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  10. package/android/.gradle/8.9/checksums/md5-checksums.bin +0 -0
  11. package/android/.gradle/8.9/checksums/sha1-checksums.bin +0 -0
  12. package/android/.gradle/8.9/dependencies-accessors/gc.properties +0 -0
  13. package/android/.gradle/8.9/fileChanges/last-build.bin +0 -0
  14. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  15. package/android/.gradle/8.9/gc.properties +0 -0
  16. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  17. package/android/.gradle/buildOutputCleanup/cache.properties +1 -1
  18. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  19. package/android/build.gradle +3 -3
  20. package/ios/ReactNative.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  21. package/ios/ReactNative.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  22. package/ios/ReactNative.xcodeproj/project.xcworkspace/xcuserdata/mhamann.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  23. package/ios/ReactNative.xcodeproj/xcuserdata/mhamann.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  24. package/ios/RowndPlugin.swift +65 -48
  25. package/lib/package.json +173 -0
  26. package/package.json +1 -1
  27. package/rownd-react-native.podspec +2 -1
File without changes
@@ -1,2 +1,2 @@
1
- #Tue Apr 23 12:16:16 EDT 2024
1
+ #Thu Jan 23 16:09:59 EST 2025
2
2
  gradle.version=7.4
@@ -54,8 +54,8 @@ android {
54
54
  }
55
55
 
56
56
  compileOptions {
57
- sourceCompatibility JavaVersion.VERSION_1_8
58
- targetCompatibility JavaVersion.VERSION_1_8
57
+ sourceCompatibility JavaVersion.VERSION_11
58
+ targetCompatibility JavaVersion.VERSION_11
59
59
  }
60
60
  }
61
61
 
@@ -136,7 +136,7 @@ dependencies {
136
136
  //noinspection GradleDynamicVersion
137
137
  implementation "com.facebook.react:react-native:+"
138
138
  implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
139
- implementation 'io.rownd:android:2.12.0'
139
+ implementation 'io.rownd:android:2.16.2'
140
140
  implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2"
141
141
  implementation 'androidx.compose.ui:ui-unit:1.3.0'
142
142
  implementation 'androidx.compose.ui:ui-graphics:1.3.0'
@@ -0,0 +1,7 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <Workspace
3
+ version = "1.0">
4
+ <FileRef
5
+ location = "self:">
6
+ </FileRef>
7
+ </Workspace>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>IDEDidComputeMac32BitWarning</key>
6
+ <true/>
7
+ </dict>
8
+ </plist>
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>SchemeUserState</key>
6
+ <dict>
7
+ <key>ReactNative.xcscheme_^#shared#^_</key>
8
+ <dict>
9
+ <key>orderHint</key>
10
+ <integer>0</integer>
11
+ </dict>
12
+ </dict>
13
+ </dict>
14
+ </plist>
@@ -1,8 +1,8 @@
1
- import Rownd
2
- import SwiftUI
3
- import Combine
4
1
  import AnyCodable
2
+ import Combine
5
3
  import Lottie
4
+ import Rownd
5
+ import SwiftUI
6
6
 
7
7
  @objc(RowndPlugin)
8
8
  class RowndPlugin: NSObject {
@@ -16,7 +16,8 @@ class RowndPlugin: NSObject {
16
16
 
17
17
  stateCancellable = state.$current.sink { newState in
18
18
  do {
19
- RowndPluginEventEmitter.emitter.sendEvent(withName: "update_state", body: try newState.toDictionary())
19
+ RowndPluginEventEmitter.emitter.sendEvent(
20
+ withName: "update_state", body: try newState.toDictionary())
20
21
  } catch {
21
22
  print("Failed to encode Rownd state: \(String(describing: error))")
22
23
  }
@@ -24,33 +25,40 @@ class RowndPlugin: NSObject {
24
25
  }
25
26
 
26
27
  @objc(configure:withResolver:withRejecter:)
27
- func configure(config: NSDictionary, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) -> Void {
28
-
28
+ func configure(
29
+ config: NSDictionary, resolve: RCTPromiseResolveBlock, reject: RCTPromiseRejectBlock
30
+ ) {
31
+
29
32
  if let apiUrl = config.value(forKey: "apiUrl") as? String {
30
33
  Rownd.config.apiUrl = apiUrl
31
34
  }
32
-
35
+
33
36
  if let baseUrl = config.value(forKey: "baseUrl") as? String {
34
37
  Rownd.config.baseUrl = baseUrl
35
38
  }
36
-
39
+
37
40
  if let appKey = config.value(forKey: "appKey") as? String {
38
41
  Task {
39
- await Rownd.configure(launchOptions: nil, appKey: appKey);
42
+ await Rownd.configure(launchOptions: nil, appKey: appKey)
40
43
  }
41
44
  resolve(appKey)
42
45
  }
43
46
  }
44
47
 
45
48
  @objc(customizations:)
46
- func customizations(customizations: NSDictionary) -> Void {
49
+ func customizations(customizations: NSDictionary) {
47
50
  let appCustomizations = AppCustomizations()
48
51
 
49
- if let sheetBackgroundColor = customizations.value(forKey: "sheetBackgroundHexColor") as? String {
50
- appCustomizations.reactNativeSheetBackgroundColor = colorWithHexString(hexString: sheetBackgroundColor)
52
+ if let sheetBackgroundColor = customizations.value(forKey: "sheetBackgroundHexColor")
53
+ as? String
54
+ {
55
+ appCustomizations.reactNativeSheetBackgroundColor = colorWithHexString(
56
+ hexString: sheetBackgroundColor)
51
57
  }
52
58
 
53
- if let sheetCornerBorderRadius = customizations.value(forKey: "sheetCornerBorderRadius") as? String {
59
+ if let sheetCornerBorderRadius = customizations.value(forKey: "sheetCornerBorderRadius")
60
+ as? String
61
+ {
54
62
  if let doubleValue = Double(sheetCornerBorderRadius) {
55
63
  appCustomizations.sheetCornerBorderRadius = CGFloat(doubleValue)
56
64
  }
@@ -71,14 +79,14 @@ class RowndPlugin: NSObject {
71
79
  }
72
80
 
73
81
  @objc(requestSignIn:)
74
- func requestSignIn(signInConfig: NSDictionary) -> Void {
75
-
82
+ func requestSignIn(signInConfig: NSDictionary) {
83
+
76
84
  var rowndSignInOptions = RowndSignInOptions()
77
-
85
+
78
86
  if let postSignInRedirect = signInConfig.value(forKey: "postSignInRedirect") as? String {
79
87
  rowndSignInOptions.postSignInRedirect = postSignInRedirect
80
88
  }
81
-
89
+
82
90
  if let intentString = signInConfig.value(forKey: "intent") as? String {
83
91
  if let intent = RowndSignInIntent(rawValue: intentString) {
84
92
  rowndSignInOptions.intent = intent
@@ -86,9 +94,8 @@ class RowndPlugin: NSObject {
86
94
  print("Rownd plugin. An incorrect intent type was used: \(intentString)")
87
95
  }
88
96
  }
89
-
90
97
 
91
- func requestSignInHub() -> Void {
98
+ func requestSignInHub() {
92
99
  DispatchQueue.main.async {
93
100
  Rownd.requestSignIn(rowndSignInOptions)
94
101
  }
@@ -97,19 +104,23 @@ class RowndPlugin: NSObject {
97
104
  switch method {
98
105
  case "apple":
99
106
  DispatchQueue.main.async {
100
- Rownd.requestSignIn(with: RowndSignInHint.appleId, signInOptions: rowndSignInOptions)
107
+ Rownd.requestSignIn(
108
+ with: RowndSignInHint.appleId, signInOptions: rowndSignInOptions)
101
109
  }
102
110
  case "google":
103
111
  DispatchQueue.main.async {
104
- Rownd.requestSignIn(with: RowndSignInHint.googleId, signInOptions: rowndSignInOptions)
112
+ Rownd.requestSignIn(
113
+ with: RowndSignInHint.googleId, signInOptions: rowndSignInOptions)
105
114
  }
106
115
  case "guest":
107
116
  DispatchQueue.main.async {
108
- Rownd.requestSignIn(with: RowndSignInHint.guest, signInOptions: rowndSignInOptions)
117
+ Rownd.requestSignIn(
118
+ with: RowndSignInHint.guest, signInOptions: rowndSignInOptions)
109
119
  }
110
120
  case "passkey":
111
121
  DispatchQueue.main.async {
112
- Rownd.requestSignIn(with: RowndSignInHint.passkey, signInOptions: rowndSignInOptions)
122
+ Rownd.requestSignIn(
123
+ with: RowndSignInHint.passkey, signInOptions: rowndSignInOptions)
113
124
  }
114
125
  default:
115
126
  requestSignInHub()
@@ -120,24 +131,27 @@ class RowndPlugin: NSObject {
120
131
  }
121
132
 
122
133
  @objc
123
- func signOut() -> Void {
134
+ func signOut() {
124
135
  DispatchQueue.main.async {
125
136
  Rownd.signOut()
126
137
  }
127
138
  }
128
139
 
129
140
  @objc
130
- func manageAccount() -> Void {
141
+ func manageAccount() {
131
142
  DispatchQueue.main.async {
132
143
  Rownd.manageAccount()
133
144
  }
134
145
  }
135
146
 
136
147
  @objc(getAccessToken:withResolver:withRejecter:)
137
- func getAccessToken(token: String?, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
148
+ func getAccessToken(
149
+ token: String?, resolve: @escaping RCTPromiseResolveBlock,
150
+ reject: @escaping RCTPromiseRejectBlock
151
+ ) {
138
152
  Task {
139
153
  do {
140
- var accessToken: String?
154
+ var accessToken: String?
141
155
  if let token = token {
142
156
  accessToken = try await Rownd.getAccessToken(token: token)
143
157
  } else {
@@ -145,49 +159,52 @@ class RowndPlugin: NSObject {
145
159
  }
146
160
  resolve(accessToken ?? "")
147
161
  } catch {
148
- reject("Error","\(error)",error)
162
+ reject("Error", "\(error)", error)
149
163
  }
150
164
  }
151
165
  }
152
-
166
+
153
167
  @objc(getFirebaseIdToken:withRejecter:)
154
- func getFirebaseIdToken(resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
168
+ func getFirebaseIdToken(
169
+ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock
170
+ ) {
155
171
  Task {
156
172
  do {
157
173
  let idToken = try await Rownd.firebase.getIdToken()
158
174
  resolve(idToken)
159
175
  } catch {
160
- reject("Error","\(error)",error)
176
+ reject("Error", "\(error)", error)
161
177
  }
162
178
  }
163
179
  }
164
180
 
165
181
  @objc(setUserData:)
166
- func setUserData(data: Dictionary<String, Any>) -> Void {
182
+ func setUserData(data: [String: Any]) {
167
183
  do {
168
- let jsonData = try JSONSerialization.data(withJSONObject: data, options: .prettyPrinted)
169
- let decoder = JSONDecoder()
170
- let dictionary = try! decoder.decode([String: AnyCodable].self, from: jsonData)
171
-
172
- Rownd.user.set(data: dictionary)
184
+ // Convert to JSON and back to get proper types
185
+ let jsonData = try JSONSerialization.data(withJSONObject: data, options: [])
186
+ let jsonObject = try JSONSerialization.jsonObject(with: jsonData, options: [])
187
+
188
+ // Try to cast to the expected type
189
+ if let dictionary = jsonObject as? [String: Any] {
190
+ // Convert each value to AnyCodable and set individually
191
+ for (key, value) in dictionary {
192
+ Rownd.user.set(field: key, value: AnyCodable(value))
193
+ }
194
+ }
173
195
  } catch {
174
- print("FAILED TO SET USER DATA: ",error)
196
+ print("FAILED TO SET USER DATA: ", error)
175
197
  }
176
198
  }
177
199
 
178
200
  @objc(setUserDataValue:withValue:)
179
- func setUserDataValue(key: String, value: Any) -> Void {
180
- let json = """
181
- "\(value)"
182
- """.data(using: .utf8)!
183
-
184
- let decoder = JSONDecoder()
185
- let dictionary = try! decoder.decode(AnyCodable.self, from: json)
186
- Rownd.user.set(field: key, value: dictionary)
201
+ func setUserDataValue(key: String, value: Any) {
202
+ // Convert value to AnyCodable
203
+ Rownd.user.set(field: key, value: AnyCodable(value))
187
204
  }
188
205
 
189
206
  @objc(handleSignInLink:)
190
- func handleSignInLink(url: String) -> Void {
191
- Rownd.handleSignInLink(url: URL(string: url))
207
+ func handleSignInLink(url: String) {
208
+ Rownd.handleSmartLink(url: URL(string: url))
192
209
  }
193
210
  }
@@ -0,0 +1,173 @@
1
+ {
2
+ "name": "@rownd/react-native",
3
+ "version": "0.2.5",
4
+ "description": "Rownd bindings for React Native",
5
+ "private": false,
6
+ "main": "lib/commonjs/index",
7
+ "module": "lib/module/index",
8
+ "types": "lib/typescript/src/index.d.ts",
9
+ "react-native": "src/index",
10
+ "source": "src/index",
11
+ "files": [
12
+ "src",
13
+ "lib",
14
+ "android",
15
+ "ios",
16
+ "cpp",
17
+ "package.json",
18
+ "react-native.podspec",
19
+ "!lib/typescript/example",
20
+ "!android/build",
21
+ "!ios/build",
22
+ "!**/__tests__",
23
+ "!**/__fixtures__",
24
+ "!**/__mocks__"
25
+ ],
26
+ "scripts": {
27
+ "test": "jest",
28
+ "typescript": "tsc --noEmit",
29
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
30
+ "prepare": "bob build && cp package.json lib/",
31
+ "release": "release-it",
32
+ "example": "yarn --cwd example",
33
+ "pods": "cd example && pod-install --quiet",
34
+ "bootstrap": "yarn example && yarn && yarn pods"
35
+ },
36
+ "keywords": [
37
+ "react-native",
38
+ "ios",
39
+ "android"
40
+ ],
41
+ "repository": "https://github.com/rownd/react-native",
42
+ "author": "Matt Hamann <mhamann@rownd.io> (https://github.com/rownd)",
43
+ "license": "MIT",
44
+ "bugs": {
45
+ "url": "https://github.com/rownd/react-native/issues"
46
+ },
47
+ "homepage": "https://github.com/rownd/react-native#readme",
48
+ "publishConfig": {
49
+ "registry": "https://registry.npmjs.org/",
50
+ "access": "public"
51
+ },
52
+ "devDependencies": {
53
+ "@commitlint/config-conventional": "^11.0.0",
54
+ "@react-native-community/eslint-config": "^2.0.0",
55
+ "@release-it/conventional-changelog": "^2.0.0",
56
+ "@types/date-fns": "^2.6.0",
57
+ "@types/debounce": "^1.2.1",
58
+ "@types/jest": "^26.0.0",
59
+ "@types/lodash-es": "^4.17.6",
60
+ "@types/phone": "^2.4.1",
61
+ "@types/react": "^17.0.2",
62
+ "@types/react-native": "^0.67.8",
63
+ "@types/react-native-base64": "^0.2.0",
64
+ "commitlint": "^11.0.0",
65
+ "eslint": "^7.2.0",
66
+ "eslint-config-prettier": "^7.0.0",
67
+ "eslint-plugin-prettier": "^3.1.3",
68
+ "husky": "^6.0.0",
69
+ "jest": "^26.0.1",
70
+ "pod-install": "^0.1.0",
71
+ "prettier": "^2.0.5",
72
+ "react": "^17.0.2",
73
+ "react-native": "^0.68.2",
74
+ "react-native-builder-bob": "^0.18.0",
75
+ "release-it": "^14.2.2",
76
+ "typescript": "^4.1.3"
77
+ },
78
+ "peerDependencies": {
79
+ "@gorhom/bottom-sheet": "*",
80
+ "@react-native-clipboard/clipboard": "*",
81
+ "react": "*",
82
+ "react-native": "*",
83
+ "react-native-device-info": "*",
84
+ "react-native-mmkv": "*",
85
+ "react-native-sha256": "*",
86
+ "react-native-svg": "*"
87
+ },
88
+ "jest": {
89
+ "preset": "react-native",
90
+ "modulePathIgnorePatterns": [
91
+ "<rootDir>/example/node_modules",
92
+ "<rootDir>/lib/"
93
+ ]
94
+ },
95
+ "commitlint": {
96
+ "extends": [
97
+ "@commitlint/config-conventional"
98
+ ]
99
+ },
100
+ "release-it": {
101
+ "git": {
102
+ "commitMessage": "chore: release ${version}",
103
+ "tagName": "v${version}"
104
+ },
105
+ "npm": {
106
+ "publish": true
107
+ },
108
+ "github": {
109
+ "release": true
110
+ },
111
+ "plugins": {
112
+ "@release-it/conventional-changelog": {
113
+ "preset": "angular"
114
+ }
115
+ }
116
+ },
117
+ "eslintConfig": {
118
+ "root": true,
119
+ "extends": [
120
+ "@react-native-community",
121
+ "prettier"
122
+ ],
123
+ "rules": {
124
+ "prettier/prettier": [
125
+ "error",
126
+ {
127
+ "quoteProps": "consistent",
128
+ "singleQuote": true,
129
+ "tabWidth": 2,
130
+ "trailingComma": "es5",
131
+ "useTabs": false
132
+ }
133
+ ]
134
+ }
135
+ },
136
+ "eslintIgnore": [
137
+ "node_modules/",
138
+ "lib/"
139
+ ],
140
+ "prettier": {
141
+ "quoteProps": "consistent",
142
+ "singleQuote": true,
143
+ "tabWidth": 2,
144
+ "trailingComma": "es5",
145
+ "useTabs": false
146
+ },
147
+ "react-native-builder-bob": {
148
+ "source": "src",
149
+ "output": "lib",
150
+ "targets": [
151
+ "commonjs",
152
+ "module",
153
+ [
154
+ "typescript",
155
+ {
156
+ "project": "tsconfig.build.json"
157
+ }
158
+ ]
159
+ ]
160
+ },
161
+ "dependencies": {
162
+ "@react-native-picker/picker": "^2.4.1",
163
+ "date-fns": "^2.28.0",
164
+ "debounce": "^1.2.1",
165
+ "eventemitter3": "^4.0.7",
166
+ "jwt-decode": "^3.1.2",
167
+ "ky": "^0.30.0",
168
+ "lodash-es": "^4.17.21",
169
+ "phone": "^3.1.20",
170
+ "react-native-base64": "^0.2.1",
171
+ "usehooks-ts": "^2.5.4"
172
+ }
173
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rownd/react-native",
3
- "version": "3.2.2",
3
+ "version": "3.4.0",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -17,7 +17,8 @@ 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", "~> 3.8.0"
20
+ s.dependency "Rownd", "~> 3.14.2"
21
+ s.dependency "lottie-ios", "~> 4.3.3"
21
22
 
22
23
  # Don't install the dependencies when we run `pod install` in the old architecture.
23
24
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then