Xenforo OneSignal Push Notifications - Now With Simple Install 1.1.8

Exclusive on TAZ One Signal notifications for Xenforo

  1. RoldanLT

    RoldanLT Fan

    607
    167
    +220
    I tired using this PHP script here: https://www.keycdn.com/blog/leverage-browser-caching/
    To grab:
    https://cdn.onesignal.com/sdks/OneSignalSDK.js
    and
    https://github.com/OneSignal/OneSignal-Website-SDK/raw/master/dist/OneSignalSDK.js

    But it didn't work.

    Script just return this:
    Code:
    <html>
    <head><title>302 Found</title></head>
    <body bgcolor="white">
    <center><h1>302 Found</h1></center>
    <hr><center>nginx/1.4.6 (Ubuntu)</center>
    </body>
    </html>
     
  2. Mouth

    Mouth Aspirant

    15
    53
    +6
    Users tell me that their Facebook subscribed web pushes auto fade/disappear after ~30secs, but the site ones delivered through OneSignal remain until clicked to close. Can we have our auto fade/close too?
     
  3. Mouth

    Mouth Aspirant

    15
    53
    +6
    Ahh, I see. ....

    "On Firefox and Safari, notifications are automatically dismissed after a short amount of time. On Chrome, by default, notifications last indefinitely (they are displayed until the user interacts with it by dismissing it or clicking it). On Chrome Desktop v47+, you can add a parameter to control whether a notification is displayed indefinitely or dismissed after ~20 seconds." Ref: https://documentation.onesignal.com/v3.0/docs/web-push-sdk-setup-http

    I modified template onesignal_js from;
    Code:
            var OneSignal = OneSignal || [];
            OneSignal.push(
              ["init", {
                appId: "{$xenOptions.os_pn_app_id}",
                safari_web_id: '{$xenOptions.os_pn_safari_key}',
    ... to ...
    Code:
            var OneSignal = OneSignal || [];
            OneSignal.push(
              ["init", {
                persistNotification: false, // Automatically dismiss the notification after ~20 seconds in Chrome Desktop v47+
                appId: "{$xenOptions.os_pn_app_id}",
                safari_web_id: '{$xenOptions.os_pn_safari_key}',
    So that this add-on for my site would also auto dismiss/close the notification.

    I'd like to request/recommend a tickbox ACP option @ /admin.php?options/list/onesignal_pn for this functionality to be on or off.
     
  4. R0binHood

    R0binHood Enthusiast

    191
    33
    +50
    Request: Add option in ACP to enter OneSignal forum subdomain for sites that don't use SSL

    As per 1.4 and 2.0 on this page, you need to be able to add the subdomain created in the OneSignal ACP from which alerts will be sent.

    https://documentation.onesignal.com/docs/web-push-sdk-setup-http

    upload_2017-4-19_13-38-38.png

    Otherwise you have to manually edit the template and add the relevant subdomain code there.
     
  5. pierce

    pierce Fan

    875
    172
    +514
    These are excellent suggestions to add to the product.

    I'm currently going on holidays tomorrow so don't have much time over the next week.

    It's been busy over the last few weeks as well and i am glad i pushed on the project when i had the time to do so.

    Also need to look at porting to xf2. Which means i may leave multi language support out of xf1.5 until xf2 version is done. Till then alerts.php under model can be edited directly for the main language of the forum.

    Xf2 is important because we all need to keep moving forward and a lot of forums have adapted this modification which means they possibly have become reliant on it. Which puts a lot responsibility on me.
     
    • Like Like x 2
    • Winner Winner x 1
    • Appreciation Appreciation x 1
    • List
  6. Mouth

    Mouth Aspirant

    15
    53
    +6
    Admin and Moderators (only?) are getting a push notification of "This site has been updated.." quite regularly. What is this?
     
  7. pierce

    pierce Fan

    875
    172
    +514
    I don't have that as text in any alert.

    I wonder is the page title (any threads called this site...) over riding the notifications text?
     
  8. R0binHood

    R0binHood Enthusiast

    191
    33
    +50
    Check this out, on Chrome 56 onwards you can include a large image below the notification.

    https://documentation.onesignal.com/v3.0/docs/web-push-notification-icons

    It could potentially be neat if a post had an attached image, it included it in the notification. Or perhaps if someone uploaded an image to the gallery. I'm not sure if that would be annoying or not. Good to know it's an option though, could be useful for manually sent notifications by admins to make them stand out.
     
  9. Mouth

    Mouth Aspirant

    15
    53
    +6
    The exact text is "This site has been upgraded in the backgrou..". When I tap on the notification (Android) nothing happens.

    No page title or any threads with similiar or exact text
     
  10. Mouth

    Mouth Aspirant

    15
    53
    +6
    https://github.com/OneSignal/OneSignal-Website-SDK/issues/60 appears to discuss/address this issue, but I'm not skilled enough with JS development and service workers to understand it deeply enough to determine how it might apply to my scenario. Any pointers?
     
  11. R0binHood

    R0binHood Enthusiast

    191
    33
    +50
    I'm having an issue with Chrome notifications, they don't seem to be working for me.

    They haven't for a few weeks, but I figured it might just be my computer. Got around to doing some testing this morning, FF and Safari still work great.

    I went to the OneSignal site, found my multiple users for Chrome and Safari in the 'All Users' tab (couldn't find my FF user though for some reason, it doesn't help you can't search the 'Tag' field which has all the forum user IDs and usernames in it)

    Added those users to a test group and proceeded to do some manual testing to my account sending the notifications from the OneSignal ACP.

    The FF and Safari ones are working great, getting an error with Chrome though and get an invalid response

    upload_2017-4-25_11-36-18.png


    I double checked my XF ACP Options and keys seem fine. I tried resetting my REST API key just in case, but no luck.

    I sent them a message on Intercom to see if they can help.

    Anyone else having issues on Chrome?
     
  12. pierce

    pierce Fan

    875
    172
    +514
    Gcm id?
     
  13. pierce

    pierce Fan

    875
    172
    +514
    I see your comment on github.

    You can remove the Google example service worker.

    The requirement is /any/ service worker and Onesignal qualifies for that.
     
  14. R0binHood

    R0binHood Enthusiast

    191
    33
    +50
    The default one, 380462037497.

    I don't seem to remember setting up another one? I can do though if I need to?
     
  15. pierce

    pierce Fan

    875
    172
    +514
    Yeah look back a few posts i *ed it up royaly.

    Should start with a 4
     
  16. R0binHood

    R0binHood Enthusiast

    191
    33
    +50
    Ahh sorry, I've just gone back and caught up with the thread.

    I updated it and still doesn't seem to work :(

    I didn't have a secure hash setup either, I followed your instructions earlier in the thread and created a 128 character password as a hash, and enabled security.

    What's the security all about anyway?

    I pinged OneSignal a message about my latest edit, perhaps they'll issue me a new one like someone else in the thread. Will see what they say.

    Option to fade it out on Chrome would be nice.

    I just noticed that the Firefox notification seems to make a noise too. It would be good to have a user preference to enable/disable alert sounds. Not sure if that's a setting that you could be user configured though.
     
  17. R0binHood

    R0binHood Enthusiast

    191
    33
    +50
    Weirdly I set this up on another forum last week and it's using 380462037497 just grand on Chrome.
     
  18. R0binHood

    R0binHood Enthusiast

    191
    33
    +50
    Got my first reply, they're telling me that the one account I've been trying to fix on the forum (mine) was signed up under a different GCM number.

    So I need to delete that user from the dashboard, reset by browser and sign up as a new user.

    Obviously that's just one account though.

    The GCM for the add on was whatever it's been since the beginning, then perhaps it got changed? Then I changed it again today...

    Waiting to hear back about how to ensure everyone is signed up using the right number, but I'm concerned he's going to come back and say that there's going to be a mix mash of users signed up under different GCM numbers and the only way to fix it will be for them to resubscribe after resetting their browser cache. As if that's going to happen...

    Fingers crossed there's a way to sort it on the back end.
     
  19. Shin Ryoku

    Shin Ryoku Adherent

    399
    182
    +179
    piercepierce

    I used gonative.io to create an app for one of my sites and paid their license for premium push notifications, which uses OneSignal.

    They configured my Android and iOS apps to use the same OneSignal app ID as I use for web push notifications using your addon, but I'm not getting notifications via the apps.

    Should I have expected this, or would you expect your addon push notifications irrespective of the platform assuming the delivery part is configured correctly?
     
  20. pierce

    pierce Fan

    875
    172
    +514
    How does the app work?

    Can the app create/use tags?