Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70867

About LocalNotifications in Ionic-Native

$
0
0

@Palaniappan wrote:

Hi, I have a basic question, when i try to use the local notification from ionic native, i couldn't retrieve the promise from the LocalNotification.schedule() function.
Is this a wrapper function to the existing cordova plugin or is it different. Since from the ngCordova documentation which i used on ionic1, i see a promise / a return function from functions like schedule, but when i was checking for a promise in my current project TS file, it just reported ""Error TS2339: Property 'then' does not exist on type 'void'.""
When i remove the then function my notifications are getting triggered. But not sure what's happening here.

This is what i was trying to do (TS):

LocalNotifications.schedule({
id:notificationId,
at: alarmTime,
text:"Time to checkout",
title:"Hello there!!!",
icon:'/img/img.png'
}).then((result) => {
console.log("result from notification:",result);
});

Similar to this existing wrapper from ngCordova:
$cordovaLocalNotification.schedule({
id: 1,
title: 'Title here',
text: 'Text here',
at: _10SecondsFromNow
}).then(function (result) {
// ...
});
Thanks
Suresh

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70867

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>