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 full-size slide

  2. ! Apple TV & tvOS

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  5. 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 full-size slide

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

    View full-size slide

  7. Core Bluetooth is Available! ㊗

    View full-size slide

  8. Restricted
    Act as Central. not peripheral
    2 devices

    View full-size slide

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

    View full-size slide

  10. CBCentralManager Peripheral

    View full-size slide

  11. Communicate with iOS/Mac Apps

    View full-size slide

  12. CBCentralManager CBPeripheralManager

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  16. Restricted
    Act as Central. not peripheral
    2 devices

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  19. 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 full-size slide