Upgrade to Pro — share decks privately, control downloads, hide ads and more …

tvOSを拡張する

 tvOSを拡張する

#potatotips

Noritaka Kamiya

November 24, 2015
Tweet

More Decks by Noritaka Kamiya

Other Decks in Programming

Transcript

  1. extension AppleTV {
    }
    tvOSΛ֦ு͢Δ
    @nolili
    Noritaka Kamiya

    View Slide

  2. View Slide

  3. View Slide

  4. View Slide

  5. ! Apple TV & tvOS

    View Slide

  6. View Slide

  7. View Slide

  8. View Slide

  9. View Slide

  10. View Slide

  11. View Slide

  12. " 10-foot user interface
    Siri Remote #
    Keyboard/Web Experience $

    View Slide

  13. 200MB Max, No Storage, No Web Views:
    Is tvOS the Future of Apps?
    https://realm.io/news/is-tvos-the-future-of-apps/

    View Slide

  14. Handoff is *not* supported in tvOS. The NSUserActivity
    class will be marked as unavailable in the next
    documentation release.
    https://forums.developer.apple.com/thread/16962

    View Slide

  15. • Handoff %
    • Multiple connectivity %
    • Keychain Sharing %

    View Slide

  16. Core Bluetooth is Available! ㊗

    View Slide

  17. Restricted
    Act as Central. not peripheral
    2 devices

    View Slide

  18. Apps Communicate with Bluetooth LE Devices
    • Wearable(HeartRate Monitor, Bike Speed Cadence…)
    • Home(Not HomeKit)
    • …etc

    View Slide

  19. CBCentralManager Peripheral

    View Slide

  20. Communicate with iOS/Mac Apps

    View Slide

  21. CBCentralManager CBPeripheralManager

    View Slide

  22. View Slide

  23. Be aware
    •MTU (20 bytes)
    • Low level I/O programming is required
    • JSON is too heavy
    • Async Hell...

    View Slide

  24. *OEFY ʜ
    $POUFOU )FBEFS 0CKFDU*% ʜ ʜ
    %BUB Y Y Y Y Y ʜ ʜ
    Packet Structure(example)

    View Slide

  25. CBMutableCharacteristic(type: TVMessageCharacteristic.UUID,
    properties: .Write, value: nil, permissions: .WriteEncryptionRequired)
    Encryption pitfall
    x

    View Slide

  26. View Slide

  27. Restricted
    Act as Central. not peripheral
    2 devices

    View Slide

  28. Be aware
    •MTU (20 bytes)
    • Low level I/O programming is required
    • JSON is too heavy
    • Async Hell...

    View Slide

  29. extension AppleTV {
    }
    tvOSΛ֦ு͢Δ
    @nolili

    View Slide

  30. References
    “CoreBluetooth is indeed available on this platform. “
    https://forums.developer.apple.com/thread/17457
    “CoreBluetooth only allows 2 accessories on tvOS.
    If you want to attach more devices, you may want to look at using Bonjour over the Wifi or ethernet network.”
    https://forums.developer.apple.com/thread/18751
    Core Bluetooth Framework Reference
    https://developer.apple.com/library/tvos/documentation/CoreBluetooth/Reference/CoreBluetooth_Framework/
    Bluetooth Low Energy: The Developer's Handbook
    https://www.safaribooksonline.com/library/view/bluetooth-low-energy/9780132888394/
    Sample Code: BluetoothExampleTV
    https://github.com/nolili/BluetoothExampleTV
    BTLE Central Peripheral Transfer
    https://developer.apple.com/library/ios/samplecode/BTLE_Transfer/Introduction/Intro.html

    View Slide