GithubHelp home page GithubHelp logo

onesignaldevelopers / sms-fallback-delivery-sample Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 28.88 MB

Demonstrates how to implement a notification strategy that falls back to text message delivery when a customer does not have push notifications enabled.

Home Page: https://onesignal.com/blog/using-sms-as-a-fallback-option-for-unsubscribed-push-users/

License: Other

JavaScript 68.28% CSS 31.72%
onesignal onesignal-notifications sms-notifications onesignal-sdk onesignal-api onesignal-nextjs nextjs react reactjs

sms-fallback-delivery-sample's Introduction

Using SMS as a Fallback Option for Push Notifications

This sample project demonstrates how to compose the OneSignal Web Push SDK with the OneSignal Rest API to enable SMS for users who are not subscribed to push notifications on your site. You can use this project as reference guide for implementing SMS fallback delivery in your site or app.

Interested in learning more about this project? Check out this blog post.

Running this sample

Setup

Your OneSignal API Key & App ID and Twilio phone number need to be set in .env.local before running the project.

ONESIGNAL_API_KEY="API Ket"
ONESIGNAL_APP_ID="App ID"
TWILIO_PHONE_NUMBER="+18001234567"
NEXT_PUBLIC_API_URL="http://localhost:3000/api"
  1. Run yarn to install packages
  2. Run yarn dev to start a dev instance of the server

Note that you will need to have a OneSignal app created before this example will work. Check the blog post for guidance on creating an app on OneSignal.

sms-fallback-delivery-sample's People

Contributors

iamwillshepherd avatar jmadler avatar

Watchers

 avatar  avatar

Forkers

rakhithjk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.