How to execute the functions when app is killed in Ionic1


I want to make an alarm app without using local or remote push notifications.How to achieve this , currently I am trying it using interval.


You can’t. If the app is not running, there is no way for it to run any code. You can only trigger it from the outside via push notifications.


Thanks for the reply , so is it impossible to make a alarm app using Ionic ?


It is pretty much impossible to do what you asked for at all without special proviledges for your app - like the official alarm apps. You can look into background mode and processes, services, but that will be quite painful with Ionic/Cordova.


You need to be thinking in terms of notifications.

I believe (though never done it) you can have the device send notifications to itself, or a remote service pushing the notification.

Think Google Calendar for example.

I’m an Ionic 3 guy so can’t offer much advice other than - look at this plugin…