I'm already impressed by how easy pushwoosh was to get setup and working through all my services, however, I'm having one issue while implementing pushwoosh into my web back-end.
Like a lot of people, I use composer so handle my PHP packages and to have one easy and central place to keep packages stored and require them from. I came across PHP-Pushwoosh and have been messing around with it for the better part of today and have managed to successfully send push notifications from it, however, whenever I try to include a condition into the Notification class, it stops working.
I don't expect anyone to have experience with this, but I hope some of you can help. What I've done is defining the classes I need to use at the top of my file:
Then I set up the pushwoosh php client:
$pushwoosh = Pushwoosh::create();
Finally I create the request:
$notification = Notification::create()
$request = CreateMessageRequest::create()->addNotification($notification);
$resp = $pushwoosh->createMessage($request);
If I remove the "->addCondition ..." part of $notification, it works fine and it sends the push notification, however, the moment I add in addCondition(), it breaks and tells me that the first argument of the addNotification class needs to be an instance of \Notification\Notification but null is given.
This is confusing to me because while looking at the source, this should be working alright.
Any help would be appreciated.
I'm basically trying to replicate this post request I made in Postman:
"content": "This is a simple push notification test message",
"conditions": [["kommune", "IN", ["grane", "vefsn"]]]