I have a problem and cant seem to find a solution. My PHP API code works and I can send messages via the PHP API but whenever I try to add a platform with this line: ->addPlatform(Platform::ios()) there is an error.
Below is my code snippet:
$request = CreateMessageRequest::create(); $notification = Notification::create(); $notification->setContent('Hello World!'); $notification->addPlatform(Platform::ios());
In my PHP I get this error:
Fatal error: Class 'Platform' not found in /blah/blah.php on line 20
Has the addPlatform(Platform::device()) syntax changed by any chance or what could be the problem? Everything else works so far. I would be grateful if anyone can help me with this problem.
Thanks in advance!
Please sign in to leave a comment.