YieldStudio / laravel-expo-notifier

Easily manage Expo notifications with Laravel. Support batched notifications.
MIT License
29 stars 11 forks source link

Data not being seen when opening notification in an app #27

Closed Brune04 closed 4 months ago

Brune04 commented 5 months ago

Here's what I have in the expo_notifications table:

{
    "to": [
        "ExponentPushToken[XXXXXXXXXXXXXX]"
    ],
    "ttl": null,
    "body": "Test body",
    "data": "{\"type\":\"test\",\"}",
    "badge": 1,
    "sound": "default",
    "title": "Test Title",
    "priority": "default",
    "subtitle": null,
    "channelId": "default",
    "mutableContent": false
}

Whenever I go to https://expo.dev/notifications to test the notification and copy and paste everything including the data into the fields there, I get a notification on my app and it recognizes the data type of test. But whenever I send that notification via php artisan expo:notifications:send and try to open the notification in my app, it doesn't recognize the data type of test. I'm kind of lost as to why this is happening

Brune04 commented 5 months ago

Looks like the issue is with shouldBatch. If I remove shouldBatch and I just send the notification without it being put into the expo_notifications table, then the app recognizes the data type of test.

JamesHemery commented 5 months ago

@joemugen @dtangdev