4

Having watched the WWDC video I'm keen to adopt handoff in one of my apps, the concept looks easy but the handoff's are not appearing on my other devices, other Apple handoff's are working. I'm guessing my problem relates to the entries in my info.plist file, are there any demo projects that show how to implement handoff? I've searched and failed to find anything.

Duncan Hill
  • 547
  • 2
  • 5
  • 16
  • https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html – Hemang Sep 12 '14 at 09:20

1 Answers1

2

According to the documentation the plist for a document based app should look like this :

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeName</key>
        <string>NSRTFDPboardType</string>
            . . .
        <key>LSItemContentTypes</key>
        <array>
            <string>com.myCompany.rtfd</string>
        </array>
            . . .
        <key>NSUbiquitousDocumentUserActivityType</key>
        <string>com.myCompany.myBrowser.browsing</string>
    </dict>
</array>

and for a non-document based app:

<key>NSUserActivityTypes</key>
<array>
    <string>com.myCompany.myBrowser.browsing</string>
</array>

And the implementation like this :

NSUserActivity* myActivity = [[NSUserActivity alloc]
    initWithActivityType: @"com.myCompany.myBrowser.browsing"];
myActivity.userInfo = @{ ... };
myActivity.title = @"Browsing";
[myActivity becomeCurrent];

Sources : https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/Handoff/HandoffProgrammingGuide.pdf

ccjensen
  • 4,578
  • 2
  • 23
  • 25
Nicolas Charvoz
  • 1,509
  • 15
  • 41