PushMessage

constructor(extras: Bundle)

Creates a PushMessage from a push notification payload Bundle.

This constructor is used internally by the SDK to create PushMessage instances from FCM/HMS push payloads. You typically don't need to call this constructor directly - PushMessage instances are automatically created and passed to your NotificationServiceExtension callback methods. Example:


  // Advanced use case: Creating PushMessage from saved Bundle
  public void reprocessSavedNotification() {
      SharedPreferences prefs = getSharedPreferences("app", MODE_PRIVATE);
      String bundleString = prefs.getString("saved_notification", null);

      if (bundleString != null) {
          // Reconstruct bundle and create PushMessage
          Bundle bundle = bundleFromString(bundleString);
          PushMessage message = new PushMessage(bundle);

          // Process the saved notification
          processNotification(message);
      }
  }

Parameters

extras

Bundle containing the push notification payload from FCM/HMS

See also