Skip to content

Commit bfaa5ac

Browse files
committed
Fixes from CLAUDE.md
1 parent 6ea72fe commit bfaa5ac

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/pages/docs/push/getting-started/react-native.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func application(
140140
```
141141
</Code>
142142

143-
All further code can be added to `App.tsx`.
143+
Add all further code to `App.tsx`.
144144

145145
## Step 1: Set up Ably <a id="step-1"/>
146146

@@ -317,7 +317,7 @@ async function deactivatePush() {
317317

318318
The `transportType` is set to `fcm` on both platforms because `messaging().getToken()` always returns an FCM registration token, even on iOS. Firebase exchanges the APNs device token for an FCM token internally, so Ably communicates with Firebase rather than APNs directly (instead Firebase sends push notifications to iOS devices via APNs).
319319

320-
When `activatePush()` is called, it:
320+
`activatePush()` does the following:
321321

322322
1. Requests notification permission from the user.
323323
2. Obtains the FCM registration token from Firebase.
@@ -326,12 +326,12 @@ When `activatePush()` is called, it:
326326
After successful activation, `deviceId` contains the unique device ID assigned to this installation.
327327

328328
<Aside data-type='note'>
329-
On Android, `notifee.requestPermission()` is used instead of React Native's `PermissionsAndroid` because it handles the `POST_NOTIFICATIONS` permission consistently across Android API levels. On iOS, `messaging().requestPermission()` shows the system notification permission dialog Firebase Messaging calls the native iOS permission APIs internally.
329+
On Android, use `notifee.requestPermission()` instead of React Native's `PermissionsAndroid` because it handles the `POST_NOTIFICATIONS` permission consistently across Android API levels. On iOS, `messaging().requestPermission()` shows the system notification permission dialog; Firebase Messaging calls the native iOS permission APIs internally.
330330
</Aside>
331331

332332
## Step 3: Subscribe and test push notifications <a id="step-3"/>
333333

334-
Background push notifications are handled automatically by the FCM SDK and displayed as system notifications. For foreground handling, use `@notifee/react-native` to display notifications while the app is open.
334+
The FCM SDK handles background push notifications automatically and displays them as system notifications. For foreground handling, use `@notifee/react-native` to display notifications while the app is open.
335335

336336
Add the following foreground notification handler to `App.tsx`:
337337

@@ -392,8 +392,8 @@ async function unsubscribeFromChannel() {
392392
```
393393
</Code>
394394

395-
<Aside>
396-
Sending push notifications using `deviceId` or `clientId` requires the `push-admin` capability for your API key. Use this method for testing purposes. In a production environment, you would typically send push notifications from your backend server (by posting messages with a `push` `extras` field to a channel).
395+
<Aside data-type='note'>
396+
Sending push notifications using `deviceId` or `clientId` requires the `push-admin` capability for your API key. Use this method for testing purposes. In production, send push notifications from your backend server by publishing messages with a `push` `extras` field to a channel.
397397
</Aside>
398398

399399
Use the Ably CLI to send a test push notification to your client ID:
@@ -421,7 +421,7 @@ To send push notifications via a channel, you first need a UI to subscribe to th
421421

422422
## Step 4: Build the UI <a id="step-4"/>
423423

424-
Update the `return` statement in `App.tsx` to add buttons that wire up all the push functions:
424+
Update the `return` statement in `App.tsx` to add buttons that call all the push functions:
425425

426426
<Code>
427427
```react
@@ -505,13 +505,13 @@ ably channels publish exampleChannel1 '{"name":"example","data":"Hello from CLI!
505505
```
506506
</Code>
507507

508-
If you tap **Unsubscribe from Channel**, you will no longer receive push notifications for that channel. Send the same command again and verify that no notification is received.
508+
If you tap **Unsubscribe from Channel**, the device no longer receives push notifications for that channel. Send the same command again and verify that no notification is received.
509509

510510
You can also send push notifications directly from your app. The next step shows you how.
511511

512512
## Step 5: Send push with code <a id="step-5"/>
513513

514-
Just as you can send push notifications through the Ably CLI or dashboard, you can also send them directly from your app using `deviceId` (or `clientId`), or channel publishing methods. For channel publishing, you don't need the admin capabilities for your API key.
514+
You can send push notifications directly from your app using `deviceId`, `clientId`, or channel publishing. Channel publishing does not require the `push-admin` capability.
515515

516516
Add the following functions to `App.tsx`:
517517

@@ -550,7 +550,7 @@ async function sendPushToClient() {
550550
```
551551
</Code>
552552

553-
Sending to a channel is just publishing a message on a channel with a `push` `extras` field:
553+
To send to a channel, publish a message with a `push` `extras` field:
554554

555555
<Code>
556556
```react

0 commit comments

Comments
 (0)