@rownd/react-native 2.7.1 → 2.8.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.
- package/README.md +3 -3
- package/ios/RowndPlugin.m +2 -2
- package/ios/RowndPlugin.swift +10 -8
- package/package.json +1 -1
- package/rownd-react-native.podspec +1 -1
package/README.md
CHANGED
|
@@ -90,7 +90,7 @@ export default function Root() {
|
|
|
90
90
|
Later on within your app's components, you can use the Rownd hook to access the Rownd browser API:
|
|
91
91
|
|
|
92
92
|
```tsx
|
|
93
|
-
import { View, Text } from 'react-native';
|
|
93
|
+
import { View, Text, Pressable } from 'react-native';
|
|
94
94
|
import { useRownd } from '@rownd/react-native';
|
|
95
95
|
|
|
96
96
|
export default function MyProtectedComponent(props) {
|
|
@@ -108,8 +108,8 @@ export default function MyProtectedComponent(props) {
|
|
|
108
108
|
<View>
|
|
109
109
|
{is_authenticated ? (
|
|
110
110
|
<>
|
|
111
|
-
<
|
|
112
|
-
<
|
|
111
|
+
<Text>Welcome {user.data.first_name}</Text>
|
|
112
|
+
<Pressable onClick={() => getAccessToken()}><Text>Get access token</Text></Pressable>
|
|
113
113
|
</>
|
|
114
114
|
) : (
|
|
115
115
|
<>
|
package/ios/RowndPlugin.m
CHANGED
|
@@ -18,8 +18,8 @@ RCT_EXTERN_METHOD(signOut)
|
|
|
18
18
|
|
|
19
19
|
RCT_EXTERN_METHOD(manageAccount)
|
|
20
20
|
|
|
21
|
-
RCT_EXTERN_METHOD(getAccessToken:
|
|
22
|
-
|
|
21
|
+
RCT_EXTERN_METHOD(getAccessToken:(RCTPromiseResolveBlock)resolve
|
|
22
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
23
23
|
|
|
24
24
|
RCT_EXTERN_METHOD(handleSignInLink:(NSString *)url)
|
|
25
25
|
|
package/ios/RowndPlugin.swift
CHANGED
|
@@ -107,14 +107,16 @@ class RowndPlugin: NSObject {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
@objc(getAccessToken:
|
|
111
|
-
func getAccessToken(resolve: @escaping RCTPromiseResolveBlock)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
@objc(getAccessToken:withRejecter:)
|
|
111
|
+
func getAccessToken(_ resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) -> Void {
|
|
112
|
+
Task {
|
|
113
|
+
do {
|
|
114
|
+
let accessToken = try await Rownd.getAccessToken()
|
|
115
|
+
resolve(accessToken ?? "")
|
|
116
|
+
} catch {
|
|
117
|
+
print("Failed to fetch Rownd access token")
|
|
118
|
+
resolve("")
|
|
119
|
+
}
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
122
|
|
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", "~> 2.
|
|
20
|
+
s.dependency "Rownd", "~> 2.2.2"
|
|
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
|