Question regarding iphone allowance of custom notifications - iphone

I have an app that I am working on, and part of its main functionality is to alert the user to do something. So even though they aren't in the app, I want to be able to pop up an alert from the app, reminding them to do something. Is that allowed with the iPhone sdk? Maybe it isn't even a big deal at all, but for some reason I was thinking that it would require background processes or something that may or may not be possible. Anyone who has any thoughts about how this would be implemented would be greatly appreciated. Thanks!

Check out the Apple documentation on push notifications. Short of jailbreaking and distributing your app outside the App Store, there is no way to run background processes at this time.

It is allowed through notifications, though you will need a server to actually send the notifications to the user. There is no limit to the number you can send, although the user may very well decide to shut off notifications or delete your app altogether if you are too spastic with them. Make very sure the user understands the notification volume they will receive and agrees to it...
The way the system works is the user gets a notification message (and/or sound) and can decide to open your app or not, as the time of notification.

Related

Request to server when app in background

I need that my app will send some data to server every six hours for example. Purpose is that it will send request to server even when app in background. As I know only thinks GPS, Music, Push Notifications work on background. Also, as I know UIApplication method beginBackgroundTaskWithExpirationHandler: works not for a long time after app goes on background. Guys, anybody have idea how to implement this? Thanks a lot!
It's simply not possible within the limits of the current iOS SDK. The only kind of apps that can update their content regularly from the background are Newsstand apps and for them, the interval is 24 hours AFAIK and the entire updating process is largely triggered by Apple.
Unless your app falls into one of the categories you mention, the short answer is you can't. The only exception is for Newsstand apps.
But: what data would you be sending to the server if your app isn't running? If you send data to the server when something happens then the server will always be up-to-date. If the user isn't running the app then, by definition, nothing has happened and the server is still "in sync" with the client. (Yes, this potentially makes the server harder to code.)

iPhone background operations/daemon with live chat module. Keeping the app alive?

I am building a live chat app for the iPhone, and for this it is necessary to ensure that the operator is online and to keep the flow of data going.
After much search it seams to be only two options for similar kind of behavior;
UILocalNotification, only works if I have some scheduled information notice to be sent
Push Notification, for pushing data to the phone
The problem with push notification seams to be that I cannot ensure that the user is available, or in any way talk with the app without the user re-opening it. This way it seams impossible for me to know if the user is online, to update data in the app without the user having to manually open it, etc.
So, what I ask for, is it in any way possible to keep the app active in the background thus ensuring the operator is online and notify of incoming chat sessions?
Thanks a lot for your help guys!
Unfortunately the answer is no. I take it you mean text chat and not VoIP (which CAN run in the background)? Your best bet would be Push Notifications, as you would not be able to monitor anything from the app itself when it is in the background.

iPhone background notifications

I'm making an iPhone app. I can receive UDP messages using AsyncUdpSocket. I want the app running in background, and when receive a message, an UIAlertView is displaying to the user, and he can enter in the app, or ignore the alert.
Is it possible to detect a message when the app is running in background.
Do I need something to execute my code in this method?
- (void)applicationDidEnterBackground:(UIApplication *)application {
}
I saw lot of tutorials, with timer, but I don't need timer to wake up my app. Also I read that's it's possible while playing music, tracking position or using VOIP.
Do I need to play a fake song to keep my app running? or to do something like that?
This app is for security, for example if someone is touching or moving your motorbike/computer/whatever else, your iPhone can alert you and prevents from stealing.
I read other threads similar but didn't find an answer.
Thank you guys for giving me tips, or any help /sample.
You can't run in the background on a non-jailbroken phone without being in one of those three categories of app, and Apple’s really unlikely to approve your app if you use that facility for another purpose. UDP probably isn’t the best solution for this anyway—if your phone leaves the network that the other device (whatever it is) is on, it won’t receive the notification at all, whether or not it’s in the foreground. You’re probably a lot better off using the push notification API.
This seems like a perfect case to use Apple Push Notifications (APN). You app can register to receive the notifications and the phone will alert the user with any combination of badging, messages, or sounds. Sounds like you already have a server that is sending the UDP messages, so incorporating APN should be minimal. Especially if you use a third-party to send the push notification, such as Urban Airship. (I am not affiliated with them, but have used them on a large commercial project.)
By definition, local events are not triggered by receiving a message.

iPhone - how to be notified of call completion

I'm developing an application that needs to take action on completed phone calls, preferably right after the call ends but minimally once per day.
I've read up on the new CoreTelphony framework, and it seems I can get call events if my app is active, but I don't see how to launch/wake my app when a call ends if my app is not the foreground app. I also don't see how any of the new pseudo-background "modes" would allow my app to listen for these events in the background. Do any of you know how this might be done?
If post-call processing isn't possible, then I'd like to figure out a way to automatically wake my app up once per day, pull all of the call events since the last wakeup, and process them. I know how I might do this with Push or Local notifications, but my understanding is that those require user action to continue; in this case, I just want the processing to happen automatically. Is there a mechanism that would enable this?
Thanks,
Dan
You can't launch your app without user interaction.
Push / Local notifications aren't for this kind of thing, they're for letting the user know about event.
On a non-jailbroken device there is no way to do what you want to do.

Can I use Push Notification for this

My app should post some message to Twitter at the end of each day at the time X. App might not be running at this time X, but it still has to post that message. I don't want to bother user by everyday asking to do this task.
Can I use Push Notification to silently (without any alert view popup, sound or anything else) do some task in my app in some constant time everyday even if it's not running?
thx
There are three 'notification' mechanisms you can send via push: alerts, sounds, and badge values. The way the push notification works is that on the phone it launches the app and hands over the 'push payload' to it with those values. Even if you turn off all three mechanisms, the OS will still have to launch your app each time, which means the user will get interrupted.
In short, you can't have a push happen silently. I doubt, from a user-experience point of view that Apple will allow things to happen on the phone without the user getting notified somehow.
No.
You can't schedule things to be run by your app on a non-jailbroken iPhone.
The only solution is to have a separately hosted service somewhere to which you push details from your app and that runs the scheduled updates on your behalf.
To do so silently is not up to you. The iPhone device has a configuration in which each app with a Push mechanism has settings where one can specify if they want alerts or not. If set to yes, the text of the alert is displayed as well.
sounds like you are trying to "wake up" your app at a specific time each day to perform some type of task. from what i understand about the iPhone this is not possible. you cannot create a cron job or something that will fire on a time you specify. you can run this on the server side and then push a notification to the user telling them that the message has been posted to twitter.
if you are on a jailbroken phone i feel confident that there is some way to do this.
Given that push notification requires that your server send a notification, why not skip a step and have the server just send the update directly to Twitter on the user's behalf? You can't use push notification to trigger an automatic task on the iPhone like you're asking - the user must take the step of accepting the notification for anything to happen.
if you really want to do it from the phone, you can just declare a "long term" background task should be covered around here (iphone app programing guide) some where..., that way you never go sleep, and you can do what ever you like... :)