Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

How do we get a push alert title to show up on Apple Watch

$
0
0

We have a few apps out in the wild and we are using the REST API to push out alerts, I have tried adding title and alertTitle to the payload of the array that goes to Appcelerator service and I have gotten the alerts to go out and get to it's intended iOS device, BUT the title does NOT show up for the alert on the watch.

So I am using PHP to send the request here is the data array:

$message_ary = array(
    'channel' => 'test',
    'message_data' => array (
        "alert"=> 'Testing message',
        "vibrate" => true,
        "icon" => "notification_icon",
        "title" => "My Test",
        'alertTitle' => "My Test",
    )
);


    $curl_opt_data = array (
        'channel' => $message_ary['channel'],
        'to_tokens' => '*single iOS token',
        'payload' => json_encode($message_ary['message_data'])
    );

$url = "https://api.cloud.appcelerator.com/v1/push_notification/notify_tokens.json?key=" + $my_key;

    $ch = curl_init();
    $c_opt = array(CURLOPT_URL => $url,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_POST => 1,
        CURLOPT_POSTFIELDS  =>  $curl_opt_data,
        CURLOPT_FOLLOWLOCATION  =>  1,
        CURLOPT_TIMEOUT => 60);

curl_setopt_array($ch, $c_opt);

    $response = curl_exec($ch);

    curl_close($ch);

As I said I get the push alert just fine on the iOS device in question, but the paired Watch does not show that we have alert or if it does the title specified is NOT shown.

Any suggestions?


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>