Giter Site home page Giter Site logo

eddyverbruggen / nativescript-local-notifications Goto Github PK

View Code? Open in Web Editor NEW
161.0 9.0 60.0 9.61 MB

:mailbox: NativeScript plugin to easily schedule local notifications

License: MIT License

Objective-C 22.44% Java 32.01% Shell 1.01% TypeScript 38.98% CSS 0.68% Vue 3.23% HTML 1.40% JavaScript 0.26%
nativescript nativescript-plugin notifications local-notifications

nativescript-local-notifications's People

Contributors

alg avatar dannyfeliz avatar danziger avatar dependabot[bot] avatar eddyverbruggen avatar edusperoni avatar enesasillioglu avatar etabakov avatar ezlo-ionutrusu avatar htbkoo avatar ickata avatar nikolayczyk avatar oleklapp avatar oncul avatar patricklx avatar robophil avatar saeb-panahifar avatar samuelagm avatar surdu avatar triniwiz avatar vladwelt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nativescript-local-notifications's Issues

Click in Notification don't call onActivityCreated (android)

Everything works fine. Thanks for this plugin.

But, I am facing a problem.
When the app is closed and the user touch the notification the app opens, but the function onActivityCreated is not called.
application.android.onActivityCreated = function(activity) {...}
Another functions like onActivityStarted are called normally.

Is this an error? Is this the default behaviour? Can I be doing something wrong?

How to disabled notification sound

How do i disabled sound, but still receive notifications

LocalNotifications.schedule([{
id: message.entityId,
title: message.title,
body: message.body,
smallIcon: 'res://icon',
largeIcon: 'res://icon'
}]).then(() => {
console.log("Notification Scheduled");
},(error)=> {
console.log("doScheduleId5 error: " + error);
}
);

Thank you

Android foreground/background check

Hello,

Thank you very much for the work on this!

I have the feeling that this is going to be an incredibly n00bish question but here goes:

I am having some trouble getting notifications to trigger/not trigger depending on what page is active in a chat app. So far, I have managed to respond to whether I am on the correct page in the app, but not also if the app is in the foreground or background. How can I also check that?

Code:

// if the notifications is from the user currently represented in the chat view, just update the chat view via the newMessageReceived event on that page
if (frameModule.topmost().currentEntry.context.chatRef === messageSenderId) {
frameModule.topmost().currentPage.notify({
eventName: 'newMessageReceived',
object: this
});
} else {
// schedule notification
LocalNotifications.schedule([{
id: randomNotificationId,
title: 'App Title',
body: 'You have a new message from ' + messageSender
}]).then(() => {
notificationListenerInit(messageSenderId);
}, error => {
console.log('error');
});
}

The conditional here works fine except for when the app is in the background AND the active page is still the one for this chat partner. Obviously the notification should always trigger while the app is in the background, but how do I do that?

Notification.new is not a function

I have updated to nativescript to 2.3 and the newest xcode. I then updated this plugin, but now Im getting the following error when trying to use it:

file:///app/tns_modules/nativescript-local-notifications/local-notifications.js:26:41: JS ERROR TypeError: Notification.new is not a function. (In 'Notification.new()', 'Notification.new' is undefined)

New option to pass to the schedule function

Would it be possible to have a new option that gives a frequency to the interval? For example if the frequency was 2 and interval was weeks then the the notification would appear every 2 weeks.

No sound, no notification, only listed in notifications

Hi, I was trying to implement your plugin to my android nativescript app but notification message or sound didnt show up after calling notification. Notification was only listed in other notifications list and app icon was showing red dot. I thought the problem was in my app, but after downloading your demo app repository, the issues were same on every type of notification in demo app. No message showing, no sound played, only displayed in notification list. I tried also older versions of plugin in your demo app, there the default sound notification started to work, but still no message showing in the top of the screen. I am testing it on Android 6.0.1 phone. Do you have any clue what could be the problem?

Error and build exception on Nativescript 1.7

Build failed with an exception

:cleanLocalAarFiles
:ensureMetadataOutDir
:collectAllJars
:buildMetadata
Exception in thread "main" java.lang.IllegalArgumentException: Class com.google.android.gms.ads.formats.NativeAd$Image conflict: /Users/macbook/apptest/platforms/android/build/intermediates/exploded-aar/com.google.android.gms/play-services-ads/7.5.0/jars/classes.jar and /Users/macbook/apptest/node_modules/nativescript-local-notifications/node_modules/nativescript-plugin-google-play-services/platforms/android/google-play-services_lib/libs/google-play-services.jar
    at com.telerik.metadata.ClassRepo.cacheJarFile(ClassRepo.java:21)
    at com.telerik.metadata.Builder.build(Builder.java:38)
    at com.telerik.metadata.Generator.main(Generator.java:44)
