Giter Site home page Giter Site logo

iterablewebpush's Introduction

Firebase Files

Add the manifest.json file to the route of your project. It must be accessible from the URL, similar to this example:

alt text

Add the firebase-messaging-sw.js file right next to the manifest.json file.

Setup Project and Add Code

  1. Create your project on the Firebase Console. Name your project

  2. Open the Cloud Messaging tab of the Firebase console Settings pane and scroll to the Web configuration section.

  3. In the Web Push certificates tab, click Generate Key Pair. The console displays a notice that the key pair was generated, and displays the public key string and date added.

image alt text

The key pair is your Firebase webpush certificate.

  1. Add the github code to your HTML file in the <script> section

  2. Change the credentials to your firebase credentials and Iterable credentials. Don't forget the SENDER ID in the firebase-messaging-sw.js file.

  3. Add the requestPermission() function to the place in your code that you want to trigger the permission popup. Typically, it’s right after signup once you have the user email.

  4. Add the users email to the email variable

  5. Call the deleteToken() function when a user refreshes the page as this will acquire the latest token and re-update it to the Iterable server. It is recommended to put this in periodically to ensure you have the most up-to-date browser token.

  6. Got to your Iterable App and add your Server Key from Firebase.

image alt text

TESTING:

Open the Chrome console (option+command+j), collect the current browser token from the console and add it the “Send test push” highlighted section in Iterable Integration page. You should receive a test push on your browser.

image alt text

NOTES:

  • The webpush popup will not appear if the page is front and center. It must be minimized or backgrounded.

  • If the popup fails, Chrome may also need to be reset.

iterablewebpush's People

Contributors

bfmarks avatar

Stargazers

Julian Mclain avatar Logan H avatar  avatar  avatar t-rex avatar

Watchers

James Cloos avatar  avatar Julian Mclain avatar Logan H avatar

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.