Skip to content

marclucraft/unosignal

Repository files navigation

UnoSignal Logo'

Uno for Unofficial. Uno for One – ¡Ole!

An unofficial OneSignal / WordPress Integration. I currently work at OneSignal, however this is in no way affiliated to OneSignal. If you're looking for the official plugin, go here: OneSignal WordPress Plugin

Overview

  • 🚀 Initialises the latest OneSignal Web SDK (v16).
  • ⏩ Automatically sends Push Notifications when a WordPress post is published.
  • 💬 Setup prompts within the OneSignal dashboard. No custom code required.
  • 🧑‍🤝‍🧑 Choose which Segment should recieve notifications for each post.
  • 📑 Web Topics included by default.
  • 📲 Send to mobile app subscribers, with an option to direct them to a different URL (Deep Link).

Download

  • Click Code at the top right of this repository and select Download ZIP
    image

Install

  1. In your WordPress admin screen, click Plugins -> Add New Plugin -> Upload Plugin -> Choose file

    image
  2. Choose onesignal-main.zip and click Open

    image
  3. Click Install Now

    image
  4. Click Activate Plugin

    image
  5. You're done, and should see UnoSignal in your admin menu

    image

Setup

Requirements

OneSignal.com

  1. On the Web Platform configuration page, choose Typical Site Setup
  2. On the Typical Site Setup screen, under Advanced Push Settings, switch on Customize service worker paths and filenames
  3. Where it asks for Path to service worker files and Service worker registration scope, enter /wp-content/plugins/unosignal-main/service_worker/ (screenshot example below).
  4. Where it asks for Main service worker filename and Updater service worker filename, enter OneSignalSDKWorker.js (screenshot example below).
  5. Save the Settings page. You'll be directed to a new page with Upload Files and Add Code to Site, ignore this and click Finish at the bottom of the page.

    image

UnoSignal WordPress Plugin Settings

  1. Enter the OneSignal App Id and REST API Key (Keys and IDs).
  2. Save Changes
  3. You should see a check below each field. That's it!

    image

Sending notifications

  • Whilst creating a Post in WordPress, you should see a metabox for OneSignal Push Notifications.
  • Check Send notification when post is published, and choose the Segment you'd like to target.
  • By default, a notification will use the Post title and an excerpt of the Post content. It will also include an image, if the post has a featured image.
  • You can customise the Title and Content of a notification by checking Customize notification content. You can also customise the Mobile URL (more on this below).
  • When you Publish the post, a notification will be sent.

    image

Sending to mobile app subscribers.

  • If you also have a mobile app setup in OneSignal, that's separate to your Website, you can switch on Send notification to Mobile app subscribers (in the plugin settings screen). This will include subscribers from your Mobile app in the notification send.
  • In the OneSignal Push Notifications metabox, you can choose a different URL for your Mobile app subscribers (Deep Link) – If you do not include a different URL, it will direct them to your Website, rather than a specific page of your app.

    image

About

An unofficial OneSignal / WordPress Integration

Topics

Resources

Stars

Watchers

Forks