Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Web Push notifications using OneSignal Details »»
Web Push notifications using OneSignal
Version: 1.3.5, by iA1 iA1 is offline
Developer Last Online: Jul 2023 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 4.2.x Rating:
Released: 07-10-2018 Last Update: 05-06-2019 Installs: 33
Supported Uses Plugins
Re-useable Code Additional Files Translations  

Description:

OneSignal has an API that allows us to send unlimited web and push notifications for FREE. When I came to know about it, I spent several days and months searching for compatible plugins for vB4. Finally decided to learn and create my own based on pierce's similar mod for Xenforo.

Push notifications is a great way to keep your members engaged. It keeps driving them back to your site. This mod works great on mobile browsers as well.

This is the lite version which allows you to send web push notifications to your users whenever:
  1. someone replies on their subscribed threads
  2. sends them a PM
  3. likes one of their posts (dbtech thanks)

Installation:
  1. Register an account at OneSignal.com
    • Click on Add a new app to register your forum there
    • Select Web Push as the platform
    • Configure Web Push by selecting Typical Site and enter you forum details
    • Add at least one prompt and complete the remaining setup there. Leave most of the options as default. Only change where necessary.
    • After you click Save, you will get a few files to download.
    • Download those files, extract them and upload them to your forum's root directory.
    • There is another section on the same page asking you to add code to your site. DO NOT add that code yet. It is automatically done when you install this product.
  2. Download attached zip file. Upload the file functions_OneSignal.php under /includes directory
  3. Install the product using the xml file
  4. Go back to onesignal.com, under settings, click on Keys & IDs.
  5. Copy these keys and paste them in the settings in admincp.


Disclaimer:
I am not associated with onesignal in any way. This is just something that I found useful for my forum and wanted to share with everyone else.

If I get enough support then I plan to add notifications for moderators' actions and for quotes and tags as well.


Download latest version: 1.3.5
If upgrading from previous version, replace the functions file as well.

Change log:
1.3.5 - Typo fixed
1.3.0 - Separated multiple consecutive notifications for different threads
1.2.0 - Added privacy for replies in private sections and
Subscribe button at the end of posts
1.1.0 - Fixed issue with sub-forum
1.0.1 - Fixed Table Prefix bug
1.0.0 - Initial Release

Download Now

File Type: zip OneSignal_webpush_1.1.0.zip (5.6 KB, 23 views)
File Type: zip OneSignal_webpush_vB4_1.2.0.zip (5.9 KB, 24 views)
File Type: zip OneSignal_webpush_1.3.0.zip (6.1 KB, 26 views)
File Type: zip OneSignal_webpush_1.3.5.zip (5.9 KB, 98 views)

