@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 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
- <h1>Welcome {user.data.first_name}</h1>
112
- <button onClick={() => getAccessToken()}>Get access token</button>
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
- withResolver:(RCTPromiseResolveBlock)resolve)
21
+ RCT_EXTERN_METHOD(getAccessToken:(RCTPromiseResolveBlock)resolve
22
+ withRejecter:(RCTPromiseRejectBlock)reject)
23
23
 
24
24
  RCT_EXTERN_METHOD(handleSignInLink:(NSString *)url)
25
25
 
@@ -107,14 +107,16 @@ class RowndPlugin: NSObject {
107
107
  }
108
108
  }
109
109
 
110
- @objc(getAccessToken:withResolver:)
111
- func getAccessToken(resolve: @escaping RCTPromiseResolveBlock) async -> Void {
112
- do {
113
- let accessToken = try await Rownd.getAccessToken()
114
- resolve(accessToken)
115
- } catch {
116
- print("Failed to fetch Rownd access token")
117
- resolve("")
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rownd/react-native",
3
- "version": "2.7.1",
3
+ "version": "2.8.0",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -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.1.0"
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