braze-react-native-sdk icon indicating copy to clipboard operation
braze-react-native-sdk copied to clipboard

[Bug]: PushNotificationEvent.timestamp is both seconds and milliseconds depending on the OS

Open Bee-Su opened this issue 8 months ago • 1 comments

Which Platforms?

Both

Which React Native Version?

0.76.7

Which @braze/react-native-sdk SDK version?

12.2.0

Repro Rate

100%

Steps To Reproduce

Example:

  1. import BrazeSDK from "@braze/react-native-sdk".
  2. Add a listener for Braze push notification events
BrazeSDK.addListener(
      BrazeSDK.Events.PUSH_NOTIFICATION_EVENT,
      (pushNotificationEvent) => {
        console.log(pushNotificationEvent.timestamp);
      },
);
  1. Run the app and send a test notification

Expected Behavior

Both Android and iOS should have the same time unit for the PushNotificationEvent.timestamp. They should both be in seconds or both be in milliseconds.

Actual Incorrect Behavior

  1. Android: pushNotificationEvent.timestamp is the number of milliseconds since 1970
  2. iOS: pushNotificationEvent.timestamp is the number of seconds since 1970

Verbose Logs


Additional Information

No response

Bee-Su avatar Mar 03 '25 17:03 Bee-Su