eddyverbruggen / nativescript-local-notifications Goto Github PK
View Code? Open in Web Editor NEW:mailbox: NativeScript plugin to easily schedule local notifications
License: MIT License
:mailbox: NativeScript plugin to easily schedule local notifications
License: MIT License
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 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
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?
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)
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.
process 'command' c:\program files\java\jdk\bin\java.exe '' finished with non-zero exit value 1
anyone knows whats wrong???
couldn't figure it out???
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?
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
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 :(
No notification sound on ios.
we get notifications but not the sound.
core modules @ 2.2.0
ios runtime @ 2.2.0
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
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
Hello,
Is there a chance to force show a local notification even though the app is being in foreground? Right now notification is not shown and instead onMessageReceived
callback is invoked immediately (iOS).
Thanks!
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?
When I run schedule in iOS Simulator v.9.2, the app crashes with error "Service exited due to signal: Segmentation fault: 11".
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);
}
)
+1
Notification error:TypeError: Cannot read property 'localnotifications' of undefined
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
Hi,
Problem:-
When we set some custom audio sound file to "nativescript-local-notifications", we are not getting local notification sound. If we didnt set any custom audio sound file, we are getting default notification sound. Please help us to resolve this.
Platform:-
iOS
Hi,
in my project (plain vanilla nativescript, not Angular2) i am trying to use this plugin, but it throws that error... I tried the demo of the plugin and it works...
I think i did all right: require("nativescript-local-notifications"), ask permission and then schedule..
nativescript 2.3.0 (the project is android 5.1.1)
Some ideas ? Thanks in advance
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.
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"
}
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))
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
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
Hello.
Thanks for your excellent work.
Test demo works well in ios,but in android,when the app is closed,notification does not happen.
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
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.
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?
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%"
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?
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
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?
Dear Eddy,
Any chance to have it for Phonegap Build?
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
Great work. Would be great to have custom notification sounds :)
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
I try use webpack and after command npm run start-android-bundle
got the error: not find module nativescript-local-notifications
.
For correct compilation I replace in package.json
property main
from "main": "local-notifications.js",
to "main": "local-notifications",
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
I am trying to use this plugin with NativeScript 2 and typescript but I got error telling that the module is not found
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 :/
Just a hint:
The "local-notifications.d.ts" file is missing "smallIcon?: string;" and "largeIcon?: string;" in the ScheduleOptions interface.
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
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
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.
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.
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);
}
)
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.