@jiffer wrote:
Hi all,
I'm trying to send push notifications to android and iphone.
I have 2 site from where i send them from. Both have the same piece of code for sending them.
But on 1 site they fail and i get a 102 error as failure reason in the android area (see code). If i send a notifications through the ionic push testing they all succed.Message ID of error: 24ebd76ab54811e59e32f2bfcbd4ee03
I send them with PHP/Symfony/Guzzle
Code for sending notifications:
foreach($aDevices as $aDevice) $aUserIds[] = $aDevice->getUserId(); $aData = array('android' => array('title' => 'Nieuwe kandidatuur', 'alert' => 'Kijk snel!'), 'ios' => array('title' => 'Kijk snel', 'alert' => 'Nieuwe kandidatuur')); $oGuzzle = new GuzzleHttp\Client(); $oResponse = $oGuzzle->post(sfConfig::get('app_Ionic_push_link'), [ 'auth' => [sfConfig::get('app_Ionic_push_username')], 'headers' => ['Content-Type' => 'application/json' , 'X-Ionic-Application-Id' => sfConfig::get('app_Ionic_application_id')], 'json' => ['tokens' => $aUserIds, 'notification' => $aData, 'production' => true] ])->json();
If you need more info, tell me!
Thanks!
Posts: 1
Participants: 1