Skip to content

Commit 3be6412

Browse files
#9 module not found
1 parent 269b29e commit 3be6412

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,27 @@ From the command prompt go to your app's root folder and execute:
99
tns plugin add nativescript-local-notifications
1010
```
1111

12+
#### TypeScript support
13+
And do yourself a favor by adding TypeScript support to your nativeScript app:
14+
15+
````
16+
tns install typescript
17+
```
18+
19+
Then open `references.d.ts` in the root of your project and add this line to get autocompletion and type-checking for this plugin:
20+
21+
/// <reference path="./node_modules/nativescript-local-notifications/local-notifications.d.ts" />
22+
23+
Now you can import the plugin as an object into your `.ts` file as follows:
24+
25+
```js
26+
// import the TS definitions
27+
import * as LocalNotifications from "nativescript-local-notifications";
28+
29+
// .. and use it as:
30+
LocalNotifications.hasPermission()..
31+
```
32+
1233
## Usage
1334
1435
If you want a quickstart, [clone our demo app](https://github.com/EddyVerbruggen/nativescript-local-notifications-demo).

local-notifications.ios.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ LocalNotifications.hasPermission = function (arg) {
5656
LocalNotifications._hasPermission = function () {
5757
var settings = UIApplication.sharedApplication().currentUserNotificationSettings();
5858
var types = UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound;
59-
return settings.types & types;
59+
return (settings.types & types) > 0;
6060
};
6161

6262
LocalNotifications.requestPermission = function (arg) {

0 commit comments

Comments
 (0)