Plugin Directory

Changeset 2685645


Ignore:
Timestamp:
02/27/2022 07:27:39 PM (4 years ago)
Author:
singhalavi
Message:

changes to fix auto push notification

Location:
androapp/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • androapp/trunk/androapp.php

    r2625625 r2685645  
    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: 23.02
     7            Version: 24.00
    88            Author URI: http://www.geniusfools.com/
    99            Text Domain: androapp
  • androapp/trunk/androapp_functions.php

    r2625620 r2685645  
    3434        add_filter( 'wp_footer',  array($this,'add_css_bottom') );
    3535        add_action( 'wp_json_server_before_serve', array($this,'myplugin_api_init'));
    36         add_action( 'send_push_notification_after_publish', array($this,'send_push_notification_after_publish'), 10, 10 );
     36        add_action( 'send_push_notification_after_publish', array($this,'send_push_notification_after_publish'), 12, 12 );
    3737        add_filter( 'the_content', array($this,'androapp_after_post_filter')  );
    3838        add_filter( 'the_content', array($this,'androapp_before_post_filter')  );
     
    231231   
    232232    function send_push_notification_after_publish($post_id, $post_title,
    233                  $excerpt, $postimage, $link, $cache, $postType,
     233                 $excerpt, $postimage, $postlink, $cache, $postType,
    234234                $google_api_key, $notification_type, $isBulkSend, $firebaseApiVersion,
    235235                $firebaseServiceAccountFilePath)
     
    794794        global $post;
    795795        $ogdesc = "";
    796         if (class_exists('WPSEO_Meta')){
     796        if (class_exists('WPSEO_Meta') && class_exists('WPSEO_Frontend')){
    797797            $ogdesc  = WPSEO_Meta::get_value( 'opengraph-description', $post_id );
    798798
  • androapp/trunk/androapp_tools.php

    r2553965 r2685645  
    1111                   
    1212        $postid = intval($_POST['selfpushoptions']);
     13                $pushnotificationtext = $_POST['pushnotificationtext'];
     14                echo "Push notification text ". $pushnotificationtext;
    1315        $disableBulkSend = $accountOptions[pw_mobile_app_settings::$disableBulkSend];   
    1416                $disableNotificationCache = $accountOptions[pw_mobile_app_settings::$disableNotificationCache];
     
    3739                    $excerpt = $wppost['excerpt']['rendered'];
    3840                }   
    39 
     41                if(!empty($pushnotificationtext)){
     42                    $excerpt = $pushnotificationtext;
     43                }
    4044                $postimage = $wppost['featuredimage'];
    4145                if(empty($postimage)){
     
    7680                                    $excerpt, $postimage, $postlink, $cache, $postType,
    7781                                    $accountOptions[ANDROAPP_GCM_API_KEY],
    78                                     !($disableBulkSend == 1),
     82                                    !($disableBulkSend == '1'),
    7983                                    $accountOptions[ANDROAPP_FIREBASE_API_VERSION],
    8084                                    $accountOptions[ANDROAPP_FIREBASE_SERVICE_ACCOUNT_FILE_PATH]
     
    97101<b><?php _e('Enter Post Id','androapp');?>: </b><input type="text" name="selfpushoptions" value="" placeholder="Enter Post Id"/>
    98102(<?php _e('please enter correct post id','androapp');?>)</br></br>
     103<!--
     104<b><?php _e('Push Notification Text','androapp');?>: </b><br/>
     105<textarea id="pushnotificationtext" name="pushnotificationtext" value="" placeholder="Message" rows="3" cols="40"></textarea><br/>
     106(<?php _e('please enter the text, this will be used instead of post excerpt','androapp');?>)</br></br>
     107-->
    99108<b><?php _e('Send Immediate','androapp');?>: </b><input type="checkbox" name="immediate" value="1"/> </br>
    100109<?php _e('By default notification is scheduled to go after 10 minutes, check this box to send push notification immediately, this might take some time depending on number of users and will show logs on this screen, your server might kill this request in middle depending on your server configuration, so we recommend not to select this option in general.',
     
    115124    echo '<table border="1px;" style="max-width:800px">';
    116125    echo "<tr><th>Post Id</th><th>Title</th><th>Excerpt</th><th>Image Link</th>"
    117     . "<th>Post Link</th><th>Cached on Device</th><th>Bulk Send</th> </tr>";
     126    . "<th>Post Link</th><th>Cached on Device</th><th>Bulk Send</th> <th>Firebase API Version</th></tr>";
    118127    $pushPostCount = 0;
    119128    foreach($crons as $key => $value){
     
    128137                    foreach ($v as $kk => $vv){
    129138                        foreach ($vv['args'] as $ka => $va){
    130                             if($ka > 5 && $ka < 9){
     139                            if($ka == 6 || $ka == 7 || $ka == 8 || $ka == 11){
    131140                                continue;
    132141                            }
  • androapp/trunk/pw_mobile_settings.php

    r2625620 r2685645  
    10171017
    10181018    function schedule_push_notification($id, $title, $excerpt, $postimage, $link, $cache, $postType, $key, $isBulkSent, $firebaseApiVersion, $firebaseServiceAccountFilePath){
     1019            //this calls send_push_notification_after_publish in androapp_functions.php
    10191020            wp_schedule_single_event( time()+ 10*15 , 'send_push_notification_after_publish',
    10201021                    array ($id, $title, $excerpt, $postimage, $link, $cache, $postType, $key , "stack", $isBulkSent, $firebaseApiVersion, $firebaseServiceAccountFilePath));
    1021     }
    1022    
    1023     function send_push_notification_after_publish($post_id, $post_title,
    1024                 $excerpt, $postimage, $postlink, $cache, $postType,
    1025                 $google_api_key, $notification_type, $isBulkSend, $firebaseApiVersion, $firebaseServiceAccountFilePath)
    1026     {
    1027         require_once PW_MOBILE_PATH.'gcm/send_message.php';
    1028         sendPushNotification(array("post_id" => $post_id, "title" => $post_title,
    1029                      "excerpt" =>$excerpt, "postImage" => $postimage, "link" => $postlink, "cache" => $cache,
    1030                     "postType" => $postType,
    1031                     "notification_type" => $notification_type), $google_api_key, $isBulkSend,
    1032                     $firebaseApiVersion, $firebaseServiceAccountFilePath);
    10331022    }
    10341023   
     
    12371226                <p style="color:red"><?php _e('Note: You need to publish new build everytime you change it','androapp');?></p>
    12381227                For Android App:<input type="text" name="<?php echo $this->account_tab_key."[".ANDROAPP_ANALYTICS_TRACKING_ID_KEY."]"?>" value="<?php echo $options[ANDROAPP_ANALYTICS_TRACKING_ID_KEY];?>"  />
    1239                                 </br>
    1240                                 For IOS App:<input type="text" name="<?php echo $this->account_tab_key."[".ANDROAPP_IOS_ANALYTICS_TRACKING_ID_KEY."]"?>" value="<?php echo $options[ANDROAPP_IOS_ANALYTICS_TRACKING_ID_KEY];?>"  />
    1241                
     1228                                </br>               
    12421229                                </td>
    12431230            </tr>
  • androapp/trunk/readme.txt

    r2625625 r2685645  
    44Tags: Android app, Mobile App, Native Mobile App, app for WordPress, mobile app plugin, native app plugin, push notifications, website to mobile app, WordPress app builder, WordPress app maker, WordPress blog app, androapp, deep linking
    55Requires at least: 3.3
    6 Tested up to: 5.8
    7 Stable tag: 23.02
     6Tested up to: 5.9.1
     7Stable tag: 24.00
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    140140
    141141== Changelog ==
     142= 24.00 =
     1431. Auto Push Notification fix, fixed issue in push notification on a new post.
    142144= 23.02 =
    143145Minor fix, no need to publish new apk.
     
    448450
    449451== Upgrade Notice ==
     452= 24.00 =
     453Auto Push Notification fix, fixed issue in push notification on a new post.
    450454= 23.02 =
    451455Minor fix, no need to publish new apk.
Note: See TracChangeset for help on using the changeset viewer.