Skip to content

delanick/nativescript-pushy

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Easy push notifications for your NativeScript app!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 79.7%
  • Shell 10.8%
  • JavaScript 6.8%
  • Ruby 2.7%