Plugin Directory

Changeset 2524739


Ignore:
Timestamp:
05/02/2021 01:34:05 AM (5 years ago)
Author:
dprogrammer
Message:

Inclusion of the sound field

Location:
fcm-push-notification-from-wp/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • fcm-push-notification-from-wp/trunk/fcm-dp-admin-panel.php

    r2236783 r2524739  
    3737                <td style="width: 30%"><label for="fcmdpplgpn_topic"><?php echo esc_attr(__("Topic Configured in Application",FCMDPPLGPN_TRANSLATION));?></label> </td>
    3838                <td style="width: 70%"><input id="fcmdpplgpn_topic" placeholder="Name of Topic setup in application" name="fcmdpplgpn_topic" type="text" value="<?php echo esc_attr(get_option( 'fcmdpplgpn_topic' ));  ?>" required="required" style="width: 50%" /></td>
     39            </tr>
     40
     41            <tr style="width: 100%; height: 50px;">
     42                <td style="width: 30%"><label for="fcmdpplgpn_sound"><?php echo esc_attr(__("Notification Sound",FCMDPPLGPN_TRANSLATION));?></label> </td>
     43                <td style="width: 70%"><input id="fcmdpplgpn_sound" placeholder="Name of Notification Sound" name="fcmdpplgpn_sound" type="text" value="<?php echo esc_attr(get_option( 'fcmdpplgpn_sound' ));  ?>" required="required" style="width: 50%" /></td>
    3944            </tr>
    4045
  • fcm-push-notification-from-wp/trunk/fcm-dp-push-notification.php

    r2482520 r2524739  
    33Plugin Name:FCM Push Notification from WP
    44Description:Notify your app users using Firebase Cloud Messaging (FCM) when content is published or updated
    5 Version:1.6.0
     5Version:1.7.0
    66Author:dprogrammer
    77Author URI:https://dprogrammer.net
     
    244244        register_setting('fcmdpplgpn_group', 'fcmdpplgpn_default_image');
    245245
     246        /* 30/04/2021 - Included notification sound setting */
     247        register_setting('fcmdpplgpn_group', 'fcmdpplgpn_sound');
     248
    246249        /* set checkboxs post types */
    247250        $args  = array(
     
    307310        $content = preg_replace( '/\[(\/?(' . implode( '|', $shotcodes_tags ) . ').*?(?=\]))\]/', ' ', $content );
    308311
     312        //$content = strip_tags( do_shortcode( esc_html(wp_strip_all_tags(preg_replace( "/\r|\n/", " ", $post->post_content))) ) );
    309313        $resume = esc_attr($post->post_excerpt);
    310314        //$post_url = esc_url($post->post_url);
     
    325329            $image = get_option('fcmdpplgpn_default_image');
    326330        }
     331
     332        //$this->write_log('post Id: ' . $post_id);
    327333
    328334        /*
     
    333339        $this->write_log('image: ' . $image);
    334340        */
     341
     342        /* 30/04/2021 - Included notification sound setting */
     343        $sound =  esc_attr(get_option('fcmdpplgpn_sound'));
     344       
    335345
    336346        $topic =  esc_attr(get_option('fcmdpplgpn_topic'));
     
    358368            'dialog_text'           => _mb_strlen($resume) == 0 ? _mb_substr(wp_strip_all_tags($content), 0, 100) . '...' : $resume,
    359369            'dialog_image'          => $image,
    360         );
     370            'sound'                 => _mb_strlen($sound) == 0 ? 'default' : $sound,
     371        );
     372
     373        //$this->write_log('sound field: ' . $sound);
     374        //$this->write_log('sound: ' . (_mb_strlen($sound) == 0 ? 'default' : $sound));       
    361375
    362376        $notification = array(
     
    366380            'android_channel_id'    => get_option('fcmdpplgpn_channel'),
    367381            'click_action'          => 'FLUTTER_NOTIFICATION_CLICK',
    368             'sound'                 => 'default',
     382            'sound'                 => _mb_strlen($sound) == 0 ? 'default' : $sound,
    369383            'image'                 => $image,
    370384        );
  • fcm-push-notification-from-wp/trunk/readme.txt

    r2482520 r2524739  
    44Tags: fcm, firebase, push, notification, android, ios, flutter
    55Requires at least: 4.6
    6 Tested up to: 5.6.2
     6Tested up to: 5.7.1
    77Stable tag: 1.0
    88Requires PHP: 5.6.20
     
    9090= 1.6.0 =
    9191* Included routine to remove visual composer tags from page and post text.
     92
     93= 1.7.0 =
     94* Included the Sound field in the configuration. If empty, the name of the sound will be "default".
Note: See TracChangeset for help on using the changeset viewer.