i using laravel push notification library, pushing notification. however, can easly responses gcm responses android device. unable apns response.
$message = pushnotification::message("new messages",$params['payload']); $collection = pushnotification::app('appnameios') ->to($params['reg_id']) ->send($message); foreach ($collection->pushmanager $push) { $response = $push->getadapter()->getresponse(); }
make sure have followed proper format below:-
//ios app pushnotification::app(['environment' => 'development', 'certificate' => '/path/to/certificate.pem', 'passphrase' => 'password', 'service' => 'apns']); $devices = pushnotification::devicecollection(array( pushnotification::device('token', array('badge' => 5)), pushnotification::device('token1', array('badge' => 1)), pushnotification::device('token2') )); $message = pushnotification::message('message text',array( 'badge' => 1, 'sound' => 'example.aiff', 'actionlockey' => 'action button title!', 'lockey' => 'localized key', 'locargs' => array( 'localized args', 'localized args', ), 'launchimage' => 'image.jpg', 'custom' => array('custom data' => array( 'we' => 'want', 'send app' )) )); $collection = pushnotification::app('appnameios') ->to($devices) ->send($message); // response each device push foreach ($collection->pushmanager $push) { $response = $push->getadapter()->getresponse(); }
Comments
Post a Comment