Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "wns.php";
- $mode = $_GET["mode"];
- $channel = base64_decode($_GET["channel"]);
- $body = file_get_contents('php://input');
- $xml = simplexml_load_string($body);
- file_put_contents("log.txt", $body . "\n\n", FILE_APPEND | LOCK_EX);
- //file_put_contents("log.txt", $channel . "\n\n", FILE_APPEND | LOCK_EX);
- $text2 = $xml->xpath('//wp:Text2');
- $param = $xml->xpath('//wp:Param');
- if ($text2 != null && $param != null)
- {
- list($user, $message) = explode(":", $text2[0], 2);
- $param = substr($param[0], 17);
- parse_str($param, $arguments);
- $uid = $arguments["uid"];
- $tid = $arguments["unified_tid"];
- if ($mode == "lite")
- $header = '<toast activationType="protocol" launch="fbmessenger://user?recipientId='. $uid .'">';
- else
- $header = '<toast>';
- $xml = $header .
- ' <audio src="ms-appx:///Assets/Sounds/locationOn.wav"/>'.
- ' <visual>'.
- ' <binding template="ToastGeneric">'.
- ' <image placement="appLogoOverride" src="http://graph.facebook.com/'. $uid .'/picture?type=square"/>'.
- ' <text>'. $user .'</text>'.
- ' <text>'. $message .'</text>'.
- ' </binding>'.
- ' </visual>'.
- ' <actions>'.
- ' <input id="UserId" type="text" defaultInput="'. $uid .'" hint-visible="false" />'.
- ' <input id="ThreadId" type="text" defaultInput="'. $tid .'" hint-visible="false" />'.
- ' <input id="QuickMessage" type="text" placeholderContent="Type a message..." />'.
- ' <action activationType="background" arguments="QuickReply" hint-inputId="QuickMessage" content="" imageUri="ms-appx:///Assets/Toast/QuickReply.png"/>'.
- ' <action activationType="background" arguments="QuickLike" content="Like" imageUri="ms-appx:///Assets/Toast/QuickLike.png"/>'.
- ' <action activationType="background" arguments="QuickMute" content="Mute" imageUri=""/>'.
- ' </actions>'.
- '</toast>';
- $notif = new WPN("suca", "suca");
- $result = $notif->post_push($channel, $xml, WPNTypesEnum::Toast);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement