Skip to content

Commit 170b74b

Browse files
author
romin-halltari
committed
Update readme
1 parent 2c46874 commit 170b74b

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

packages/@magic-sdk/react-native-bare/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,17 @@ When attempting to import `Magic`, take note that the React Native metro bundler
8686
For this issue consider using Microsoft's [rnx-kit](https://microsoft.github.io/rnx-kit/docs/guides/bundling) suite of tools that include a plugin for metro that fixes this symlink related error.
8787

8888
### Handling internet connection problems
89+
When an app is opened without internet connection, any request to the Magic SDK will result in a rejection with the following error:
90+
91+
```json
92+
{
93+
"code": -32603,
94+
"message": "Connection to Magic SDK not ready. Please check your internet connection."
95+
}
96+
```
97+
98+
It is good practice to use [@react-native-community/netinfo](https://www.npmjs.com/package/@react-native-community/netinfo) to track the internet connection state of the device. For your convenience, we've also added a hook that uses this library behind the scenes:
8999

90-
When the app has internet connectivity issues, the relayer might behave in ways you don't expect. That is why it is important to use [@react-native-community/netinfo](https://www.npmjs.com/package/@react-native-community/netinfo) to track the internet connection state of the device, and refresh your UI when the connection is re-established. For your convenience, we've also added a hook that uses this library behind the scenes:
91100

92101
```tsx
93102
import { useInternetConnection } from '@magic-sdk/react-native-expo';

packages/@magic-sdk/react-native-expo/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,17 @@ When attempting to import `Magic`, take note that the React Native metro bundler
7777
For this issue consider using Microsoft's [rnx-kit](https://microsoft.github.io/rnx-kit/docs/guides/bundling) suite of tools that include a plugin for metro that fixes this symlink related error.
7878

7979
### Handling internet connection problems
80+
When an app is opened without internet connection, any request to the Magic SDK will result in a rejection with the following error:
81+
82+
```json
83+
{
84+
"code": -32603,
85+
"message": "Connection to Magic SDK not ready. Please check your internet connection."
86+
}
87+
```
88+
89+
It is good practice to use [@react-native-community/netinfo](https://www.npmjs.com/package/@react-native-community/netinfo) to track the internet connection state of the device. For your convenience, we've also added a hook that uses this library behind the scenes:
8090

81-
When the app has internet connectivity issues, the relayer might behave in ways you don't expect. That is why it is important to use [@react-native-community/netinfo](https://www.npmjs.com/package/@react-native-community/netinfo) to track the internet connection state of the device, and refresh your UI when the connection is re-established. For your convenience, we've also added a hook that uses this library behind the scenes:
8291

8392
```tsx
8493
import { useInternetConnection } from '@magic-sdk/react-native-expo';

0 commit comments

Comments
 (0)