Re: Issues with applications running on background (Alarm Application)
Re: Issues with applications running on background (Alarm Application)
- Subject: Re: Issues with applications running on background (Alarm Application)
- From: Claudio Maximiliano Edison Bastos Iorio <email@hidden>
- Date: Wed, 17 Dec 2014 03:37:00 -0300
Hello again,
I’m able to keep my App alive on the background using beginBackgroundTaskWithExpirationHandler. However, now I’m not able to resume my app to the foreground. So, my question now is.. : Is it possible to wakeup/resume an iPhone application from background mode to foreground mode programmatically? How?
Thanks in advance,
> On Dec 17, 2014, at 12:55 AM, Claudio Maximiliano Edison Bastos Iorio <email@hidden <mailto:email@hidden>> wrote:
>
> Hi Jens, thanks for your response.
>
> soundName property is OK, and allows to use any embedded sound. But there’s no way to load any custom view dispatched right from the LocalNotification, at least no with a previous user interaction.
>
> I’ve just found UIApplication’s beginBackgroundTaskWithExpirationHandler, who allows me to run a background task.
> Based on Apple, the purpose of this background task is for instance to complete a server request when the app goes to background.
>
> I still need to check if this is a proper solution, however, I wonder if Apple will allow me to use this task to keep my Application running on the background. Do you guys have any idea about that?
>
> Thanks in advance,
>
>
>> On Dec 16, 2014, at 5:35 PM, Jens Alfke <email@hidden <mailto:email@hidden>> wrote:
>>
>>
>>> On Dec 16, 2014, at 11:49 AM, Claudio M. E. Bastos Iorio <email@hidden <mailto:email@hidden>> wrote:
>>>
>>> · I’ve started by using UILocalNotification, however, when my app
>>> goes to background, I’m receiving the scheduled Notification, as expected,
>>> but I didn’t find a way to load my custom image or playing the custom
>>> sound.
>>
>> UILocalNotification has a soundName property. I don't know a way to set a custom image (is that possible?) but I'm not an expert on notifications; I just read through the header and looked at the available API.
>>
>>> · I’ve also tried to use a NSTimer and iterate an array of alarms.
>>> This approach works while my application is on the forground. But as soon
>>> as it goes to background, the timer stops.
>>
>> Right. That's not going to work, because your application stops running when it goes into the background. iOS does this to conserve battery power. Read Apple's documentation about the app lifecycle.
>>
>> —Jens
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden