Web push notifications with OneSignal for Flarum

installation

Install manually:

composer require nikovonlas/flarum-ext-web-push

configuration

Upload files from /vendor/nikovonlas/flarum-ext-web-push/upload/ to you public folder.
Activate the extension in the admin panel of your Flarum.
Register in onesignal.com and create a new app an configure notifications as typical site, and use the Settings dialog in your website to configure the extension.

updating

composer update nikovonlas/flarum-ext-web-push
php flarum cache:clear

todo

  1. Subscribation variations to settings page
  2. Provide prompts from Onesignal
  3. Custom code site type

links

GitHub
Packagist

I`m sorry for my poor english. En language may be with various mistakes. Please report it here or make pull request for language file.

  • [deleted]

Install fails with

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for nikovonlas/flarum-ext-web-push ^0.1.0@beta -> satisfiable by nikovonlas/flarum-ext-web-push[v0.1.0-beta.6].
    - nikovonlas/flarum-ext-web-push v0.1.0-beta.6 requires norkunas/onesignal-php-api ^1.12 -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Installation failed, reverting ./composer.json to its original content.
    • [deleted]

    NikoVonLas thanks, but I think I'll wait for the next version.

    A note about OneSignal: if you want to include this on your website, make sure you understand privacy concerns. OneSignal might be free, but part of their business is based on data collection and profiling of users' activity. Their privacy policy is pretty clear, they collect as much information as possible when using their SDKs, and you allow them to use the data for pretty much anything:

    https://onesignal.com/privacy_policy

      NikoVonLas You don't have to provide the information for services to obtain it (known example is Google Analytics).

        datitisev
        I agree if I understand correctly (lang barrier). But i dont know analog to oneSignal.
        I think about Firebase, but it may be hard to install for usual user.

          NikoVonLas I was just referring your statement, "I dont provide any sensitive data". Companies take what they want, whether you want them to have it or not. 🤷‍♂️. Not complaining about OneSignal specifically.

            datitisev Yep thats fact. Especially surprising with modern voices assistants. Recently I read an article that a person logged into a Google account and noticed there are recordings with unrecognized voice commands of the Google Assistant. There were completely different phrases from “ok, google”, and then an advertisement pops up with phrases from these records.

            a month later

            will this send notification when someone reply or like my post?

              zedreez Of course, all notifications in header bell also sending thru webpush.

              5 days later

              i tried this, but my like / reply notification not sending thru webpush. I use typical site and bell icon prompt. Am I do it wrong?
              But, when I try to send notification via OneSignal admin panel, it sent.

                14 days later

                Just tried this extension but I don't find the info I have to enter:

                I think I found the Onesignal app id, but what are the other fields?
                Where did I find this info on OneSignal ?

                  NikoVonLas Thanks but the images are not visible.
                  My flarum website ist on a subdomain from my website but not from onesignal. So I leave it empty?


                  Now the images are visible.
                  Thanks!

                  So the "Aut Key" is the "Onsignal user key"?
                  The "Rest Api Key" is the "Onesignal api key"?

                  And I host my flarum forum on my subdomain of my main URL.
                  Should I add here the subdomain name inside "Onesignal subdomain"? So only the subdomain name or the full domain?