Payload error while using PHP to update live tiles windows phone 8 -


i'm having problems updating live tiles using php via push notifications. normal toast message there wasn't error. when tried using same coding, , change phone target notification class. got payload error. here's source code, , wondering if did wrong.

thanks!

<?php    if( isset($_post['push_action']) && $_post['push_action'] == "1") {    $tilemessage = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" .                 "<wp:notification xmlns:wp=\"wpnotification\">" .                    "<wp:tile>" .                     "<wp:backgroundimage>" . $_post["push_msg0"] .  "</wp:backgroundimage>" +                     "<wp:count>" . $_post["push_msg1"] . "</wp:count>" +                     "<wp:title>" . $_post["push_msg2"] . "</wp:title>" +                     "<wp:backbackgroundimage>" . $_post["push_msg3"] . "</wp:backbackgroundimage>" +                     "<wp:backtitle>" . $_post["push_msg4"] . "</wp:backtitle>" +                     "<wp:backcontent>" . $_post["push_msg5"] . "</wp:backcontent>" +                  "</wp:tile> " .               "</wp:notification>";        // create request send     $r = curl_init();     curl_setopt($r, curlopt_url, $_post["push_uri"]);     curl_setopt($r, curlopt_returntransfer, 1);     curl_setopt($r, curlopt_post, true);     curl_setopt($ch, curlopt_header, true);       // add headers     $httpheaders=array('content-type: text/xml; charset=utf-8', 'x-windowsphone-target: token',                     'accept: application/*', 'x-notificationclass: 1','content-length:'.strlen($tilemessage));     curl_setopt($r, curlopt_httpheader, $httpheaders);      // add message     curl_setopt($r, curlopt_postfields, $tilemessage);      // execute request     $output = curl_exec($r);     curl_close($r); }   ?>    <form method="post" action="push2.php"> <h3>push through php</h3> <input type="text" name="push_uri" id="push_uri" placeholder="push uri" style="width:50%;padding:5px;" autofocus required/> <br><br> <input type="text" name="push_msg0" id="push_msg0" placeholder="background image"  style="width:50%;padding:5px;" required/> <br><br> <input type="text" name="push_msg1" id="push_msg1" placeholder="count"  style="width:50%;padding:5px;" required/> <br><br> <input type="text" name="push_msg2" id="push_msg2" placeholder="title"  style="width:50%;padding:5px;" required/> <br><br> <input type="text" name="push_msg3" id="push_msg3" placeholder="back background image"  style="width:50%;padding:5px;" required/> <br><br> <input type="text" name="push_msg4" id="push_msg4" placeholder="back title"  style="width:50%;padding:5px;" required/> <br><br> <input type="text" name="push_msg5" id="push_msg5" placeholder="back content"  style="width:50%;padding:5px;" required/> <br><br> <input type="hidden" name="push_action" value="1" />   <input type="submit" value="push" style="width:50%;padding:5px;"/> 

apparently missed out version=2.0, tile id & tile template caused not work. here's updated 2 lines, after able update tiles via push notifications.

"<wp:notification xmlns:wp=\"wpnotification\" version=\"2.0\">" "<wp:tile id=\"/mainpage.xaml?name=flip\" template=\"fliptile\">" 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -