iPhone/iPod Touch sync notifications - iphone

I know that it's possible to add an observer for notifications with the com.apple.iTunes.playerInfo identifier, but this only seems to include events for music related events.
I also know I can find out when iTunes closes by adding an observer for NSWorkspaceDidTerminateApplicationNotification.
But is there an NSNotification for the start/finish of iPhone syncing with iTunes?
Just to be clear, my question is about what happens on a Mac not on an iPhone.

Related

Programmatically notification on apple watch. (WatchOS 3)

How I can programmatically make the notification appear only on the apple watch and only when the event occurs. I searched for a long time on the Internet and in the documentation but did not find the answer
There is no way for you to decide whether the notification appears on the Watch or on the Phone, the system handles this automatically and you cannot change this behaviour.
The notification only appears on the Watch if all of the below requirements are met:
The connected iPhone's screen is locked
The watch is worn by the user in case WristDetection is turned on
Do not disturb mode is turned off on the Watch

Apple Watch and iphone communication

I am implementing apple watch app with in my existing app.I need to full fill these task between both iphone and watch
1) sending data from watch to iphone Done (by using openParentApplication).
2) getting call back also done (using openParentApplication call back method)
3) I need to get apple watch notify when user click on a button on iphone app .I have implemented reverse functionality using openParentApplication.
I stuck how to update apple watch UI after user click on any button or any particular task happen on iphone app.
Please let me know is there any way to perform passing event and data from iphone to apple watch
Please use this link https://github.com/mutualmobile/MMWormhole for communication between iphone and watchKit.
You should checkout the new WCSessionDelegate is watchOS 2.0. It can be implemented on both the Apple Watch and contains multiple methods for sending data back and forth between the two devices. Detailed information can be found in the WWDC video Introducing Watch Connectivity

Watchkit - How to schedule notification only for Apple Watch?

I have created an App with Apple Watch extension.
I would like to know if it's possible to schedule a notification that only appears on the Apple Watch. And conversely, can we schedule a notification to only appear on the iPhone?
This is a great question, but unfortunately it is not possible at this time. Apple is trying to be very pragmatic about how they direct notifications. If you iPhone is unlocked, they assume you are looking at it and will route notifications there. If you iPhone is locked, then all notifications will be routed to your Apple Watch. They want to avoid duplicated notifications in both locations at all costs.
Currently there is no ability to force route remote or local notifications directly to the Watch only. If you feel strongly about this feature, then I would suggest you file an enhancement radar with the Apple Bug Reporting System.
In the official Apple documentation they said that:
Apple Watch takes full advantage of the existing interactive
notification support on iOS. If your iOS app supports notifications,
Apple Watch displays those notifications at appropriate times. When
one of your app’s local or remote notifications arrives on the user’s
iPhone, iOS decides whether to display that notification on the iPhone
or on the Apple Watch. For notifications sent to Apple Watch, the
system lets the the user know subtly that a notification is available.
If the user chooses to view the notification, the system displays an
abbreviated version of the notification first, followed by a more
detailed version. The user can dismiss the detailed notification,
launch your WatchKit app, or act on the notification by tapping an
available action button.
https://developer.apple.com/library/ios/documentation/General/Conceptual/WatchKitProgrammingGuide/BasicSupport.html
So I think you can tell to iOS the behavior of your notifications (When one of your app’s local or remote notifications arrives on the user’s
iPhone, iOS decides whether to display that notification on the iPhone
or on the Apple Watch. For notifications sent to Apple Watch, the
system lets the the user know subtly that a notification is available.)

How do i start a watch kit notification?

Im creating a app and i would like know how to start a notification to apple watch from apple watch and from iphone to apple watch
I thought local and remote notification could anyone help me????
Do you mean notifications to test your app? Or notifications in general? For notifications in general, I think (but I'm not 100% sure tough) that right now you can't choose where a notification appears, and that both local and remote notifications received by the containing iPhone app will be displayed by Apple Watch (and you can customise their behaviour and style).
To test notifications on Apple Watch, edit the scheme of your watch app and choose to display a notification from a .apns file.
Notification (local or remote) will be appeared on your Apple Watch device as it is paired with your iPhone, iPhone is locked and watches are on your wrist.
To handle incoming notifications on your WatchKit App you should create a Notification Interface Controller in your WatchKit App target's storyboard.
First it will be as a static interface. Also you can add the dynamic one and create a subclass of WKUserNotificationInterfaceController in WatchKit Extension. Link this subclass with the storyboard dynamic notification controller in Identity Inspector pane.
After all you should implement next methods in your subclass:
- (void)didReceiveLocalNotification:withCompletion:
- (void)didReceiveRemoteNotification:withCompletion:
Hope it helps!
in completion with x401om awnser :
you can't fire a local notification from apple watch to iPhone. in fact you can't choose to :
Senario 1 : The user have the phone non-locked, the notification (local or push) is always delivered to the iphone, and not the watch
Senario 2 : The iphone is locked and watch is on you're watch, and you have done some local or push notification (for local at an date and time) then the apple watch recieve the notification.

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.