Answer the question
In order to leave comments, you need to log in
How to work with IOS push notification API correctly?
Hello, I'm trying to send push notifications to an ios app.
It turned out something like this code:
<?php
if(defined('CURL_HTTP_VERSION_2_0')){
$device_token = '3abe4507a7bca21aec0c115b06b6798d78fd55100a4898bf3c969c0a3f799466';
$apns_topic = 'your apns topic. Can be your app bundle ID';
$sample_alert = '{"aps":{"alert":"hi","sound":"default"}}';
$url = "https://api.development.push.apple.com:443/3/device/3abe4507a7bca21aec0c115b06b6798d78fd55100a4898bf3c969c0a3f799466";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
var_dump($response);
}
?>
Answer the question
In order to leave comments, you need to log in
Try like this - https://github.com/ArtamonovDenis/Artamonov.push
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question