{"id":15282624,"url":"https://github.com/eddyverbruggen/nativescript-pushy","last_synced_at":"2025-07-07T21:03:42.367Z","repository":{"id":57308729,"uuid":"177860616","full_name":"EddyVerbruggen/nativescript-pushy","owner":"EddyVerbruggen","description":"Easy push notifications for your NativeScript app!","archived":false,"fork":false,"pushed_at":"2019-10-02T07:19:39.000Z","size":2142,"stargazers_count":21,"open_issues_count":7,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T03:44:08.469Z","etag":null,"topics":["nativescript","nativescript-plugin","notifications","push-notifications"],"latest_commit_sha":null,"homepage":"https://pushy.me","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EddyVerbruggen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-26T20:05:43.000Z","updated_at":"2024-06-21T16:09:35.000Z","dependencies_parsed_at":"2022-08-29T05:00:22.356Z","dependency_job_id":null,"html_url":"https://github.com/EddyVerbruggen/nativescript-pushy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-pushy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-pushy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-pushy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EddyVerbruggen%2Fnativescript-pushy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EddyVerbruggen","download_url":"https://codeload.github.com/EddyVerbruggen/nativescript-pushy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810272,"owners_count":21807759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nativescript","nativescript-plugin","notifications","push-notifications"],"created_at":"2024-09-30T14:31:49.661Z","updated_at":"2025-05-07T03:44:13.832Z","avatar_url":"https://github.com/EddyVerbruggen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NativeScript Pushy\n\n[![Build Status][build-status]][build-url]\n[![NPM version][npm-image]][npm-url]\n[![Downloads][downloads-image]][npm-url]\n[![Twitter Follow][twitter-image]][twitter-url]\n\n[build-status]:https://travis-ci.org/EddyVerbruggen/nativescript-pushy.svg?branch=master\n[build-url]:https://travis-ci.org/EddyVerbruggen/nativescript-pushy\n[npm-image]:http://img.shields.io/npm/v/nativescript-pushy.svg\n[npm-url]:https://npmjs.org/package/nativescript-pushy\n[downloads-image]:http://img.shields.io/npm/dm/nativescript-pushy.svg\n[twitter-image]:https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social\u0026label=Follow%20me\n[twitter-url]:https://twitter.com/eddyverbruggen\n\n\u003e Hop on over to [Pushy.me](https://pushy.me/) to get started!\n\n## Installation\n```bash\ntns plugin add nativescript-pushy\n```\n\nFor {N} 5 and below please use\n```bash\ntns plugin add nativescript-pushy@1.x\n```\n\n## Demo app\nCheck the source in the [demo](/demo) folder, or run it on your own device:\n\n```bash\ngit clone https://github.com/EddyVerbruggen/nativescript-pushy\ncd nativescript-pushy/src\nnpm i\nnpm run demo.ios # or demo.android\n```\n\n## Setup (iOS only)\nCreate a file called either `app.entitlements` or `\u003cYourAppName\u003e.entitlements` (where `YourAppName` is identical to the folder name of `platforms/ios/YourAppName`). [Here's an example](https://github.com/EddyVerbruggen/nativescript-pushy/blob/master/demo/app/App_Resources/iOS/app.entitlements).\n\nNow reference that file from `build.xcconfig` [as shown here](https://github.com/EddyVerbruggen/nativescript-pushy/blob/master/demo/app/App_Resources/iOS/build.xcconfig).\n\n## API\n\n### `getDevicePushToken`\n```typescript\nimport { getDevicePushToken } from \"nativescript-pushy\";\n\ngetDevicePushToken()\n    .then(token =\u003e console.log(`getDevicePushToken success, token: ${token}`))\n    .catch(err =\u003e console.log(`getDevicePushToken error: ${err}`));\n```\n\n### `setNotificationHandler`\nSince plugin version 1.1.0 the *entire* payload of the notification is copied to the object this handler receives,\nbut note that it all gets copied into a `data` object. So if you send for instance `{\"foo\": \"bar\"}`,\nyou can find the value `\"bar\"` at `notification.data.foo`. \n\n```typescript\nimport { setNotificationHandler } from \"nativescript-pushy\";\n\nsetNotificationHandler(notification =\u003e {\n  console.log(`Notification received: ${JSON.stringify(notification)}`);\n});\n```\n\nOne of the properties of the returned `notification` object is `foreground`, which indicates whether or not\nthe notification was received while the app was in either the foreground or background.\n\nAnother useful property may be `appLaunchedByNotification`, which indicates whether or not the app was launched\nby tapping the notification (as opposed to the app's icon). When this property is `true` you may want to fi.\nnavigate to a different route in your app.\n\n## Please note..\n\n\u003e ⚠️ Do not test on a the iOS simulator as it can't receive push notifications.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fnativescript-pushy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddyverbruggen%2Fnativescript-pushy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddyverbruggen%2Fnativescript-pushy/lists"}