Edujugon / PushNotification

PHP and Laravel Package to send push notifications to Android and IOS devices.
MIT License
478 stars 159 forks source link

deviceToken array fails if deviceToken not found #6

Closed dantaylorseo closed 8 years ago

dantaylorseo commented 8 years ago

I have the following:

        $push->setDevicesToken(
            [
                '507e3adaf433ae3e6234f35c82f8a43ad0d84218bff08f16ea7be0869f066c03',
                '507e3adaf433ae3e6234f35c82f8a43ad0d84218bff08f16ea7be0869f066c04',
                '507e3adaf433ae3e6234f35c82f8a43ad0d84218bff08f16ea7be0869f066c03',

            ]);

The script only sends the first one (which is a correct deviceToken, I have purposely changed the middle one). If you change the loop in Apn.php it works. Is it valid to write more than one device token at a time to Apple?

If all three are the same, i.e none fail it shows 3 times, which is correct.

Edujugon commented 8 years ago

So what you mean is if you set 3 tokens and the middle one is incorrect, it only works till finding the incorrect one so in this sample, the first one would be the only one which got the notification.

Did I understand your point?

dantaylorseo commented 8 years ago

Yes that's right

Edujugon commented 8 years ago

Could I use the above device tokens for testing purposes? The first and the last one are correct tokens, right?

dantaylorseo commented 8 years ago

Yes - and I see you have :) 1 recieved

Edujugon commented 8 years ago

This issue has been fixed from the last release v2.1.3. you may refer to the commits if required 2439928ac89d73f42414fcb9b0583cfdaa63bb15 6114369f05f93691b462e6d9090f133d532aac5d