Supporters / CoAuthors

    Show Your Support

    • This modification may not be copied, reproduced or published elsewhere without author's permission.
    3 благодарности(ей) от:
    Budget101, carik, louva-a-Deus

    Comments
      #42  
    Old 12-18-2018, 02:55 PM
    gnrx gnrx is offline
     
    Join Date: Apr 2009
    Posts: 390
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Quote:
    Originally Posted by iA1 View Post
    If you get notification as shown in screenshot in post #2
    https://vbulletin.org/forum/showpost...89&postcount=2 then it is working fine.
    The notifications are not inside the bell. It is actually browser notification. On desktop as well as on smartphone.
    Hi iA1,
    Yes, I received notification as shown in the screenshot of post 2 of the link that you indicate, then, its working fine.
    I was think that, the notification is in the bell (I don't know for what reasson I was think this).

    The notifications like your screenshot appears well.

    Like Advanced User Tagging also have Desktop Notifications, I was think wrong about bell notifications.

    Thank you very much for your detailed and attention reply.

    Again, thank you very much!!
    Reply With Quote
      #43  
    Old 12-19-2018, 06:03 PM
    khalled khalled is offline
     
    Join Date: Apr 2007
    Posts: 147
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    i install the product from two days and till now i don't get any automatic notification ,

    N.B i add Keys & IDs. to the product , also i can send notification manually from OneSignal website and run vBulletin® Version 4.2.5
    Reply With Quote
      #44  
    Old 12-19-2018, 08:01 PM
    iA1 iA1 is offline
     
    Join Date: Jul 2018
    Posts: 150
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Quote:
    Originally Posted by khalled View Post
    i install the product from two days and till now i don't get any automatic notification ,

    N.B i add Keys & IDs. to the product , also i can send notification manually from OneSignal website and run vBulletin? Version 4.2.5
    To get support, please mark as installed and send the link of your forum by PM.
    Reply With Quote
      #45  
    Old 12-22-2018, 12:36 PM
    gnrx gnrx is offline
     
    Join Date: Apr 2009
    Posts: 390
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Today, I view I have the same problem:
    Quote:
    Originally Posted by Cable_Player View Post
    Hi, I've followed your instructions exactly, but notifications to subscribe are not showing.
    I'm just running a test board at the moment to see the capabilities of the software and it is located at
    Code:
     https://www.mydomain.com/forum
    In the settings on OneSignal it does not allow me to enter that location, only
    Code:
    https://www.mydomain.com
    - could this be the reason it isn't showing?
    Thanks.
    Also, My forum ints a: https://www.myforum.com/foro
    But in the settings on OneSignal, I can't add /forum, only https://www.myforum.com
    Quote:
    Originally Posted by iA1 View Post
    Replace the file includes/functions_OneSignal.php with the attached file. You can even open that file in a text editor and modify the messages as you like.
    Made the same changes for solved?

    Thanks and regards!
    Reply With Quote
      #46  
    Old 12-22-2018, 05:22 PM
    iA1 iA1 is offline
     
    Join Date: Jul 2018
    Posts: 150
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    I have updated the plugin and applied a fix. Now it should work without any problems on forums that are on a sub-directory.

    Download updated files, re-upload functions file under includes folder and re-install the product.
    Reply With Quote
      #47  
    Old 12-22-2018, 05:58 PM
    gnrx gnrx is offline
     
    Join Date: Apr 2009
    Posts: 390
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Quote:
    Originally Posted by iA1 View Post
    I have updated the plugin and applied a fix. Now it should work without any problems on forums that are on a sub-directory.

    Download updated files, re-upload functions file under includes folder and re-install the product.
    Thank you very much iA1! I download and re upload and re install the product.

    Again, thanks!!!
    Reply With Quote
      #48  
    Old 12-23-2018, 10:30 AM
    iA1 iA1 is offline
     
    Join Date: Jul 2018
    Posts: 150
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Quote:
    Originally Posted by carik View Post
    when you go to the topic, opens the page you want, but you need to scroll the page to the post. If there are ideas how to correct I will be very grateful!

    :up::up::up:
    This has been corrected in the previous update, 1.1.0

    Update:

    1.2.0 - Added privacy for replies in private sections.
    Post content and thread title from private sections will not be displayed on push notifications. Instead, it just asks the recipient to click to view the post.

    Added subscribe button after the last posts, before quick-reply box. It will only display if you enable Custom Link Prompt in your OneSignal settings.
    Reply With Quote
      #49  
    Old 12-24-2018, 03:36 PM
    khalled khalled is offline
     
    Join Date: Apr 2007
    Posts: 147
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Quote:
    Originally Posted by khalled View Post
    i install the product from two days and till now i don't get any automatic notification ,

    N.B i add Keys & IDs. to the product , also i can send notification manually from OneSignal website and run vBulletin? Version 4.2.5
    Quote:
    Originally Posted by iA1 View Post
    To get support, please mark as installed and send the link of your forum by PM.
    Many Thanks iA1 for help in private PM and your valuable advise , which i will share here as i guide for other
    PHP Code:
    Check the steps of installation once againAt the end of step 1it says:
    Download those filesextract them and upload them to your forum's root directory.
    There is another section on the same page asking you to add code to your site. DO NOT add that code yet. It is automatically done when you install this product.

    See the red part. It seems like you have manually added that code as well. Maybe it is causing the problem.
    Many thanks for your help , yes as you said i manually added the code , but after i delete the code , Nothing Happened and there is no new subscriber from yesterday
    I checked your website again. There seems to be a problem with the appid. It says in browser console log:
    OneSignal: This app ID does match any existing app. Double check your app ID.

    Check your OneSignal app id setting in admincp. 
    My questions is

    after your advise , the web site visitors can now subscribe in OneSignal notifications
    but when i check the website page source i found that OneSignal code only appear after i inter web site as i user and not appear if i am unregistered visitor , is that mean that only registered visitor can subscribe in the OneSignal notifications

    also until now there is no notification send from my forum automatically , and must send notifications manually from https://onesignal.com
    Reply With Quote
      #50  
    Old 12-24-2018, 03:48 PM
    gnrx gnrx is offline
     
    Join Date: Apr 2009
    Posts: 390
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Quote:
    Originally Posted by iA1 View Post
    Update:

    1.2.0 - Added privacy for replies in private sections.
    Post content and thread title from private sections will not be displayed on push notifications. Instead, it just asks the recipient to click to view the post.

    Added subscribe button after the last posts, before quick-reply box. It will only display if you enable Custom Link Prompt in your OneSignal settings.
    Thanks for your work!!!
    Reply With Quote
      #51  
    Old 12-24-2018, 03:59 PM
    gnrx gnrx is offline
     
    Join Date: Apr 2009
    Posts: 390
    Благодарил(а): 0 раз(а)
    Поблагодарили: 0 раз(а) в 0 сообщениях
    Default

    Hello.
    Just, after 2 minutos post my last reply (before post I was update this mod), one user reply a private thread.
    I received the notification that: The user x has replied a private thread (in english and my forum is spanish ) but click in the link and go to www.mydomain.com (my forum is in: www.mydomain.com/foro).

    Edit: also, I try the new function: Added subscribe button after the last posts, before quick-reply box. It will only display if you enable Custom Link Prompt in your OneSignal settings.

    I create a Custom Link Prompt in OneSignal settings, I try, appears before quick response, click in the link I go to page that appears:

    Code:
    Forum notice
    The specified action is invalid
    
    undefined
    The url that appears in my browser is:
    Code:
    https://www.mydomain.com/foro/inlinemod.php?threadid=409061&p=
    But after this, the bell indicate that, I are suscribed.

    Regards and Happy Christmas!!!
    Reply With Quote
    Reply


    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT. The time now is 06:46 PM.


    Powered by vBulletin® Version 3.8.12 by vBS
    Copyright ©2000 - 2024, vBulletin Solutions Inc.
    X vBulletin 3.8.12 by vBS Debug Information
    • Page Generation 0.09641 seconds
    • Memory Usage 2,365KB
    • Queries Executed 27 (?)
    More Information
    Template Usage:
    • (1)SHOWTHREAD
    • (1)ad_footer_end
    • (1)ad_footer_start
    • (1)ad_header_end
    • (1)ad_header_logo
    • (1)ad_navbar_below
    • (1)ad_showthread_beforeqr
    • (4)bbcode_code
    • (1)bbcode_php
    • (9)bbcode_quote
    • (1)footer
    • (1)forumjump
    • (1)forumrules
    • (1)gobutton
    • (1)header
    • (1)headinclude
    • (1)modsystem_post
    • (1)navbar
    • (4)navbar_link
    • (120)option
    • (1)pagenav
    • (1)pagenav_curpage
    • (4)pagenav_pagelink
    • (11)post_thanks_box
    • (3)post_thanks_box_bit
    • (11)post_thanks_button
    • (1)post_thanks_javascript
    • (1)post_thanks_navbar_search
    • (1)post_thanks_postbit
    • (11)post_thanks_postbit_info
    • (10)postbit
    • (4)postbit_attachment
    • (11)postbit_onlinestatus
    • (11)postbit_wrapper
    • (1)spacer_close
    • (1)spacer_open
    • (1)tagbit_wrapper 

    Phrase Groups Available:
    • global
    • inlinemod
    • postbit
    • posting
    • reputationlevel
    • showthread
    Included Files:
    • ./showthread.php
    • ./global.php
    • ./includes/init.php
    • ./includes/class_core.php
    • ./includes/config.php
    • ./includes/functions.php
    • ./includes/class_hook.php
    • ./includes/modsystem_functions.php
    • ./includes/functions_bigthree.php
    • ./includes/class_postbit.php
    • ./includes/class_bbcode.php
    • ./includes/functions_reputation.php
    • ./includes/functions_post_thanks.php 

    Hooks Called:
    • init_startup
    • init_startup_session_setup_start
    • init_startup_session_setup_complete
    • cache_permissions
    • fetch_threadinfo_query
    • fetch_threadinfo
    • fetch_foruminfo
    • style_fetch
    • cache_templates
    • global_start
    • parse_templates
    • global_setup_complete
    • showthread_start
    • showthread_getinfo
    • forumjump
    • showthread_post_start
    • showthread_query_postids
    • showthread_query
    • bbcode_fetch_tags
    • bbcode_create
    • showthread_postbit_create
    • postbit_factory
    • postbit_display_start
    • post_thanks_function_post_thanks_off_start
    • post_thanks_function_post_thanks_off_end
    • post_thanks_function_fetch_thanks_start
    • fetch_musername
    • post_thanks_function_fetch_thanks_end
    • post_thanks_function_thanked_already_start
    • post_thanks_function_thanked_already_end
    • post_thanks_function_fetch_thanks_bit_start
    • post_thanks_function_show_thanks_date_start
    • post_thanks_function_show_thanks_date_end
    • post_thanks_function_fetch_thanks_bit_end
    • post_thanks_function_fetch_post_thanks_template_start
    • post_thanks_function_fetch_post_thanks_template_end
    • postbit_imicons
    • bbcode_parse_start
    • bbcode_parse_complete_precache
    • bbcode_parse_complete
    • postbit_attachment
    • postbit_display_complete
    • post_thanks_function_can_thank_this_post_start
    • pagenav_page
    • pagenav_complete
    • tag_fetchbit_complete
    • forumrules
    • navbits
    • navbits_complete
    • showthread_complete