# Parse push fields (/en/realtime-media/im/build/notifications-and-event-handling/offline-push/parse-push-fields/react-native)

> For AI agents: see the complete documentation index at [llms.txt](/llms.txt).

After receiving a push notification, you need to parse the data.

Rewrite the `FirebaseMessagingService.onMessageReceived` method to get a custom extension field in the `RemoteMessage` object. The sample code is as follows:

```typescript
messaging().onMessage(async (remoteMessage) => {
  console.log("A new FCM message arrived!", JSON.stringify(remoteMessage));
  // "t":"receiver",
  // "f":"fromUsername",
  // "m":"msg_id",
  // "g":"group_id",
  // "e":{}
});
```

| Parameter | Description                                              |
| --------- | -------------------------------------------------------- |
| `f`       | The user ID of the push notification sender.             |
| `t`       | The user ID of the push notification recipient.          |
| `m`       | The message ID: A unique identifier of the message.      |
| `g`       | The group ID: This field exists only for group messages. |
| `e`       | The user-defined extension field.                        |

`e` is a completely user-defined extension. The data source is `em_push_ext.custom` of the message extension. The data structure is as follows:

```json
{
    "em_push_ext": {
        "custom": {
            "key1": "value1",
            "key2": "value2"
        }
    }
}
```

The data structure of the extension in the `RemoteMessage` object is as follows:

```json
{
  "t": "receiver",
  "f": "fromUsername",
  "m": "msg_id",
  "g": "group_id",
  "e": {}
}
```

    
  
      
  
      
  
      
  
