Plugin Directory

Changeset 2834534


Ignore:
Timestamp:
12/15/2022 03:26:11 PM (3 years ago)
Author:
singhalavi
Message:

push notification fix

Location:
androapp/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • androapp/trunk/androapp.php

    r2820900 r2834534  
    55            Description: Native mobile app for android platform, create a beautiful mobile app for your wordpress blog with Push Notifications / Deep Linking / Monetization Option / Infinite Scroll / Fast Image Rendering / Inbuilt Whatsapp/facebook and other sharing channels / Customize Design  /Live preview / Test on your phone features. Get Started with your app in minutes at no cost for the first month and $60/year (reduced from $150/year) from next year onwards. We do not touch your existing mobile/desktop themes.
    66            Author: Genius Fools
    7             Version: 25.02
     7            Version: 25.03
    88            Author URI: http://www.geniusfools.com/
    99            Text Domain: androapp
  • androapp/trunk/androapp_functions.php

    r2691691 r2834534  
    160160           
    161161            // Sending push notification only for a new post, new page or any custom post_types
    162             if($post->post_type == "post" || $post->post_type == "page" || in_array($this->custom_post_types, $post->post_type)){
     162            if($post->post_type == "post" || $post->post_type == "page" || in_array($post->post_type, $this->custom_post_types)){
    163163                if (($old_status != 'publish') &&  ($new_status == 'publish') &&
    164164                        ($this->isValidPostType($post->post_type))){
     
    194194            }else if(class_exists('WP_REST_Posts_Controller')){
    195195                $wp_server_posts = new WP_REST_Posts_Controller($postType);
    196                 $request = array();
     196                $request = new WP_REST_Request();
    197197                $request['id'] = $postid;
    198198                $response =  $wp_server_posts->get_item($request);   
  • androapp/trunk/androapp_tools.php

    r2691691 r2834534  
    3333                        //TODO: handle page
    3434                        $wp_server_posts = new WP_REST_Posts_Controller($postdata->post_type);
    35                         $request = array();
     35                        $request =  new WP_REST_Request();
    3636                        $request['id'] = $postid;
    3737                        $response =  $wp_server_posts->get_item($request);   
  • androapp/trunk/class-pw-wp-posts.php

    r2820900 r2834534  
    180180                if($postdata){
    181181                    $wp_server_posts = new WP_REST_Posts_Controller($postdata->post_type);
    182                     $request = array();
     182                    $request =  new WP_REST_Request();
    183183                    $request['id'] = $postId;
    184184                    return $wp_server_posts->get_item($request);   
  • androapp/trunk/gcm/send_message.php

    r2553965 r2834534  
    99 //sendPushNotification(array("post_id" => "5716", "notification_type" => "stack"), "YOUR_GCM_API_KEY");
    1010 function sendPushNotification($message, $google_api_key, $isBulk, $firebaseApiVersion, $firebaseServiceAccountFilePath){
    11     if(empty($google_api_key)){
     11    if(empty($google_api_key) && $firebaseApiVersion != "v1"){
    1212        echo "Key Empty";
    1313        return;
     
    6969            updateStats($title, $eligible, $bulkSent, $success, $notRegistered, $mismatchsenderid,
    7070                    $otherError, 'BULK_IOS_START',$id, $iossent, $iosbulkSent, $ioseligible, $iosNotRegistered);
    71             $gcmResult = $gcm->send_notification_ios_topic("allIOS", $message, $google_api_key, null);
    72             echo ($gcmResult);
    73 
    74             if(isBulkSentSuccessful(json_decode($gcmResult))){
    75                 $iosbulkSent += $ioseligible;           
    76             }
     71           
    7772            updateStats($title, $eligible, $bulkSent, $success, $notRegistered, $mismatchsenderid,
    7873                    $otherError, 'BULK_IOS_END',$id, $iossent, $iosbulkSent, $ioseligible, $iosNotRegistered);
     
    151146            foreach($outArray as $regIds){
    152147                //echo "Sending ".count($regIds) ." notifications";
    153                 if($deviceType == 'IOS'){
    154                     $gcmResult = $gcm->send_notification_ios($regIds, $message, $google_api_key);
    155                    
    156                     echo  "ios results = ".$gcmResult;
    157                    
    158                     updateCounts(json_decode($gcmResult), $iossent, $iosNotRegistered, $mismatchsenderid,
    159                         $otherError, $remove_ids, $primaryIdsArr[$i] );
    160                    
    161                 }else{
     148                {
    162149                    $gcmResult = $gcm->send_notification($regIds, $message, $google_api_key,
    163150                            $firebaseApiVersion, $firebaseServiceAccountFilePath);
  • androapp/trunk/readme.txt

    r2820900 r2834534  
    55Requires at least: 3.3
    66Tested up to: 6.1.1
    7 Stable tag: 25.02
     7Stable tag: 25.03
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    140140
    141141== Changelog ==
     142= 25.03 =
     1431. Fix for push notification not working for new installs. All backend changes no need to create new apk.
    142144= 25.02 =
    1431451. Minor fix for category links, to make it compatible for wordpress 6.1.1.
     
    459461
    460462== Upgrade Notice ==
     463= 25.03 =
     464Fix for push notification not working for new installs. All backend changes no need to create new apk.
    461465= 25.02 =
    462466Minor fix for category links, to make it compatible for wordpress 6.1.1.
Note: See TracChangeset for help on using the changeset viewer.