observe osx application's state(opening, quitting) - objective-c

how can I get notified at my app while the specify application is opening or closing?
for example, I need do something in my app when iTunes is quitting.

Subscribe to the NSWorkspace notifications NSWorkspaceDidLaunchApplicationNotification and NSWorkspaceDidTerminateApplicationNotification.

Related

IOS7 iBeacon: How to launch app when detect a beacon(app not running)

I have managed to implement CLLocationManagerDelegate and in didDetermineState I can send a notification when the app is not running.
Now I want is to launch the app immediately as soon as it enters a particular region. How could I do that?
Thanks heaps in advance!
You cannot launch the app UI when a beacon is detected because of iOS restrictions. The closest you can do is to send a local notification on beacon detection, giving the user a message and allowing the user to choose to launch the app UI by tapping on this notification.
See here for a more detailed explanation:
Can I launch an app in Foreground when I enter an iBeacon range?

Skype push notification "[person] is calling..." disappears when call ends - how to do that?

If iPhone is locked and somebody calls on Skype, push notification appears.
I think it's simple push notification as other app servers send.
But when the call ends (and we didn't respond, so the call is missed) push notification disappears from lockscreen! It is not stored in notification center nor recent notifications list on lockscreen.
So how to do this?
How to implement calling of push notifications?
Does Skype have special priveleges or is it also available for regular developer to implement?
No they don't. Skype uses voip and Apple allow apps that use location, voip and audio to run in background, so Skype is set in the AppName-Info.plist file Required background modes to voip and what you see is not a push notification, but a local notification controlled by the running app.
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
It will remove notification. So any app can do it.

UIAlertView outside app

On iOS which is the class name used to show UIAlertView outside the application, like the notification system does?
Thanks!
You'll need to use local notifications, or setup apple's Remote Push notification service.
Local Notifications
Push Notifications

Any other local or push Notification detection while application running

I want to know that is there any way that when my application keeps running. And device receive any type of local or push badge notification then my application will give a custom alert. That an application received a notification.
Your application can only respond to notifications meant for it... it can do nothing about notifications received by other apps...

How to enable-disable Notifications in settings app using sdk?

I want to use push notification in my app so first time it launches it will automatically ask for notification.So i want to enable-disable push notification settings for my app programmatically.Note-I do not want to unregistered my app just disable Alert,badge,Sound for my app in settings app.
You can't do this via the SDK. You'll have to inform the user that your app requires push notifications turned on, and then they'll have to go to Settings and turn it on themselves.
Apps have no control over the phone's settings, only its own.