Changeset 738342
- Timestamp:
- 07/09/2013 04:10:05 PM (13 years ago)
- Location:
- simple-parse-push-service/trunk
- Files:
-
- 4 edited
-
pushFunctionality.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
-
simpar_import_admin.php (modified) (3 diffs)
-
simpleParsePS.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simple-parse-push-service/trunk/pushFunctionality.php
r737931 r738342 1 1 <?php 2 2 3 function sendPushNotification($AppID, $RestApiKey, $AlertMessage, $Badge )3 function sendPushNotification($AppID, $RestApiKey, $AlertMessage, $Badge, $postID = null) 4 4 { 5 $url = 'https://api.parse.com/1/push ';5 $url = 'https://api.parse.com/1/push/'; 6 6 $data = array( 7 7 'channel' => '', … … 15 15 if (get_option('simpar_enableSound') == 'true') { 16 16 $data['data']['sound'] = ""; 17 } 18 if ($postID != null) { 19 $data['data']['post_id'] = $postID; 17 20 } 18 21 … … 30 33 curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); 31 34 curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); 35 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); 32 36 $result = curl_exec($curl); 37 if ($result === FALSE) { 38 die(curl_error($curl)); 39 } 40 curl_close($curl); 33 41 34 42 return $result; -
simple-parse-push-service/trunk/readme.txt
r737931 r738342 4 4 Tags: parse, push notification, push, notification, mobile, smartphonem, send 5 5 Requires at least: 3.3 6 Tested up to: 3.5. 17 Stable tag: 1.0 6 Tested up to: 3.5.2 7 Stable tag: 1.0.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 14 14 15 15 This is a simple implementation for Parse.com Push Service (for iOS, Android, Windows 8 or any other devices may add). 16 You can send a push notification via admin panel or with a post update/creation. 16 You can send a push notification via admin panel or with a post update/creation. In addition, you can include post's id as extra parameter to use it as you want with your mobile app. 17 17 18 18 In order to use this plugin you MUST have an account with Parse.com and cURL ENABLED. … … 40 40 == Changelog == 41 41 42 = 1.0.1 = 43 * Bug fix 44 * Ability to include post's id as extra parameter 45 42 46 = 1.0 = 43 47 * Auto-send Push Notification through parse.com service with every post publish -
simple-parse-push-service/trunk/simpar_import_admin.php
r737931 r738342 19 19 else 20 20 update_option('simpar_autoSendTitle', 'false'); 21 22 $sppsIncludePostID = ''; 23 if (isset($_POST['simpar_includePostID'])) { 24 update_option('simpar_includePostID', 'true'); 25 $sppsIncludePostID = ' checked="checked"'; 26 } 27 else 28 update_option('simpar_includePostID', 'false'); 21 29 22 30 … … 53 61 if (get_option('simpar_enableSound') == 'true') 54 62 $sppsEnableSound = ' checked="checked"'; 63 64 $sppsIncludePostID = ''; 65 if (get_option('simpar_includePostID') == 'true') 66 $sppsIncludePostID = ' checked="checked"'; 55 67 } 56 68 … … 103 115 <input type="checkbox" name="simpar_saveLastMessage" <?php echo $sppsSaveLastMessage; ?> > Remember last used message in posts 104 116 </p> 117 <p> 118 <input type="checkbox" name="simpar_includePostID" <?php echo $sppsIncludePostID; ?> > Auto include post_ID as extra parameter (you' ll find it in json payload with "post_id" dict name) 119 </p> 105 120 106 121 <p class="submit"> -
simple-parse-push-service/trunk/simpleParsePS.php
r737938 r738342 2 2 /** 3 3 * @package Simple_Parse_Push_Service 4 * @version 1.0 4 * @version 1.0.1 5 5 */ 6 6 /* … … 9 9 Description: This is a simple implementation for Parse.com Push Service (for iOS, Android, Windows 8 or any other devices may add). You can send a push notification via admin panel or with a post update/creation. In order to use this plugin you MUST have an account with Parse.com and cURL ENABLED. 10 10 Author: Tsolis Dimitris - Sotiris 11 Version: 1.0 11 Version: 1.0.1 12 12 Author URI: 13 13 License: GPLv2 or later … … 15 15 */ 16 16 17 if (!defined('SPPS_VERSION')) define('SPPS_VERSION', '1.0 ');17 if (!defined('SPPS_VERSION')) define('SPPS_VERSION', '1.0.1'); 18 18 19 19 ///////////////////////////////////////////////////////// … … 66 66 } 67 67 68 $includePostIDChecked = ''; 69 if (get_option('simpar_includePostID') == 'true') { 70 $includePostIDChecked = ' checked="checked"'; 71 } 72 68 73 echo '<label for="simpar_pushText">'; 69 74 _e("Alert Message", 'simpar_context'); … … 77 82 78 83 echo '<input id="simpar_titleCheckBox" type="checkbox" name="simpar_titleCheckBox"'.$checked.'> Send title as message.<br/><br/>'; 84 echo '<input id="simpar_includePostIDCheckBox" type="checkbox" name="simpar_includePostIDCheckBox"'.$includePostIDChecked.'> Include postID as extra param.<br/><br/>'; 79 85 80 86 echo '<label for="simpar_activate">'; … … 100 106 $message = html_entity_decode(get_the_title($post_ID),ENT_QUOTES,'UTF-8'); 101 107 } 108 109 $incPostID = null; 110 if (isset($_POST['simpar_includePostIDCheckBox'])) 111 $incPostID = $post_ID; 102 112 103 113 $badge = $_REQUEST['simpar_pushBadge']; 104 114 include('pushFunctionality.php'); 105 sendPushNotification(get_option('simpar_appID'), get_option('simpar_restApi'), $message, $badge );115 sendPushNotification(get_option('simpar_appID'), get_option('simpar_restApi'), $message, $badge, $incPostID); 106 116 107 117 … … 132 142 delete_option('simpar_enableSound'); 133 143 delete_option('simpar_lastMessage'); 144 delete_option('simpar_includePostID'); 134 145 135 146 /*Remove any other options you may add in this plugin and clear any plugin cron jobs */
Note: See TracChangeset
for help on using the changeset viewer.