norkunas / onesignal-php-api

OneSignal API for PHP
MIT License
233 stars 82 forks source link

Notifications getAll() offset > 50 #64

Closed raduca-adrian closed 7 years ago

raduca-adrian commented 7 years ago

Hi,

It seems that when I try to take all notifications using getAll() the offset can not go above 50 as the condition: max(0, min(self::NOTIFICATIONS_LIMIT, filter_var($offset, FILTER_VALIDATE_INT))) always evaluates to 50 for offset values > 50.

norkunas commented 7 years ago

Hello @raduca-adrian,

That's because this is the max limit which onesignal allows. For reference see here.

raduca-adrian commented 7 years ago

Yes, but that limit refers to the number of results returned in a request, not to the offset. Using a combination of offset and limit you should be able to retrieve all notifications for an application, but in the current state, where offset can not go over 50, the results you can get is max 100, although you may have more notifications.

norkunas commented 7 years ago

Thank you for finding this @raduca-adrian, should be good now.

raduca-adrian commented 7 years ago

You're welcome! Cheers!