Titanium.App.iOS.LocalNotification doesn't fire after 20 mins in background - ios7

I have a timer made in Titanium (3.1.3) for iOS 7. I want it to fire a notification when the timer is finished. It works perfectly until the app is placed in the background for more than 20 minutes. If the app is placed in the background for more than 20 minutes, the user don't get any notification.
This is my code:
var notification = Ti.App.iOS.scheduleLocalNotification({
alertBody:L('timer_finished_alert_title'),
badge:1,
sound: notificationSound,
date:new Date(new Date().getTime() + timeLeft)
});
How can I fire this notification if the user has left the app in the background for more than 20 minutes (timeLeft > 1200000)?

That is a limitation of iOS Background Service in Titanium.
From the documentation
Background Service Limitations
A background service is subject to limitations imposed by the operating system, such as
The OS limits the total amount of time a background service can run for after the application is paused, typically to no more than 10
minutes.
The OS may terminate the background service at any point to reclaim resources.

Related

Background Location Services after reboot in iOS 7

I'm interested in a border line iPhone app able to detect the user location continuosly.
The app will be delivered in enterprise mode (so no Apple approval).
Basically it should run forever (resetting the backgroundTimeRemaining through the location service start end stop).
the issue that I was not able to fix is to relaunch the app after a reboot, event if I declare the voip capability, it seems that the system give me only 3 minutes, no more time despite all the workarounds.
so actually I'd like to know if someone was able to implement this sort of behaviour on iOS7.
thanks in advances, please find below some references.
iPhone - Backgrounding to poll for events
to run app continuously in the background
Background Location Services not working in iOS 7
Start Location Manager in iOS 7 from background task
ok, I got it.
the music hack is the solution.
During the further 180s of background time a small mute playback of few seconds (of local mp3) restart the backgroundTimeRemaining counter.
bye

CMMotionActivityManager - Receiving motion activity updates while app is suspended or in background

I've been testing the new Motion Activity Manager APIs (CMMotionActivityManager). I want to create an app that can receive and process motion updates from startActivityUpdatesToQueue while the app is not running in the foreground. I correctly receive motion updates (stationary, walking, running, automotive, unknown) while the app is in the foreground but as soon as it goes into the background (and thus gets suspended), motion updates cease to be received by the app.
CMMotionActivityManager Class Reference:
"This method initiates the tracking of motion data asynchronously. Upon calling this method, the motion activity manager executes the handler block on the specified queue, reporting the current motion in effect for the device. After that, the motion activity manager executes the handler block only when the motion data changes.
The handler block is executed on a best effort basis and updates are not delivered while your app is suspended. If updates arrived while your app was suspended, the last update is delivered to your app when it resumes execution. To get all of the updates that occurred while your app was suspended, use the queryActivityStartingFromDate:toDate:toQueue:withHandler: method."
I want a way to keep my app running in the background and receive motion data (real-time). Right now the only way to keep the app running in the background is to use background services but "motion updates" is not in the list of allowed background services:
App Store Review Guidelines:
"2.5.4 Multitasking Apps may only use background services for their intended purposes: VoIP, audio playback, location, task completion, local notifications, etc."
I don't want to have Location Updates (GPS) on all the time (to save battery). If I bank on continuous location updates but switch the GPS off, the app will get suspended.
Please let me know how to keep my app running in the background and receive motion activity updates.
There must be a way to do it: I tried the Strava app....even when the app is in the background, it swithes the GPS off when the user pauses running. When the user resumes running, it automatically turns the GPS on (all this while the app is in the background)...this probably means that the app is running in the background and actively receiving motion activity updates even while the GPS is off.
This is not a new issue. There has never been a Core Motion background usage setting. You are allowed to use Core Motion if your app is running in the background, but to make it run in the background you have to be doing something else (e.g. getting location updates at the time the user sends the app into the background, and you have the location background service listed in your Info.plist.
Note too that in iOS 7 if you have the right hardware you may be able to use deferred location updates to wake your app periodically in the background. Thus you save power but your app gets to run in the background now and then without an Info.plist background service listing.

Windows 8 app tile periodically update when it's not running

I've a app called 'drumtime' installed on Windows 8. It's tile is being changed/updated on every about 10 seconds. This couldn't be done with Background tasks I guess because a background task needs 15 minutes to be executed. But even if the app is not running, it's tile is still being updated.
after 10 seconds =>
So, how can I update an app's tile on every 10 seconds even when the app itself is not running?
I appreciate any help.
I downloaded Drumtime to check this out, and it is using a peek animation on its live tile. Check out the list of available tile templates. Some of these are "peek" templates which animate smoothly between two different tile templates. That is what Drumtime is doing. I used a peek animation in the tile of an app of mine; I wrote this article with details.
Here is MSDN sample of updating tile in every minute. You can learn the logic. You have to set schedule in such manner the tile gets update in 10 seconds.

Toast notification every 15 seconds

How can I show a toast notification every 15 seconds while the application is in background? DispatcherTimer doesn't work because my app is suspended and background tasks can't run at this frequency.
You can use a Background Task to do toast notifications, but the minimum interval is 15 minutes.
Michael

iOS 4 resume from background

It is possible to get a notification or something when the user opens the application, but the application was in the background (so it wasn't closed)?
Your App Delegate will have its function applicationWillEnterForeground called before coming back.
Also, the OS will have queued a series of potential notifications for significant OS changes if it were freeze dried when those events were fired, ie: UIApplicationSignificantTimeChangeNotification and UIDeviceBatteryLevelDidChangeNotification