Edujugon / PushNotification

PHP and Laravel Package to send push notifications to Android and IOS devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ErrorException in Gcm.php line 112:

chekolasnergee opened this issue · comments

trying to send push and got error, any idea why?

"Use of undefined constant ARRAY_FILTER_USE_KEY - assumed 'ARRAY_FILTER_USE_KEY'"

$push->setMessage([ "notification" => [ "title" => $me->name, "body" => $message, ], "data" => [ "user_id" => 1, "chat_room_id" => 2, "text" => $message, "name" => $me->name, "time" => "momend ago", ] ]) ->setApiKey('api-key') ->setDevicesToken($token) ->send() ->getFeedback();

@sevenrequest
What php version are you using?

@sevenrequest
Please, be sure that you have PHP 5.6.0 or higher.

@sevenrequest
Since I'm not getting any response from your end and it is not an issue related to this package, I'm closing this ticket.

Anyway, If you need any further help, let me know and I'll reopen it.

Soory for late response,

Too bad My server using php 5.5.9, may be that was causing it
I'll try talking to server admin to upgrade if possible

Thank you,

@sevenrequest
Hi,

I've been checking that error you were facing and I could update the code to make it works for php versions minor than 5.6.

Let me do the changes and I'll update you once done. :)

@sevenrequest
Hi,

I've created a new branch which support php 5.5 version.
In order to use that branch, please update your composer.json file like follows:

Before -> "edujugon/push-notification": "2.1.*"

After -> "edujugon/push-notification": "dev-php_5.5"

Have a try and let me know if that worked for you.

@sevenrequest
Hi,
Any update from your side?

@sevenrequest
Hi,

I'm closing this issue since it has been fixed as commented in my previous messages.

If that update didn't work for you, let me know and I'll reopen this issue.