Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Update receiving-messages.md #251

Open
wants to merge 1 commit into
base: v5.x.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/messaging/receiving-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ export default async (message: RemoteMessage) => {

### 3) Register the background handler

In your main `index.js` you need to register your background handler as follows:
In your main `index.js` you need to register your background handler before the main component as follows:

```js
import bgMessaging from './src/bgMessaging'; // <-- Import the file you created in (2)

// Current main application
AppRegistry.registerComponent('ReactNativeFirebaseDemo', () => bootstrap);
// New task registration
AppRegistry.registerHeadlessTask('RNFirebaseBackgroundMessage', () => bgMessaging); // <-- Add this line
// Current main application
AppRegistry.registerComponent('ReactNativeFirebaseDemo', () => bootstrap);
```

> The headless task must be registered as `RNFirebaseBackgroundMessage`.
Expand Down