GithubHelp home page GithubHelp logo

delanick / nativescript-pushy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eddyverbruggen/nativescript-pushy

0.0 0.0 0.0 2.06 MB

Easy push notifications for your NativeScript app!

Home Page: https://pushy.me

License: Apache License 2.0

Shell 10.85% Ruby 2.68% TypeScript 79.66% JavaScript 6.81%

nativescript-pushy's Introduction

NativeScript Pushy

Build Status NPM version Downloads Twitter Follow

Hop on over to Pushy.me to get started!

Installation

tns plugin add nativescript-pushy

Demo app

Check the source in the demo folder, or run it on your own device:

git clone https://github.com/EddyVerbruggen/nativescript-pushy
cd nativescript-pushy/src
npm i
npm run demo.ios # or demo.android

Setup (iOS only)

Create a file called either app.entitlements or <YourAppName>.entitlements (where YourAppName is identical to the folder name of platforms/ios/YourAppName). Here's an example.

Now reference that file from build.xcconfig as shown here.

API

getDevicePushToken

import { getDevicePushToken } from "nativescript-pushy";

getDevicePushToken()
    .then(token => console.log(`getDevicePushToken success, token: ${token}`))
    .catch(err => console.log(`getDevicePushToken error: ${err}`));

setNotificationHandler

import { setNotificationHandler } from "nativescript-pushy";

setNotificationHandler(notification => {
  console.log(`Notification received: ${JSON.stringify(notification)}`);
});

Please note..

โš ๏ธ Do not test on a the iOS simulator as it can't receive the token not actual push notifications.

nativescript-pushy's People

Contributors

eddyverbruggen 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.