I have gone through many posts.
Its bit confusing to understand that does ionic 2 app send local-notification even if my-app-is-killed-by-user or not ?
I have below scenario.
Assuming that app-is-killed-by-user
Can we run the app in background (like after 24 hours check if some conditions are true by manipulating local/cloud storage) then send local notification ?
I am new to ionic 2. So can anyone let me know that above scenario is possible ?
If not possible then let me know that can we manipulate (get and analyse) local-storage via push notification server (assuming that app-is-killed-by-user) ?
Both are possible. I'll tell you how i would do them and not share code (it can be long), i'll give you the steps and you can figure it out.
For the first scenario you'll need LocalNotification plugin
, LocalStorage
, Platform
import from 'ionic-angular' and MomentJS
(not required, but highly recommended).
app.components
. Platform
methods to verify and set the LocalNotification
, they're .pause
, .resume
and .ready
. Moment().add(1, 'day').unix()
and use the result in the 'at' of your schedule. this.storage.set('Daily', ReturnedID);
The second scenario is a little bit harder and you'll need a back-end for this since you'll need to keep checking the time that user has gone off the app. You'll need only MomentJS
, the Platform
import, you push service plugin and a way to connect to your database (via Http or plugin, if it's a service like Firebase).
Sorry i can't share some code, but if you need furter explanation or ideas just ask. Hope this helps :D
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.