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

デバイス管理を App Store Connect API でやってみよう

デバイス管理を App Store Connect API でやってみよう

Shota Kashihara

June 18, 2019
Tweet

More Decks by Shota Kashihara

Other Decks in Technology

Transcript

  1. ©2019 Wantedly, Inc.
    σόΠε؅ཧΛ App Store Connect API Ͱ
    ΍ͬͯΈΑ͏
    potatotips #62
    June 18, 2019 - @kashihararara

    View full-size slide

  2. ©2019 Wantedly, Inc.
    Introduction
    Shota Kashihara
    Wantedly People / iOS

    View full-size slide

  3. ©2019 Wantedly, Inc.
    App Store Connect API ͱ͸
    Introduction

    View full-size slide

  4. ©2019 Wantedly, Inc.
    Introduction
    App Store Connect API ͱ͸
    Ϋϥογϡͷൃੜ৔ॴ΍ɺൃੜܦ࿏Λه࿥ͨ͠ϩά
    https://developer.apple.com/jp/app-store-connect/api/

    View full-size slide

  5. ©2019 Wantedly, Inc.
    Introduction
    App Store Connect API ͱ͸
    Ϋϥογϡͷൃੜ৔ॴ΍ɺൃੜܦ࿏Λه࿥ͨ͠ϩά
    https://developer.apple.com/jp/app-store-connect/api/

    View full-size slide

  6. ©2019 Wantedly, Inc.
    ϓϩϏδϣχϯά͕࢖͑ΔΑ͏ʹͳͬͯͨ
    Introduction
    (͍ͭͷ·ʹ͔)

    View full-size slide

  7. ©2019 Wantedly, Inc.
    ͬͦ͘͞࢖ͬͯΈΑ͏
    Introduction

    View full-size slide

  8. ©2019 Wantedly, Inc.
    Introduction
    ϓϩϏδϣχϯά API Ͱ࢖͑ΔϦιʔε
    - Bundle ID, Bundle ID Capabilities
    - Certificates
    - Devices
    - Profiles
    https://developer.apple.com/jp/app-store-connect/api/

    View full-size slide

  9. ©2019 Wantedly, Inc.
    $ swift package init --type executable
    Introduction
    ͔ͤͬ͘ͳͷͰ Swift CLI Ͱ࡞Δ
    $ mkdir && cd ./

    View full-size slide

  10. ©2019 Wantedly, Inc.
    Introduction
    App Store Connect API Λ࢖͏ 2εςοϓ
    - JWT (JSON Web Token) ͷൃߦ
    - ϦΫΤετϔομʹ Token Λ͚ͭͯ API Λୟ͘

    View full-size slide

  11. ©2019 Wantedly, Inc.
    Introduction
    App Store Connect API Λ࢖͏ 2εςοϓ
    - JWT (JSON Web Token) ͷൃߦ
    - ϦΫΤετϔομʹ Token Λ͚ͭͯ API Λୟ͘
    - GET σόΠεҰཡ
    - POST σόΠε௥Ճ

    View full-size slide

  12. ©2019 Wantedly, Inc.
    Introduction
    App Store Connect API Λ࢖͏ 2εςοϓ
    - JWT (JSON Web Token) ͷൃߦ
    - ϦΫΤετϔομʹ Token Λ͚ͭͯ API Λୟ͘
    - GET σόΠεҰཡ
    - POST σόΠε௥Ճ

    View full-size slide

  13. ©2019 Wantedly, Inc.
    Introduction
    JWT (JSON Web Token) ͷൃߦ
    - Issuer ID
    - Key ID
    - Private Key(.p8)
    IUUQTBQQTUPSFDPOOFDUBQQMFDPNBDDFTTBQJ
    https://appstoreconnect.apple.com/access/api

    View full-size slide

  14. ©2019 Wantedly, Inc.
    Introduction
    JWT (JSON Web Token) ͷൃߦ
    - Issuer ID
    - Key ID
    - Private Key(.p8)

    View full-size slide

  15. ©2019 Wantedly, Inc.
    Introduction
    IBM-Swift/SwiftJWT

    View full-size slide

  16. ©2019 Wantedly, Inc.
    Introduction
    - Issuer ID
    - Key ID
    - Private Key(.p8)
    IBM-Swift/SwiftJWT

    View full-size slide

  17. ©2019 Wantedly, Inc.
    Introduction
    - Issuer ID
    - Key ID
    - Private Key(.p8)
    IBM-Swift/SwiftJWT

    View full-size slide

  18. ©2019 Wantedly, Inc.
    Introduction
    IBM-Swift/SwiftJWT

    View full-size slide

  19. ©2019 Wantedly, Inc.
    Introduction
    App Store Connect API Λ࢖͏ 2εςοϓ
    - JWT (JSON Web Token) ͷൃߦ
    - ϦΫΤετϔομʹ Token Λ͚ͭͯ API Λୟ͘
    - GET σόΠεҰཡ
    - POST σόΠε௥Ճ

    View full-size slide

  20. ©2019 Wantedly, Inc.
    Introduction
    App Store Connect API Λ࢖͏ 2εςοϓ
    - JWT (JSON Web Token) ͷൃߦ
    - ϦΫΤετϔομʹ Token Λ͚ͭͯ API Λୟ͘
    - GET σόΠεҰཡ
    - POST σόΠε௥Ճ

    View full-size slide

  21. ©2019 Wantedly, Inc.
    Introduction
    GET σόΠεҰཡ
    https://developer.apple.com/documentation/appstoreconnectapi/list_devices

    View full-size slide

  22. ©2019 Wantedly, Inc.
    Introduction
    GET σόΠεҰཡ
    https://developer.apple.com/documentation/appstoreconnectapi/list_devices

    View full-size slide

  23. ©2019 Wantedly, Inc.
    Introduction
    Response Spec
    https://developer.apple.com/documentation/appstoreconnectapi/devicesresponse

    View full-size slide

  24. ©2019 Wantedly, Inc.
    Introduction
    - Codable
    ·ͣ͸ Response Λఆٛ

    View full-size slide

  25. ©2019 Wantedly, Inc.
    Introduction
    GET σόΠεҰཡ

    View full-size slide

  26. ©2019 Wantedly, Inc.
    Introduction
    GET σόΠεҰཡ

    View full-size slide

  27. ©2019 Wantedly, Inc.
    Introduction
    GET σόΠεҰཡ

    View full-size slide

  28. ©2019 Wantedly, Inc.
    Introduction
    App Store Connect API Λ࢖͏ 2εςοϓ
    - JWT (JSON Web Token) ͷൃߦ
    - ϦΫΤετϔομʹ Token Λ͚ͭͯ API Λୟ͘
    - GET σόΠεҰཡ
    - POST σόΠε௥Ճ

    View full-size slide

  29. ©2019 Wantedly, Inc.
    Introduction
    App Store Connect API Λ࢖͏ 2εςοϓ
    - JWT (JSON Web Token) ͷൃߦ
    - ϦΫΤετϔομʹ Token Λ͚ͭͯ API Λୟ͘
    - GET σόΠεҰཡ
    - POST σόΠε௥Ճ

    View full-size slide

  30. ©2019 Wantedly, Inc.
    Introduction
    POST σόΠε௥Ճ
    https://developer.apple.com/documentation/appstoreconnectapi/register_a_new_device

    View full-size slide

  31. ©2019 Wantedly, Inc.
    Introduction
    POST σόΠε௥Ճ
    https://developer.apple.com/documentation/appstoreconnectapi/register_a_new_device

    View full-size slide

  32. ©2019 Wantedly, Inc.
    Introduction
    https://developer.apple.com/documentation/appstoreconnectapi/devicecreaterequ
    Request Spec

    View full-size slide

  33. ©2019 Wantedly, Inc.
    Introduction
    - Codable
    Request body Λఆٛ

    View full-size slide

  34. ©2019 Wantedly, Inc.
    Introduction
    POST σόΠε௥Ճ

    View full-size slide

  35. ©2019 Wantedly, Inc.
    Introduction
    POST σόΠε௥Ճ

    View full-size slide

  36. ©2019 Wantedly, Inc.
    Introduction
    POST σόΠε௥Ճ

    View full-size slide

  37. ©2019 Wantedly, Inc.
    Introduction
    ·ͱΊ
    - App Store Connect API ͸ Swift Ͱ ؆୯ʹ࢖͑ΔΑ
    - ࣍͸ Github ͱ Bitrise Ͱ͍͍ײ͡ʹ͍ͨ͠
    - ͍ͭͰʹ Swift Ͱ CLI πʔϧ Λ֮͑Δ͖͔͚ͬʹ΋ͳΔΑ

    View full-size slide