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

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

When the device receives a push notification and a user clicks it, the system will pass the custom push content (JSON) to the app. This allows you to customize the behavior triggered by clicking the push notification according to the push content, such as page routing. When a push notification is received and clicked, the app obtains the push content as follows:

    * If `SceneDelegate` is used in the app, the app startup process is managed by the scene system. When you click the offline push message to open the app, the app will start the scene and then call the corresponding method in `SceneDelegate` to handle the connection and configuration of the scene. Check the `connectionOptions` parameter in the `scene ( _ : willConnectTo:options:)` method of `SceneDelegate` to get the push content. The sample code is as follows:

      ```objc
      - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions {
          // Get the startup options
          NSDictionary *launchOptions = connectionOptions.notificationResponse.notification.request.content.userInfo;
          // Perform corresponding processing
          // ...
      }
      ```

    * If `SceneDelegate` is not used in the app, the system will pass the user-defined information in the push to the app through `launchOptions` in the `application:didFinishLaunchingWithOptions:` method. Check the `launchOptions` parameter to get the push content.

      ```objc
      - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
            NSDictionary *userInfo = launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey];
        }
      ```

    The data structure of the user-defined `userInfo` is as follows:

    ```json
    {
        "aps":{
            "alert":{
                "body" : "You have a new message"
            },
            "badge":1,
            "sound":"default"
        },
        "f":"6001",
        "t":"6006",
        "g":"1421300621769",
        "m":"373360335316321408"
    }
    ```

    | Parameter | Description                                              |
    | :-------- | :------------------------------------------------------- |
    | `body`    | The push content.                                        |
    | `badge`   | The badge.                                               |
    | `sound`   | The ringtone.                                            |
    | `f`       | The message sender ID.                                   |
    | `t`       | The message recipient ID.                                |
    | `g`       | The group ID. This field exists only for group messages. |
    | `m`       | The message ID.                                          |

    
  
      
  
      
  
      
  
      
  
      
  
