Notifications in IOS don't show data

Please provide the following:

  1. SDK Version:38
  2. Platforms(IOS):

Dear, good morning

I am having a problem with notifications on IOS.

Following even the example of the link
https://docs.expo.io/push-notifications/receiving-notifications/

I cannot get the notifications in IOS to show me what I send in the data parameter, in Android I have no problem.

It happens both for notifications when the application is in the foreground and for notifications when the application is closed and I touch on it.

Any ideas?

I am using version 0.5.0 of expo-notifications

Thank you in advance.

Hey @deck2k, can you share the code you’ve written that handles the notification listeners?

Cheers,
Adam

Dears, i find the error.

The code for Listener is ,


Notifications.addNotificationResponseReceivedListener(this._handleNotificationResponse);

in the Function this._handleNotificationResponse the code is (code with fix)

_handleNotificationResponse = response => {
if (Platform.OS == “android”)
{
this.AbrirAlerta(response.notification.request.content.data) // here call to own function “AbrirAlerta”//
}
else
{
this.AbrirAlerta(response.notification.request.content.data.body) //here, add body to data attribute in case of IoS!"
}
};

As you can see, both platforms handle the way they receive information differently, in “IoS” there is one more object.

Is correct this or is a bug?

Thnks!

Yeah, this is the current expected behavior.

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