:buildMetadata FAILED

* What went wrong:
Execution failed for task ':buildMetadata'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

Using:
Nativescript 1.7.1
Android 5.1

Extra modules:
nativescript-admob
lodash

Error in LocalNotifications.requestPermission

HI

I have just started receiving this error

LocalNotifications.requestPermission : TypeError: null is not an object (evaluating 'app.currentUserNotificationSettings')

I am little confused as it has been previously working :(

Not compiling in {N} 1.7.1

I am having a hard time trying to compile.. it is always throwing errors...

:mergeNativescript-geolocationNativescript-local-notificationsNativescript-plugin-google-play-servicesNativescript-push-notificationsDebugResources FAILED

Error on android build Grocery tutorial + nativescript-googlemaps-plugin

I'm playing around with NS Grocery Angular+Typescript app tutorial and trying to integrate nativescript-google-maps plugin on it just using the same map component code. It all works fine on iOs emulator, but when trying to build on Android emulator (API 25) i get a build failure (Execution failed for task ':buildMetadata').

This is my 'tns build android' output:

Executing before-prepare hook from /Users/marcogagliardi/Projects/NativeScript/Groceries/hooks/before-prepare/nativescript-dev-android-snapshot.js
Executing before-prepare hook from /Users/marcogagliardi/Projects/NativeScript/Groceries/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.2.2
Preparing project...
Project successfully prepared (android)
Executing after-prepare hook from /Users/marcogagliardi/Projects/NativeScript/Groceries/hooks/after-prepare/nativescript-dev-android-snapshot.js
Building project...

:config phase:  createDefaultIncludeFiles
        +found plugins: nativescript-google-maps-sdk
        +found plugins: tns-core-modules-widgets

:config phase:  createPluginsConfigFile
         Creating product flavors include.gradle file in /Users/marcogagliardi/Projects/NativeScript/Groceries/platforms/android/configurations folder...

:config phase:  pluginExtend
        +applying configuration from: /Users/marcogagliardi/Projects/NativeScript/Groceries/platforms/android/configurations/include.gradle
        +applying configuration from: /Users/marcogagliardi/Projects/NativeScript/Groceries/platforms/android/configurations/nativescript-google-maps-sdk/include.gradle
        +applying configuration from: /Users/marcogagliardi/Projects/NativeScript/Groceries/platforms/android/configurations/tns-core-modules-widgets/include.gradle

:config phase:  addAarDependencies
        +adding dependency: /Users/marcogagliardi/Projects/NativeScript/Groceries/platforms/android/libs/aar/widgets-release.aar
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
Incremental java compilation is an incubating feature.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_9kie10nwkgwmdz6d4v90ppg8z.run(/Users/marcogagliardi/Projects/NativeScript/Groceries/platforms/android/build-tools/android-static-binding-generator/build.gradle:126)
:preBuild UP-TO-DATE
:preF0F1DebugBuild UP-TO-DATE
:checkF0F1DebugManifest
:preF0F1ReleaseBuild UP-TO-DATE
:prepareComAndroidSupportAnimatedVectorDrawable2531Library UP-TO-DATE
:prepareComAndroidSupportAppcompatV72531Library UP-TO-DATE
:prepareComAndroidSupportDesign2531Library UP-TO-DATE
:prepareComAndroidSupportRecyclerviewV72531Library UP-TO-DATE
:prepareComAndroidSupportSupportCompat2531Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUi2531Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUtils2531Library UP-TO-DATE
:prepareComAndroidSupportSupportFragment2531Library UP-TO-DATE
:prepareComAndroidSupportSupportMediaCompat2531Library UP-TO-DATE
:prepareComAndroidSupportSupportV42531Library UP-TO-DATE
:prepareComAndroidSupportSupportVectorDrawable2531Library UP-TO-DATE
:prepareComAndroidSupportTransition2531Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBase1100Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesBasement1100Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesMaps1100Library UP-TO-DATE
:prepareComGoogleAndroidGmsPlayServicesTasks1100Library UP-TO-DATE
:prepareGroceriesRuntimeUnspecifiedLibrary UP-TO-DATE
:prepareWidgetsReleaseLibrary UP-TO-DATE
:prepareF0F1DebugDependencies
:compileF0F1DebugAidl UP-TO-DATE
:compileF0F1DebugRenderscript UP-TO-DATE
:generateF0F1DebugBuildConfig UP-TO-DATE
:cleanLocalAarFiles
:ensureMetadataOutDir
:collectAllJars
:setProperties
:generateTypescriptDefinitions SKIPPED
:copyTypings SKIPPED
:asbg:generateInterfaceNamesList
:asbg:traverseJsFiles
:asbg:runAstParser UP-TO-DATE
:asbg:generateBindings UP-TO-DATE
:generateF0F1DebugResValues UP-TO-DATE
:generateF0F1DebugResources UP-TO-DATE
:mergeF0F1DebugResources UP-TO-DATE
:processF0F1DebugManifest UP-TO-DATE
:processF0F1DebugResources UP-TO-DATE
:generateF0F1DebugSources UP-TO-DATE
:incrementalF0F1DebugJavaCompilationSafeguard UP-TO-DATE
:compileF0F1DebugJavaWithJavac UP-TO-DATE
:compileF0F1DebugNdk UP-TO-DATE
:compileF0F1DebugSources UP-TO-DATE
:buildMetadata
Exception in thread "main" java.lang.IllegalArgumentException: Class android.support.graphics.drawable.AnimatedVectorDrawableCompat$AnimatedVectorDrawableCompatState conflict: /Users/marcogagliardi/Projects/NativeScript/Groceries/platforms/android/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/25.3.1/jars/classes.jar and /Users/marcogagliardi/Projects/NativeScript/Groceries/platforms/android/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/25.2.0/jars/classes.jar
        at com.telerik.metadata.ClassRepo.addToCache(ClassRepo.java:21)
        at com.telerik.metadata.Builder.build(Builder.java:38)
        at com.telerik.metadata.Generator.main(Generator.java:44)
:buildMetadata FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildMetadata'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.983 secs
Command ./gradlew failed with exit code 1

No notifications on my iPhone

Works great on android and ios emulators, but when I deploy to my actual iphone no notifications are happening. I can see in the xcode console that the events are firing, but I don't see any notification on the device. Any clues? What could be different?

Everything is fine... But Notification doesn't show up.

I installed the plugin for Nativescript 2.4 (Android).
So far I used the demo code and everything seemed fine.

I also got the console.log, that the Notification is scheduled.
But there is no Notification showing up... And I don't get any errors...

Someone experiencing the same problem? Is there a solution?

  LocalNotifications.schedule([{
    id: 1,
    title: 'The title',
    body: 'Recurs every minute until cancelled',
  }]).then(
      function() {
        console.log("Notification scheduled");
      },
      function(error) {
        console.log("scheduling error: " + error);
      }
  )

users notifications

i know this not the right place for this issue but i really need to know how to make users notifications
like if someone liked your post it notify you about that or if someone started following you etc
how can i implement that
thanks

ios simulator throws local-notifications.js:26:37: JS ERROR ReferenceError: Can't find variable: Notification

Hi There,

When running with the ios simulator the following exception is thrown:

file:///app/tns_modules/nativescript-local-notifications/local-notifications.js:26:37: JS ERROR ReferenceError: Can't find variable: Notification

I tested to see if it worked on my iphone and it does with no issues.

my setup:

Simulator: Version 9.3 (SimulatorApp-645.9)

"dependencies": {
"@angular/common": "2.2.1",
"@angular/compiler": "2.2.1",
"@angular/core": "2.2.1",
"@angular/forms": "2.2.1",
"@angular/http": "2.2.1",
"@angular/platform-browser": "2.2.1",
"@angular/platform-browser-dynamic": "2.2.1",
"@angular/router": "3.2.1",
"lodash": "^4.16.6",
"nativescript-angular": "1.2.0",
"nativescript-intl": "~0.0.8",
"nativescript-local-notifications": "^1.2.0",
"punycode": "1.3.2",
"querystring": "0.2.0",
"rxjs": "5.0.0-beta.12",
"tns-core-modules": ">=2.5.0 || >=2.5.0-2016",
"url": "0.10.3"
},
"devDependencies": {
"nativescript-dev-typescript": "^0.3.2",
"@types/lodash": "^4.14.37",
"typescript": "~2.0.3",
"zone.js": "^0.6.21"
}

Large Notification Icon Spec (Improve Docs)

Hello Eddy,

please consider adding following spec somewhere to the docs. LocalNotifications may fail silently on some android devices (especially Samsung) and never show up if the large icon size is not correct / too big. (Default fallback icon = Launcher icon xxxhdpi size: 345 x 345 which is too big and causes a silent fail. Well not completely silent: logcat -> !!! FAILED BINDER TRANSACTION !!! (parcel size = 1435376))

Large Notification Icon Spec

bildschirmfoto 2017-04-25 um 17 22 13

Don't include xxxhdpi

xxxhdpi: Extra-extra-extra-high-density uses (launcher icon only, see the note in Supporting Multiple Screens); approximately 640dpi. Added in API Level 18
Source: Density Qualifier Docs

Set Icon and kill already send notifications

Hi.
Thanks for the good plugin.

I wounder if it is possible to set the Icon that is uses in the notification manually?
And it would by nice to kill an already send notification - so it can by used as some kind of status update.

Nicky

Incorrect package.json and d.ts to use as node module.

First. Thanks for this fantastic plugin.

I had problems to use it as node module when you install wirh npm install.

To solve it:

Open node_modules/nativescript-local-notifications/local-package.json and add
"typings": "local-notifications.d.ts" as new object property.

Later, go to local-notifications.d.ts and remove declare module "nativescript-local-notifications" {}
Remove module declaration, not members inside it.

Now you can use it wrtiting, for example:

import {schedule} from "nativescript-local-notifications"

without import d.ts as reference

Notification show with small delay

First of all, thank you very much for your work!

My problem is not very crucial, but I think that it is something that can be improved.

When I schedule a notification for 'now' (the default) the notification takes a while to show, usually about 2 - 3 seconds.

TypeError: utils.ios.getter is not a function

I'm trying to use this plugin but something seems wrong. When I'm running directly in my iPhone it generate an error:

JS ERROR Error: Could not find module 'nativescript-local-notifications'. Computed path '/var/mobile/Containers/Data/Application/C9B5D50C-78BB-4CB3-BB0B-ABBF226F3D26/Library/Application Support/LiveSync/app/tns_modules/nativescript-local-notifications'.

Once I've tried run it in iOS simulator another exception is raised:


file:///app/tns_modules/nativescript-local-notifications/local-notifications.js:5:36: JS ERROR TypeError: utils.ios.getter is not a function. (In 'utils.ios.getter(NSNotificationCenter, NSNotificationCenter.defaultCenter)', 'utils.ios.getter' is undefined)
Oct 17 01:04:19 Marcios-MacBook-Pro-2 com.apple.CoreSimulator.SimDevice.62A75B7E-B30D-449A-B77E-F7DE858C4547.launchd_sim[7398] (UIKitApplication:org.nativescript.smartdietTS[0xcd70][61786]): Service exited due to signal: Segmentation fault: 11

Anyone have an idea about this?

Update notification title/body

As far as I can tell, there is no way to retrieve a notification after it is scheduled in order to update it.

A scenario where one would want to do that is for ongoing notifications like "Downloading... 20%"

Xcode 8 issue - JS ERROR TypeError: NSNotificationCenter.defaultCenter is not a function.

Thanks for the very handy module!

I upgraded to Xcode 8 and Nativescript 2.3.0, and I'm using 1.1.2 of this module.

My app is crashing as soon as the module is referenced. I tried installing your demo app with the following in the package.jspn file:

{
    "nativescript": {
        "id": "org.nativescript.localnotifications",
        "tns-android": {
            "version": "2.3.0"
        },
        "tns-ios": {
            "version": "2.3.0"
        }
    },
    "dependencies": {
        "nativescript-local-notifications": "1.1.2",
        "tns-core-modules": "2.3.0"
    },
    "devDependencies": {
        "babel-traverse": "6.8.0",
        "babel-types": "6.8.1",
        "babylon": "6.8.0",
        "filewalker": "0.1.2",
        "lazy": "1.0.11",
        "nativescript-dev-typescript": "^0.3.1",
        "typescript": "^1.8.2"
    }
}

The app builds and then crashes with the following error:

Sep 17 08:30:10 raef LocalNotifications[28139]: file:///app/tns_modules/nativescript-local-notifications/local-notifications.js:4:44: JS ERROR TypeError: NSNotificationCenter.defaultCenter is not a function. (In 'NSNotificationCenter.defaultCenter()', 'NSNotificationCenter.defaultCenter' is an instance of NSNotificationCenter)
Sep 17 08:30:10 raef com.apple.CoreSimulator.SimDevice.A02F4667-157D-4C2F-8665-8DBA15F8995C.launchd_sim[19818] (UIKitApplication:org.nativescript.localnotifications[0x9b6a][28139]): Service exited due to Segmentation fault: 11

This is the same error I am getting in my project.

Any ideas?

Seg 11 fail. Reference to released object

https://github.com/EddyVerbruggen/nativescript-local-notifications/blob/master/native-src/ios/LocalNotificationsPlugin/NotificationManager.m#L107

Somewhere in the if statement on line 107 in NotificationManager.m there is a pointer to a released object when receiving notifications on iOS9.3 and older. This makes the app crash when a notification is received while foreground or when tapping a notification when the application is running background. Removing the if-statement completely solves it

Submitted app returned for errors โ€“ Unexpected CFBundleExecutable Key

Hi @EddyVerbruggen ,

I got my app returned after uploading it to App Store with the following message:

Dear developer,

We have discovered one or more issues with your recent delivery for "XXXXX". To process your delivery, the following issues must be corrected:

Unexpected CFBundleExecutable Key - The bundle at '/Payload/mobile.app/app/tns_modules/nativescript-local-notifications/native-src/ios/LocalNotificationsPlugin/Info.plist' does not contain a bundle executable. If this bundle intentionally does not contain an executable, consider removing the CFBundleExecutable key from its Info.plist and using a CFBundlePackageType of BNDL. If this bundle is part of a third-party framework, consider contacting the developer of the framework for an update to address this issue.

Unexpected CFBundleExecutable Key - The bundle at '/Payload/mobile.app/app/tns_modules/nativescript-local-notifications/native-src/ios/LocalNotificationsPluginTests/Info.plist' does not contain a bundle executable. If this bundle intentionally does not contain an executable, consider removing the CFBundleExecutable key from its Info.plist and using a CFBundlePackageType of BNDL. If this bundle is part of a third-party framework, consider contacting the developer of the framework for an update to address this issue.

Once these issues have been corrected, you can then redeliver the corrected binary.

Regards,

The App Store team

Can you please advise?

BigTextStyle for Android

Hey @EddyVerbruggen,
I want to show multiline message in Notifications.
There is already an entry on stackoverflow on this topic.
Link:
https://stackoverflow.com/questions/45666384/firebase-push-notification-how-to-show-multiline-message-in-notification
I have extended your plugin therefore. I added the BigTextStyle as a style for Android.
Could you give me the permission to push my adjustments into the master?
I have already tested my adjustments. I've already pushed the adjustments in my fork.
I would like to share my adjustments.

Here are my changes:
local-notifications-common.js

LocalNotifications.defaults = {
id: 0,
title: '',
body: '',
badge: 0,
interval: 0,
ongoing: false,
groupSummary:null,
bigTextStyle: false
};

local-notifications.d.ts

export interface ScheduleOptions {
...
bigTextStyle?: boolean;

local-notifications.android.js

LocalNotifications.schedule = function (arg) {
...
if(options.bigTextStyle){
var bigTextStyle = new android.support.v4.app.NotificationCompat.BigTextStyle();
bigTextStyle.setBigContentTitle(options.title);
bigTextStyle.bigText(options.body);
builder.setStyle(bigTextStyle);
}

Best regards
Tim

ReferenceError: Can't find variable: Notification

I'm getting this error. I tried ading and removing ios platform and , using tns run but still getting same error. any Ideas?

    "tns-ios": {
      "version": "2.5.0"
    }



  "dependencies": {
    "@angular/common": "2.2.1",
    "@angular/compiler": "2.2.1",
    "@angular/core": "2.2.1",
    "@angular/forms": "2.2.1",
    "@angular/http": "2.2.1",
    "@angular/platform-browser": "2.2.1",
    "@angular/platform-browser-dynamic": "2.2.1",
    "@angular/router": "3.2.1",
    "clone": "2.0.0",
    "email-validator": "1.0.7",
    "moment": "2.15.2",
    "nativescript-angular": "1.1.3",
    "nativescript-appavailability": "^1.2.0",
    "nativescript-appversion": "1.3.2",
    "nativescript-clipboard": "1.1.5",
    "nativescript-directions": "1.0.2",
    "nativescript-fancyalert": "^1.1.2",
    "nativescript-iqkeyboardmanager": "1.0.1",
    "nativescript-local-notifications": "1.1.8",
    "nativescript-phone": "1.2.3",
    "nativescript-pulltorefresh": "1.1.8",
    "nativescript-timedatepicker": "1.0.0",
    "reflect-metadata": "0.1.8",
    "rxjs": "5.0.0-beta.12",
    "tns-core-modules": "^2.5.0-2016-12-07-4948"
  },
  "devDependencies": {
    "babel-traverse": "6.9.0",
    "babel-types": "6.10.0",
    "babylon": "6.8.1",
    "filewalker": "0.1.2",
    "gulp": "^3.9.1",
    "gulp-clean": "^0.3.2",
    "gulp-replace": "^0.5.4",
    "lazy": "1.0.11",
    "nativescript-dev-sass": "^0.1.0",
    "nativescript-dev-typescript": "^0.3.2",
    "typescript": "2.0.10",
    "zone.js": "^0.6.21"
  }

Project successfully built
Successfully deployed on device with identifier 'C3EF9E34-AAD3-40AD-B15F-1D1382B079AC'.
1   0x1068ce33c -[TNSRuntime executeModule:referredBy:]
2   0x106421549 main
Feb  1 08:58:41 HEILAP66 nativehealthsignal[49216]: 3   0x10aae792d start
Feb  1 08:58:41 HEILAP66 nativehealthsignal[49216]: 4   0x1
file:///app/tns_modules/nativescript-local-notifications/local-notifications.js:26:37: JS ERROR ReferenceError: Can't find variable: Notification
Feb  1 08:58:41 com.apple.CoreSimulator.SimDevice.C3EF9E34-AAD3-40AD-B15F-1D1382B079AC.launchd_sim[48795] (UIKitApplication[0xc932][49216]): Service exited due to signal: Segmentation fault: 11


Disable App Idle State

Hi,

If app goes to background state, after some time app will reach the idle state. How to stop the app that reaches idle state and remains in the background state. Please help us to achieve this.

Thanks & Regards,
Mani

module not found

I am trying to use this plugin with NativeScript 2 and typescript but I got error telling that the module is not found

Angular nativescript - android

Hi,

It is a way to use it with angular? I've tried to define it in main.ts file, in one in my compontent and event if LocalNotification as a module works fine (I can schedule a notification, get ids of already scheduled etc) but in any case I can`t get application after closing my app :/

Notifications fails to schedule with Workers [Android]

I'm currently using a worker to schedule local notifications it works fine on IOS but fails with the following log Error in LocalNotifications.schedule: TypeError: Cannot read property 'getResources' of undefined on Android

Stopped working after upgrade to xcode 8.2

I upgraded to xcode 8.2 and pods 1.2.0, and now the app crashes when calling;

		LocalNotifications.requestPermission();

Feb 23 12:47:14 com.apple.CoreSimulator.SimDevice.D77BFD9C-7748-4857-9A08-4F8F4F0D8838.launchd_sim[81199] (UIKitApplication:com.xyz.test[0x2be6][84445]): Service exited due to Segmentation fault: 11

Thanks

LocalNotifications.addOnMessageReceivedCallback not called if app was stopped

I've been trying to figure out this for quite some time. The plugin works very well, but in this scenario I can't seem to make it work.

  1. Schedule a local notification
  2. Stop the app (remove from running in Android/iOS)
  3. Notification appears in the notification bar (both Android & iOS)
  4. Click on notification starts the app
  5. LocalNotifications.addOnMessageReceivedCallback is not called

Versions:
{N} 2.5.0
Plugin: 1.2.1

LocalNotifications.addOnMessageReceivedCallback(data => {
  alert('Id: '+data.id+' Title: '+data.title);
})

// Do I need to register it before or after is ok as well?
platformNativeScriptDynamic().bootstrapModule(AppModule);

The scenario I have requires to get notification data in order to show other screen then home.

Unable to get notification icon

  LocalNotifications.schedule([{
    id: 1,
    title: 'The title',
    body: 'Recurs every minute until cancelled',
    ticker: 'The ticker',
    badge: 1,
    smallIcon: 'res://heart.png',
    interval: 'minute',
    sound: null, // suppress the default sound
    at: new Date(new Date().getTime() + (10 * 1000)) // 10 seconds from now
  }]).then(
      function() {
        console.log("Notification scheduled");
      },
      function(error) {
        console.log("scheduling error: " + error);
      }
  )

Snapshotting a view that has not been rendered results in an empty snapshot.

On ios, when I press the home button to send the app to the background, I get this in the console:

 Snapshotting a view that has not been rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates.

Even if all I do is require the plugin it still happens:

var notifications = require("nativescript-local-notifications");`

Any ideas what is going on here?

Otherwise, notifications are working, but there is one strange behavior, which I also mentioned in #1. Could it be related?

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.