Plugin Directory

Changeset 738342


Ignore:
Timestamp:
07/09/2013 04:10:05 PM (13 years ago)
Author:
dtsolis
Message:

version 1.0.1 update

Location:
simple-parse-push-service/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • simple-parse-push-service/trunk/pushFunctionality.php

    r737931 r738342  
    11<?php
    22
    3 function sendPushNotification($AppID, $RestApiKey, $AlertMessage, $Badge)
     3function sendPushNotification($AppID, $RestApiKey, $AlertMessage, $Badge, $postID = null)
    44{
    5     $url = 'https://api.parse.com/1/push';
     5    $url = 'https://api.parse.com/1/push/';
    66    $data = array(
    77        'channel' => '',
     
    1515    if (get_option('simpar_enableSound') == 'true') {
    1616        $data['data']['sound'] = "";
     17    }
     18    if ($postID != null) {
     19        $data['data']['post_id'] = $postID;
    1720    }
    1821
     
    3033    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    3134    curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
     35    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    3236    $result = curl_exec($curl);
     37    if ($result === FALSE) {
     38        die(curl_error($curl));
     39    }
     40    curl_close($curl);
    3341   
    3442    return $result;
  • simple-parse-push-service/trunk/readme.txt

    r737931 r738342  
    44Tags: parse, push notification, push, notification, mobile, smartphonem, send
    55Requires at least: 3.3
    6 Tested up to: 3.5.1
    7 Stable tag: 1.0
     6Tested up to: 3.5.2
     7Stable tag: 1.0.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1414
    1515This 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.
     16You 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.
    1717
    1818In order to use this plugin you MUST have an account with Parse.com and cURL ENABLED.
     
    4040== Changelog ==
    4141
     42= 1.0.1 =
     43* Bug fix
     44* Ability to include post's id as extra parameter
     45
    4246= 1.0 =
    4347* Auto-send Push Notification through parse.com service with every post publish
  • simple-parse-push-service/trunk/simpar_import_admin.php

    r737931 r738342  
    1919        else
    2020            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');
    2129
    2230
     
    5361        if (get_option('simpar_enableSound') == 'true')
    5462            $sppsEnableSound = ' checked="checked"';
     63
     64        $sppsIncludePostID = '';
     65        if (get_option('simpar_includePostID') == 'true')
     66            $sppsIncludePostID = ' checked="checked"';
    5567    } 
    5668
     
    103115            <input type="checkbox" name="simpar_saveLastMessage" <?php echo $sppsSaveLastMessage; ?> > Remember last used message in posts
    104116        </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>
    105120     
    106121        <p class="submit"> 
  • simple-parse-push-service/trunk/simpleParsePS.php

    r737938 r738342  
    22/**
    33 * @package Simple_Parse_Push_Service
    4  * @version 1.0
     4 * @version 1.0.1
    55 */
    66/*
     
    99Description: 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.
    1010Author: Tsolis Dimitris - Sotiris
    11 Version: 1.0
     11Version: 1.0.1
    1212Author URI:
    1313License: GPLv2 or later
     
    1515*/
    1616
    17 if (!defined('SPPS_VERSION')) define('SPPS_VERSION', '1.0');
     17if (!defined('SPPS_VERSION')) define('SPPS_VERSION', '1.0.1');
    1818
    1919/////////////////////////////////////////////////////////
     
    6666    }
    6767
     68    $includePostIDChecked  = '';
     69    if (get_option('simpar_includePostID') == 'true') {
     70        $includePostIDChecked  = ' checked="checked"';
     71    }
     72
    6873    echo '<label for="simpar_pushText">';
    6974        _e("Alert Message", 'simpar_context');
     
    7782
    7883    echo '<input id="simpar_titleCheckBox" type="checkbox" name="simpar_titleCheckBox"'.$checked.'>&nbsp;Send title as message.<br/><br/>';
     84    echo '<input id="simpar_includePostIDCheckBox" type="checkbox" name="simpar_includePostIDCheckBox"'.$includePostIDChecked.'>&nbsp;Include postID as extra param.<br/><br/>';
    7985
    8086    echo '<label for="simpar_activate">';
     
    100106        $message = html_entity_decode(get_the_title($post_ID),ENT_QUOTES,'UTF-8');
    101107    }
     108
     109    $incPostID = null;
     110    if (isset($_POST['simpar_includePostIDCheckBox']))
     111        $incPostID = $post_ID;
    102112   
    103113    $badge = $_REQUEST['simpar_pushBadge'];
    104114    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);
    106116
    107117
     
    132142    delete_option('simpar_enableSound');
    133143    delete_option('simpar_lastMessage');
     144    delete_option('simpar_includePostID');
    134145 
    135146    /*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.