Murali

Forum Replies Created

Viewing 20 posts - 1 through 20 (of 21 total)
  • Author
    Posts
  • #340
    Murali
    Keymaster

    Following is draft version of Flutter app with lib folder and pubspec.yaml file to communicate with WordPress backend in this push notification plugin to store subscribed push notification from native Flutter mobile app to WordPress database using this plugin. Using this subscribed tokens, whenever activities are published. WordPress will send push notifications to both website version as well as native android Flutter app which are using webview
    Flutter app files with lib folder and pubspec.yaml file

    #336
    Murali
    Keymaster

    For Flutter app Firebase configuration,
    In Firebase account, separate Android app needs to be created. It will create google-services.json, we need to store google-services.json in android->app folder in flutter app to get Firebase credentials for Android app using this file
    Similarly for Ios also.

    #334
    Murali
    Keymaster

    Please let me know your website or console message, I will check it. Please go to chrome browser application tab and service worker and check whether this file pnfpb_icpush_pwa_sw.js is active. You can also check this site muraliwebworld.com how this is configured in chrome browser or in edge browser or in firefox

    Please make sure Firebase configuration is correct as shown in plugin description

    Please let me the url your are facing i will check it.

    #333
    Murali
    Keymaster

    Finally, I am able to create and test draft Android version of Flutter app to integrate push notifications with WordPress Push notification for post and buddypress plugin as backend.

    Since it requires push notification subscription token to be sent to WordPress backend, I have created special REST api to communicate between Flutter app with WordPress as backend.

    I have attached links containing draft version of changed plugin (version 1.351) and Flutter app (only lib folder containing required code webview and others) to interact with WordPress as backend. You need to create Fresh Flutter app in Android studio and incorporate lib folder changes according to your requirement.

    In Firebase, separate Android app needs to be created. It will create google-services.json, we need to store google-services.json in android->app folder in flutter app to get Firebase credentials for Android app using this file

    Following are changes I made in this plugin (draft version attached)
    1. Generate secret key in mobile app tab to communicate between mobile app(in Integrate app api tab plugin settings)
    2. REST api to send subscription token from Mobile Flutter app using WebView to this WordPress plugin to store it in WordPress db to send push notification whenever new activities/post are published.

    Note:- All REST api code is already included in the code, below is only for reference as guide,

    REST API using POST method, to send push notification in secured way using AES 256 cryptography encryption method to avoid spams

    REST API url post method to send push notification
    https://domainname.com/wp-json/PNFPBpush/v1/subscriptiontoken

    Input parameters in body in http post method in Flutter APP,
    token – it should be encrypted as described below,

    Using secret key generated from step 1, enter secret key in flutter app code as below in push_notification_manager.dart file (attached link for lib folder),

    store token in global variable for other user
    Generate envrypted token as mentioned below using below coding (AES 256 cryptography encryption)
    Once plugin receives this token, it will unencrypt using the secret key generate and compare hash code to confirm it is sent from Flutter app

         String strPwd = "16234hgJKLmllpdcd09b2bc37293"; //secret key generated in step 1 above
    
          GlobalData.pushtoken = token.toString();
    
          final iv = EncryptPack.IV.fromLength(16);
    
          final key = EncryptPack.Key.fromUtf8(strPwd); //hardcode
    
          final encrypter = EncryptPack.Encrypter(EncryptPack.AES(key, mode: EncryptPack.AESMode.cbc));
    
          final encrypted = encrypter.encrypt(token.toString(), iv: iv);
    
          var hmacSha256 = CryptoPack.Hmac(CryptoPack.sha256,ConvertPack.utf8.encode(strPwd)); // HMAC-SHA256
    
          var hmacstring = hmacSha256.convert(ConvertPack.utf8.encode(token.toString()));
    
          var encryptedsubscription = encrypted.base64+":"+iv.base64+":"+hmacstring.toString()+":"+hmacstring.toString();

    Now token is stored in WordPress database. So, when new activities or post is published, you will get notification in flutter app also. Please note currently logic is included to notify only background push notification, when app is in background. For Foreground notification please add your custom logic under FirebaseMessaging.onMessage.listen in push_notification_manager.dart or if you tell how foreground notification needs to be displayed then i will include the logic later, at present when app is in foreground it will only print the message in the console. When app is background, you will get push notification.

    Now for group and shortcode notification, i have special code written in 2 way communications in web_view_container.dart to get group code and subscription option from wordpress to flutter app and then send updated subscription token to WordPress from flutter app.

    I have tested in Android device it is working.
    I have attached link containing updated plugin and Flutter app lib folder for your reference. Please note both are draft versions created for testing. Please test and modify according to your requirement

    By next week or in few days, i will publish in WordPress repository with this updated plugin containing API to communicate with native Flutter mobile app.

    Flutter app lib folder web view with push notification

    Updated-push-notification-for-post-buddypress-plugin-1.351 version

    Flutter app with lib folder and pubspec.yaml file

    Native mobile Fluttter app showing WordPress push notification

    • This reply was modified 3 months, 3 weeks ago by Murali.
    • This reply was modified 3 months, 3 weeks ago by Murali.
    • This reply was modified 3 months, 3 weeks ago by Murali.
    #325
    Murali
    Keymaster

    Yesterday I tried sample code in flutter with firebase code. Only challenge is, Firebase requires separate android and ios app in firebase console under same application. For WordPress push notification, we create web app inside firebase console, but for app it requires android/ios app in firebase-console. We need to use those app configuration in our app. Like for example android, we need to download google-services.json and place it in android app root folder (in app project), using this json file android app integrates with Firebase application and with corresponding android app in Firebase console under same application. Till now I tested Flutter app to firebase integration.
    I need to test whether subscription token taken from users in Flutter app (app screen webview) will be compatible to send push notifications from WordPress this plugin whenever new activity or post is published. I will update you once this is complete.
    If above android testing works, then I will give only flutter app with android configuration to you as i have only windows machine here and I do not have macos developer account. For IOS i can provide instruction then you can test it from your location for macos as it requires xcode , developer license from apple to publish IOS app.

    I will update you once Android app testing is complete.

    #323
    Murali
    Keymaster

    I will try to create demo for you using this website as webview in sample flutter project in few days
    Since i have not used flutter much, i am creating this demo anyway it will be useful for me in future also
    Another thing is, I also want to test push notification subscription using webview and receiving the push messages and to redirect user to specific page in webview when user clicks on push notification.
    I will create demo using my website muraliwebworld.com in webview flutter and i will let you know in few days.

    #321
    Murali
    Keymaster

    This notification works based on web push not based on app push. For apk, it requires separate app push to integrate with firebase, it requires separate coding to directly integrate with firebase from native app code not using web code. Web View in apk will work only with web push notification. For apk, it requires app push.

    #317
    Murali
    Keymaster

    Hi Miguel,
    1. I have not used buddyboss, I will let you know after seeing that plugin buddyboss.

    2. This is WordPress plugin for push notification PWA plugin to be used with WordPress BuddyPress for website in desktop, or mobile browser. If you need it for android app then it requires separate native code based on android app design, if android app design is using react native then this plugin cannot be used but integration of firebase logic will be same it needs to written under react native or reactjs. Or if android app is based on Kotlin/Java then it requires new code to be developed in same language.
    I have created 2 react native apps based on these function but this code is totally on react native platform using AWS dynamodb and AWS amplify but structure similar to WordPress BuddyPress. (I migrated from WordPress to react native platform using aws technologies). This app is in play store,
    https://play.google.com/store/apps/details?id=com.indiacities.indiacitiesforum

    Another app in play store
    https://play.google.com/store/apps/details?id=com.indiacities.chennaicommunityforum

    #311
    Murali
    Keymaster

    To use “Firebase integrate” plugin along with Push notification for post and Buddypress

    Use same Firebase app credentials used in this Push notification for post and Buddypress plugin for Firebase integrate plugin

    (If you get warning messages in console then please ignore as both plugins use same firebase core files)

    I have already tested this using Firebase integrate free version plugin

    Attached are below images
    Push notification for buddypress and firebase integrate plugin sync

    TO test Firebase email login using Firebase integrate plugin along with push notification for post and buddypress plugin using same firebase credentials

    • This reply was modified 4 months, 2 weeks ago by Murali.
    • This reply was modified 4 months, 2 weeks ago by Murali.
    • This reply was modified 4 months, 1 week ago by Murali.
    #304
    Murali
    Keymaster

    Category subcategory widget horizontal menu with icons New version 5.7 released today compatible upto latest version of WordPress 5.9 and compatible with Buddyx theme and other themes

    #293
    Murali
    Keymaster

    I have released 1.33 version in WordPress repository with new options in shortcode for various push notification as shown in attached image
    Subscribe to all notifications
    Subscribe notifications for new posts/Buddypress activities
    Subscribe notifications for comments on my posts/Buddypress activities
    Subscribe to all comments
    Unsubscribe to all notifications
    Push notification shortcode with various post and Buddypress subscribe options

    • This reply was modified 5 months ago by Murali.
    #217
    Murali
    Keymaster

    I am in process of developing and testing new design of subscription process with different options using shortcode.
    I have attached below screenshot showing subscription options in new design.
    Push notification Subscription options using WordPress Shortcode

    Subscribe to all notifications
    Subscribe notifications for new posts/Buddypress activities
    Subscribe notifications for comments on my posts/Buddypress activities
    Subscribe to all comments
    Unsubscribe to all notifications

    Once testing is complete then i will release it in to WordPress repository in few days

    #212
    Murali
    Keymaster

    I will redesign the shortcode button as follows,
    Once it is clicked, it will show form containing options with checkbox
    Subscribe to all notifications
    Subscribe notifications for new posts/Buddypress activities
    Subscribe notifications for comments on my posts/Buddypress activities
    Subscribe to all comments
    Unsubscribe to all notifications

    So that users can switch on/off according to their needs. If nothing is checked then no notifications will be sent and if user is subscribed already in browser (before activating shortcode) then by default subscribe to all notifications will be checked status they can switch off whenever they need it. I will update you once it is complete. It will take some days for me as i need to redesign the shortcode logic with these options and ui design

    Above form will appear underneath the button once it is clicked and once option is saved then it will disapper in the same. Currently it is shown as pop up dialog and i am going to redesign the form to appear in the same sidebar or where ever shortcode placed underneath the button instead of popup dialog so that it will be more friendly.

    • This reply was modified 5 months, 3 weeks ago by Murali.
    • This reply was modified 5 months, 3 weeks ago by Murali.
    #210
    Murali
    Keymaster

    I just want to ask one question, is it ok if I include that option in front end as shortcode, so that only front end users can subscribe to comments for their activities/post?

    #208
    Murali
    Keymaster

    I can add option in admin settings but problem will come to all users because some users will be more interested to get all notifications, some users only to their listings. So i think it cannot be option in backend admin setting but i am thinking to include it in front end option or as a shortcode so that users in website can subscribe according to their needs. At present if one new post/activity/topic/comments/custom post types published all users will get notified based on admin settings. If admin settings has option only to author of post then the site users which are currently used to get notifications to new post/buddypress new activity/bbpress new post/custom post types will not receive notifications for post other than their own post. Due to this i am thinking to add option in front end as shortcode or in their buddypress profile to subscribe to notification only for their activities or in otherway, i am thinking to add option to send notification only to author when they get comments/replies on their post/activity/topic/custom post types. I think it is better to add as option in frontend rather than backend admin option. If it is in front end different users can set their preferences in front end according to their needs. Still I am confused whether i can include that option as shortcode or in buddypress profile. If it is in new shortcode then users can subscribe to notification when some one commented on post/custompost types/buddypress….I will update you on this once I complete. Thank you.

    #177
    Murali
    Keymaster

    If you need Push notifications for my activities, my topic, my forum only then i will try to include it in future release enhancements, it will take some time to include it as enhancements in future release. Thank you. I will let you know once it is complete after 1 week.

    #176
    Murali
    Keymaster

    Activity notifications will be sent to all users for all activities. If you want to subscribe group notifications then please update in admin area to send for group notifications. Group notifications will be only sent to users who subscribed to particular group. Subscription of group notifications will be available for logged in users. Once they opt to subscribe notifications for particular group then device token along with group id will be added to database and notifications will be sent based device token and group id.

    #173
    Murali
    Keymaster

    In future, I am thinking to add facility for IOS push notification using custom app separately from our server like other push services. Since Firebase js sdk https://firebase.google.com/docs/web/environments-js-sdk#browsers , web push api did not support safari browser, we need to create custom push service from private server, we are planning to this in future.

    #171
    Murali
    Keymaster

    This plugin is designed using web push api using Firebase javascript.
    Ios is not supported for web push notification. Please verify this link from Firebase supported browsers https://firebase.google.com/docs/web/environments-js-sdk#browsers
    To integrate push notification using Apple Notification Service it requires custom app push notification using their own service using inbuilt web app/mobile app. Apple also requires apn certificate from ios developer account to integrate push notification using custom ios/macos app

    • This reply was modified 5 months, 4 weeks ago by Murali.
    #160
    Murali
    Keymaster

    If there is any issue due to nginx settings in your server, while access dynamic service worker generated by this plugin for push notification. Please browse https://domainname/pnfpb_icpush_pwa_sw.js if you get nginx 404 error then please update nginx settings in your server as shown in attached image file. Even for this website i have enabled nginx caching and i updated nginx settings like this. It is applicable only when you use VPS server with nginx cache settings and it cannot be updated in shared hosting.
    push notification service worker file nginx settings1
    push notification service worker file nginx settings2

    • This reply was modified 6 months ago by Murali.
    • This reply was modified 5 months, 4 weeks ago by Murali.
Viewing 20 posts - 1 through 20 (of 21 total)
Would you like to install our Progressive web app?

Would you like to install our Progressive web app?

Progressive Web App (PWA) is installed successfully. It will also work in offline