Push Notification: Data object fields order

Hi to everybody,
I’m sending a push notification with the following body:

  "to": "ExponentPushToken[xxxxxxxx]",
  "sound": "default",
  "body": "Usuario Nuevo",
"data" : {"Titulo":"Nuevo Usuario", "Datos": [{"Nombre" : "Maribel", "Apellido" : "Mai", "Perfil" : "Admin","E-mail" : "maribel@lalala.com.ar"}]}}]

I expect to receive the data object with the fields on the same order I sent. But I’m receiving:

{"remote":true,"isMultiple":false,"notificationId":-111111122222,"data":{"Datos":[{"Nombre":"Maribel","Perfil":"Admin","E-mail":"maribel@lalala.com.ar","Apellido":"Mai"}],"Titulo":"Nuevo Usuario"},"origin":"received"}

Thank you in advance,

i think you’re referring to “Titulo” and “Datos” appearing in reverse order in the data object, right? if so, this is to be expected. you can’t depend on the order of js objects. if the order matters to you, you should use an array

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.