5

我正在实现 iOS 和 Mac 应用程序。我在两个应用程序中都实现了 Hand Off 功能。当我测试实现时,它在以下情况下运行良好:

  • 在 iOS 应用上开始并在 iOS 应用上继续
  • 从 iOS 应用程序开始并在 Mac 应用程序上继续

但是当我开始使用 Mac 应用程序并想继续使用 iOS 应用程序时它不起作用。从逻辑上讲,问题出在我在 Mac 应用程序上创建 userActivity 和 becomeCurrent 时。但是iOS和Mac的代码是一样的,所以不知道问题出在哪里。

// Create userActivity
_userActivity = [[NSUserActivity alloc] initWithActivityType:@"com.myapp.image"];
_userActivity.title = @"Image";
_userActivity.supportsContinuationStreams = YES;
_userActivity.delegate = self;
_userActivity.userInfo = @{
                           @"Key" : @"information from the other device",
                           @"URL" : @"http://www.apple.com"
                           };
[_userActivity becomeCurrent];

谢谢!

4

1 回答 1

0

我提交了 ID 为 41374510 的错误报告,标题为:Handoff doesn't work from MacOS to iOS。

我用相同的代码从 iOS 到 MacOS 反向测试了它,效果很好,所以我假设它是 Apple 的错误。

于 2018-06-22T18:16:39.223 回答