问题描述:

How is user activity info transferred in Handoff? The doc suggests that larger-scale data synchronization is handled via iCloud but doesn't say what mechanism is used for small data.

网友答案:

From what I understand all of Handoff's communication is done via Bluetooth LE. The only interaction with iCloud that I've read about is the requirement that both devices are logged in with the same iCloud account.

If you're interested in learning more about it definitely check out Adopting Handoff on iOS and OS X from this year's WWDC session videos.

网友答案:

For larger amounts of data, you can use continuation streams between the two devices. For example:

[userActivity getContinuationStreamsWithCompletionHandler:^(
                        NSInputStream *inputStream,
                        NSOutputStream *outputStream, NSError *error) { 
                          // your code
                        }
网友答案:

For small data you can just pass an NSDictionary "userInfo" from device to device. There are a limited amount of object classes you are allowed to store in userInfo. For more information about this NSDictionary check the dev docs out

相关阅读:
Top