Slide 1

Slide 1 text

ಈըΞϓϦͷ౤͛મػೳʹ͓͚Δ
 ফ໣ܕ՝ۚͷ࢓૊Έͱ࣮૷ 2019/09/06 iOSDC 2019 Takeshi Ihara

Slide 2

Slide 2 text

Takeshi Ihara • 2018.09.01 AbemaTV Join • 2018.09.02 iOSDC 2018 LT ʮখ͘͞͸͡ΊΔ୺຤؅ཧʯ • ϘϧμϦϯάͱ֨ಆήʔϜ͕झຯ • https://twitter.com/nonchalant0303

Slide 3

Slide 3 text

αϙʔτػೳ (AbemaTV) • 2019.04.22
 αϙʔτػೳΛ
 ϦϦʔεʂ
 ൪૊΍൪૊ग़ԋऀʹ ελϯϓΛૹͬͯ
 αϙʔτ͕Ͱ͖Δʂ

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

αϙʔτ͢Δͧʂ

Slide 6

Slide 6 text

1. App಺՝ۚ 2. ՝ۚܗࣜʹΑΔҧ͍ 3. AbemaTVʹ͓͚Δফ໣ܕ՝ۚͷઃܭ 4. AbemaTVʹ͓͚Δফ໣ܕ՝ۚͷಈ࡞ݕূ 5. ·ͱΊ

Slide 7

Slide 7 text

App಺՝ۚ

Slide 8

Slide 8 text

App಺՝ۚͱ͸ • App ಺՝ۚͱ͸ɺiOS σόΠε΍ίϯϐϡʔλ্ͷ 
 App ͷதͰ௥Ճͷίϯςϯπ΍ఆظߪಡίϯςϯπΛ
 ߪೖͰ͖Δ࢓૊Έ https://support.apple.com/ja-jp/HT202023

Slide 9

Slide 9 text

՝ۚܗࣜ • ফ໣ܕ (Consumable) - ΞϓϦ಺௨՟ͳͲ Ұ౓࢖͏ͱͳ͘ͳΓɺ࠶ߪೖ͢Δ͜ͱ͕Ͱ͖Δ
 • ඇফ໣ܕ (Non-Consumable) - ޿ࠂͷඇදࣔͳͲ Ұ౓ͷߪೖ͚ͩͰແ੍ݶʹ࢖༻Ͱ͖Δ • ࣗಈߋ৽αϒεΫϦϓγϣϯ (Auto-Renewable Subscriptions) - ֹ݄VODͳͲ ݄ؒαʔϏε΍ఆظతʹΞοϓσʔτ͞ΕͨίϯςϯπΛߪೖ͢Δ͜ͱ͕Ͱ͖Δ • ඇߋ৽αϒεΫϦϓγϣϯ (Non-Renewing Subscriptions) - γʔζϯύεͳͲ ظؒݶఆͷαʔϏε΍ίϯςϯπΛߪೖ͢Δ͜ͱ͕Ͱ͖Δ

Slide 10

Slide 10 text

AbemaTVʹ͓͚Δࣗಈߋ৽αϒεΫϦγϣϯ • ¥960/݄ͰϓϨϛΞϜػೳΛఏڙ 1. ͢΂ͯͷ࡞඼͕ݟ์୊ 2. ޿ࠂͳ͠ͰϏσΦΛ͙͢࠶ੜ 3. ์ૹதͰ΋࠷ॳ͔ΒΈΒΕΔ 4. μ΢ϯϩʔυͰ௨৴ྔΛ΄΅θϩʹ 5. ์ૹޙͷ൪૊Ͱ΋ίϝϯτָ͕͠ΊΔ

Slide 11

Slide 11 text

AbemaTVʹ͓͚Δফ໣ܕ՝ۚ • ΞϓϦ಺௨՟(AbemaίΠϯ) ίΠϯͰελϯϓΛߪೖͯ͠ɺ
 ൪૊΍൪૊ग़ԋऀʹελϯϓΛૹͬͯ
 αϙʔτ͕Ͱ͖Δʂ

Slide 12

Slide 12 text

՝ۚܗࣜʹΑΔҧ͍

Slide 13

Slide 13 text

՝ۚܗࣜʹΑΔػೳͷҧ͍ ࠶ߪೖͷՄ൱ Ϩγʔτ΁ͷදࣔ σόΠεؒͰͷಉ ظ ෮ݩ ফ໣ܕ ˓
 Կ౓Ͱ΋ ࠶ߪೖ·Ͱ ಉظͳ͠ ෮ݩ͞Εͳ͍ ඇফ໣ܕ ✖ ৗʹ γεςϜʹΑΓಉ ظ γεςϜʹΑΓಉ ظ ࣗಈߋ৽
 αϒεΫϦϓγϣ ϯ ✖
 ࣗಈతʹߋ৽͞Ε Δ ৗʹ γεςϜʹΑΓಉ ظ γεςϜʹΑΓಉ ظ ඇߋ৽αϒεΫϦ ϓγϣϯ ˓ ߋ৽͢Δ ৗʹ "QQʹΑΓಉظ "QQʹΑΓಉظ https://developer.apple.com/jp/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Products.html#//apple_ref/doc/uid/TP40008267-CH2-SW2 https://developer.apple.com/jp/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Restoring.html#//apple_ref/doc/uid/TP40008267-CH8-SW9

Slide 14

Slide 14 text

՝ۚܗࣜʹΑΔػೳͷҧ͍ ࠶ߪೖͷՄ൱ Ϩγʔτ΁ͷදࣔ σόΠεؒͰͷಉ ظ ෮ݩ ফ໣ܕ ˓
 Կ౓Ͱ΋ ࠶ߪೖ·Ͱ ಉظͳ͠ ෮ݩ͞Εͳ͍ ඇফ໣ܕ ✖ ৗʹ γεςϜʹΑΓಉ ظ γεςϜʹΑΓಉ ظ ࣗಈߋ৽
 αϒεΫϦϓγϣ ϯ ✖
 ࣗಈతʹߋ৽͞Ε Δ ৗʹ γεςϜʹΑΓಉ ظ γεςϜʹΑΓಉ ظ ඇߋ৽αϒεΫϦ ϓγϣϯ ˓ ߋ৽͢Δ ৗʹ "QQʹΑΓಉظ "QQʹΑΓಉظ https://developer.apple.com/jp/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Products.html#//apple_ref/doc/uid/TP40008267-CH2-SW2 https://developer.apple.com/jp/documentation/NetworkingInternet/Conceptual/StoreKitGuide/Chapters/Restoring.html#//apple_ref/doc/uid/TP40008267-CH8-SW9

Slide 15

Slide 15 text

࠶ߪೖ͕Կ౓Ͱ΋ग़དྷΔ • ϩʔΧϧͷϨγʔτͷߪೖཤྺ্͕ॻ͖͞ΕΔ ߪೖʹԠͨ͡ΠϯηϯςΟϒΛϢʔβʔʹ෇༩Ͱ͖ͳ͘ͳΔ
 AppStoreʹΑΔ՝ۚॲཧ͸׬͍ྃͯ͠Δ → ՝͚ۚͩൃੜͯ͠ϢʔβʔʹΠϯηϯςΟϒΛ
 ෇༩͍ͯ͠ͳ͍ঢ়ଶ

Slide 16

Slide 16 text

{ "receipt": { …, "in_app": [ { "product_id": “com.nonchalant.consumable1”, "transaction_id": "1000000551439498", "purchase_date": "2019-09-01 00:00:00 Etc/GMT”, … } ] } } Ϩγʔτ (ॳճߪೖ࣌) https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1

Slide 17

Slide 17 text

{ "receipt": { …, "in_app": [ { "product_id": “com.nonchalant.consumable1", "transaction_id": "1000000556349963", "purchase_date": "2019-09-03 10:10:26 Etc/GMT”, … } ] } } Ϩγʔτ (࠶ߪೖ࣌) https://developer.apple.com/library/archive/releasenotes/General/ValidateAppStoreReceipt/Chapters/ReceiptFields.html#//apple_ref/doc/uid/TP40010573-CH106-SW1

Slide 18

Slide 18 text

࠶ߪೖ͕ग़དྷΔ৚݅ • ಉ͡঎඼ͷ՝ۚτϥϯβΫγϣϯ͕ऴ͍ྃͯ͠Δ ՝ۚτϥϯβΫγϣϯ → SKPaymentTransaction τϥϯβΫγϣϯ͕ऴ͍ྃͯ͠Δ → SKPaymentQueue.finishTransaction(_:)

Slide 19

Slide 19 text

՝ۚτϥϯβΫγϣϯͷѻ͍ͷ஫ҙ఺ • ΠϯηϯςΟϒΛ෇༩͢Δ·ͰτϥϯβΫγϣϯΛऴྃͯ͠͸͍͚ͳ͍ > Once you’ve delivered the product, your application must call finishTransaction: to complete the transaction. When you call finishTransaction:, the transaction is removed from the payment queue. To ensure that products are not lost, your application should deliver the product before calling finishTransaction:. • ߪೖཤྺ͕Ϩγʔτʹৗʹදࣔ͞ΕΔ՝ۚܗࣜͰ͸
 ҙࣝ͠ͳͯ͘΋໰୊ͳ͍ ඇফ໣ܕɺࣗಈߋ৽αϒεΫϦϓγϣϯɺඇߋ৽αϒεΫϦϓγϣϯ https://www.rapid-ideas.com/previews/wsa/page9/files/StoreKitGuide.pdf

Slide 20

Slide 20 text

AbemaTVʹ͓͚Δ
 ফ໣ܕ՝ۚͷઃܭ

Slide 21

Slide 21 text

ফ໣ܕ՝ۚͷߪೖϑϩʔ 4. ϨγʔτݕূϦΫΤετ 5. Ϩγʔτݕূ݁Ռ 6. AbemaίΠϯ
 ෇༩ App Store AbemaTV iOS AbemaTV Server 7. ׬ྃϨεϙϯε (201) 1. ߪೖϦΫΤετ
 (τϥϯβΫγϣϯͷ։࢝) 8. τϥϯβΫγϣϯ
 ͷऴྃ 2. ߪೖ׬ྃ 3. Ϩγʔτૹ৴

Slide 22

Slide 22 text

ফ໣ܕ՝ۚͷߪೖϑϩʔ 4. ϨγʔτݕূϦΫΤετ 5. Ϩγʔτݕূ݁Ռ 6. AbemaίΠϯ
 ෇༩ App Store AbemaTV iOS AbemaTV Server 7. ׬ྃϨεϙϯε (201) 1. ߪೖϦΫΤετ
 (τϥϯβΫγϣϯͷ։࢝) 8. τϥϯβΫγϣϯ
 ͷऴྃ 2. ߪೖ׬ྃ 3. Ϩγʔτૹ৴

Slide 23

Slide 23 text

ফ໣ܕ՝ۚͷߪೖϑϩʔ 4. ϨγʔτݕূϦΫΤετ 5. Ϩγʔτݕূ݁Ռ 6. AbemaίΠϯ
 ෇༩ App Store AbemaTV iOS AbemaTV Server 7. ׬ྃϨεϙϯε (201) 1. ߪೖϦΫΤετ
 (τϥϯβΫγϣϯͷ։࢝) 8. τϥϯβΫγϣϯ
 ͷऴྃ 2. ߪೖ׬ྃ 3. Ϩγʔτૹ৴

Slide 24

Slide 24 text

ফ໣ܕ՝ۚͷߪೖϑϩʔ 4. ϨγʔτݕূϦΫΤετ 5. Ϩγʔτݕূ݁Ռ 6. AbemaίΠϯ
 ෇༩ App Store AbemaTV iOS AbemaTV Server 7. ׬ྃϨεϙϯε (201) 1. ߪೖϦΫΤετ
 (τϥϯβΫγϣϯͷ։࢝) 8. τϥϯβΫγϣϯ
 ͷऴྃ 2. ߪೖ׬ྃ 3. Ϩγʔτૹ৴

Slide 25

Slide 25 text

ফ໣ܕ՝ۚͷߪೖϑϩʔ 4. ϨγʔτݕূϦΫΤετ 5. Ϩγʔτݕূ݁Ռ 6. AbemaίΠϯ
 ෇༩ App Store AbemaTV iOS AbemaTV Server 7. ׬ྃϨεϙϯε (201) 1. ߪೖϦΫΤετ
 (τϥϯβΫγϣϯͷ։࢝) 8. τϥϯβΫγϣϯ
 ͷऴྃ 2. ߪೖ׬ྃ 3. Ϩγʔτૹ৴

Slide 26

Slide 26 text

ফ໣ܕ՝ۚͷߪೖϑϩʔ 4. ϨγʔτݕূϦΫΤετ 5. Ϩγʔτݕূ݁Ռ 6. AbemaίΠϯ
 ෇༩ App Store AbemaTV iOS AbemaTV Server 7. ׬ྃϨεϙϯε (201) 1. ߪೖϦΫΤετ
 (τϥϯβΫγϣϯͷ։࢝) 8. τϥϯβΫγϣϯ
 ͷऴྃ 2. ߪೖ׬ྃ 3. Ϩγʔτૹ৴

Slide 27

Slide 27 text

ফ໣ܕ՝ۚͷߪೖϑϩʔ 4. ϨγʔτݕূϦΫΤετ 5. Ϩγʔτݕূ݁Ռ 6. AbemaίΠϯ
 ෇༩ App Store AbemaTV iOS AbemaTV Server 7. ׬ྃϨεϙϯε (201) 1. ߪೖϦΫΤετ
 (τϥϯβΫγϣϯͷ։࢝) 8. τϥϯβΫγϣϯ
 ͷऴྃ 2. ߪೖ׬ྃ 3. Ϩγʔτૹ৴

Slide 28

Slide 28 text

ফ໣ܕ՝ۚͷߪೖϑϩʔ 4. ϨγʔτݕূϦΫΤετ 5. Ϩγʔτݕূ݁Ռ 6. AbemaίΠϯ
 ෇༩ App Store AbemaTV iOS AbemaTV Server 7. ׬ྃϨεϙϯε (201) 1. ߪೖϦΫΤετ
 (τϥϯβΫγϣϯͷ։࢝) 8. τϥϯβΫγϣϯ
 ͷऴྃ 2. ߪೖ׬ྃ 3. Ϩγʔτૹ৴

Slide 29

Slide 29 text

ফ໣ܕ՝ۚͷߪೖϑϩʔ 4. ϨγʔτݕূϦΫΤετ 5. Ϩγʔτݕূ݁Ռ 6. AbemaίΠϯ
 ෇༩ App Store AbemaTV iOS AbemaTV Server 7. ׬ྃϨεϙϯε (201) 1. ߪೖϦΫΤετ
 (τϥϯβΫγϣϯͷ։࢝) 8. τϥϯβΫγϣϯ
 ͷऴྃ 3. Ϩγʔτૹ৴ 2. ߪೖ׬ྃ

Slide 30

Slide 30 text

՝ۚ׬ྃޙʹࣦഊ͢Δέʔε 1 4. ϨγʔτݕূϦΫΤετ 5. Ϩγʔτݕূ݁Ռ 6. AbemaίΠϯ
 ෇༩ App Store AbemaTV iOS AbemaTV Server 7. ׬ྃϨεϙϯε (201) 1. ߪೖϦΫΤετ
 (τϥϯβΫγϣϯͷ։࢝) 8. τϥϯβΫγϣϯ
 ͷऴྃ 3. Ϩγʔτૹ৴ 2. ߪೖ׬ྃ

Slide 31

Slide 31 text

Ϩγʔτૹ৴ʹࣦഊ͢Δέʔε • ωοτϫʔΫͳͲͷ໰୊Ͱ
 APIϦΫΤετͷ։࢝ʹࣦഊ͢Δέʔε • AppStoreʹΑΔ՝ۚ͸ൃੜ͍ͯ͠Δ • αʔόʔଆͰAbemaίΠϯ෇༩͕ग़དྷ͍ͯͳ͍ • ՝ۚτϥϯβΫγϣϯ͸ऴ͍ྃͯ͠ͳ͍ Ϣʔβʔ͕࠶ߪೖͰ͖ͳ͍

Slide 32

Slide 32 text

՝ۚ׬ྃޙʹࣦഊ͢Δέʔε 2 4. ϨγʔτݕূϦΫΤετ 5. Ϩγʔτݕূ݁Ռ 6. AbemaίΠϯ
 ෇༩ App Store AbemaTV iOS AbemaTV Server 7. ׬ྃϨεϙϯε (201) 1. ߪೖϦΫΤετ
 (τϥϯβΫγϣϯͷ։࢝) 8. τϥϯβΫγϣϯ
 ͷऴྃ 2. ߪೖ׬ྃ 3. Ϩγʔτૹ৴

Slide 33

Slide 33 text

׬ྃϨεϙϯεʹࣦഊ͢Δέʔε • ΞϓϦͷΫϥογϡͳͲͰ
 APIϨεϙϯεͷड৴ʹࣦഊ͢Δέʔε • AppStoreʹΑΔ՝ۚ͸ൃੜ͍ͯ͠Δ • αʔόʔଆͰAbemaίΠϯ෇༩͕׬͍ྃͯ͠ΔՄೳੑ͕͋Δ • ՝ۚτϥϯβΫγϣϯ͸ऴ͍ྃͯ͠ͳ͍ Ϣʔβʔ͕࠶ߪೖͰ͖ͳ͍

Slide 34

Slide 34 text

ະ׬ྃτϥϯβΫγϣϯͷ ϦτϥΠ͕ඞཁ

Slide 35

Slide 35 text

AbemaίΠϯະ෇༩ͷϦτϥΠ 3. ϨγʔτݕূϦΫΤετ 4. Ϩγʔτݕূ݁Ռ 5. AbemaίΠϯ
 ෇༩ App Store AbemaTV iOS AbemaTV Server 6. ׬ྃϨεϙϯε (201) 7. τϥϯβΫγϣϯ
 ͷऴྃ 2. Ϩγʔτૹ৴ 1. ະ׬ྃτϥϯβΫγϣϯͷऔಘ
 (SKPaymentQueue.transactions)

Slide 36

Slide 36 text

AbemaίΠϯະ෇༩ͷϦτϥΠ 3. ϨγʔτݕূϦΫΤετ 4. Ϩγʔτݕূ݁Ռ 5. AbemaίΠϯ
 ෇༩ App Store AbemaTV iOS AbemaTV Server 6. ׬ྃϨεϙϯε (201) 7. τϥϯβΫγϣϯ
 ͷऴྃ 2. Ϩγʔτૹ৴ 1. ະ׬ྃτϥϯβΫγϣϯͷऔಘ
 (SKPaymentQueue.transactions)

Slide 37

Slide 37 text

AbemaίΠϯ෇༩ࡁΈͷϦτϥΠ 3. ϨγʔτݕূϦΫΤετ 4. Ϩγʔτݕূ݁Ռ App Store AbemaTV iOS AbemaTV Server 5. AbemaίΠϯ෇༩ࡁΈΤϥʔ (409) 6. τϥϯβΫγϣϯ
 ͷऴྃ 2. Ϩγʔτૹ৴ 1. ະ׬ྃτϥϯβΫγϣϯͷऔಘ
 (SKPaymentQueue.transactions)

Slide 38

Slide 38 text

AbemaίΠϯ෇༩ࡁΈͷϦτϥΠ 3. ϨγʔτݕূϦΫΤετ 4. Ϩγʔτݕূ݁Ռ App Store AbemaTV iOS AbemaTV Server 5. AbemaίΠϯ෇༩ࡁΈΤϥʔ (409) 6. τϥϯβΫγϣϯ
 ͷऴྃ 2. Ϩγʔτૹ৴ 1. ະ׬ྃτϥϯβΫγϣϯͷऔಘ
 (SKPaymentQueue.transactions)

Slide 39

Slide 39 text

AbemaίΠϯ෇༩ࡁΈͷϦτϥΠ 3. ϨγʔτݕূϦΫΤετ 4. Ϩγʔτݕূ݁Ռ App Store AbemaTV iOS AbemaTV Server 5. AbemaίΠϯ෇༩ࡁΈΤϥʔ (409) 6. τϥϯβΫγϣϯ
 ͷऴྃ 2. Ϩγʔτૹ৴ 1. ະ׬ྃτϥϯβΫγϣϯͷऔಘ
 (SKPaymentQueue.transactions)

Slide 40

Slide 40 text

τϥϯβΫγϣϯ͕
 ऴ͍ྃͯ͠Δ → AbemaίΠϯ͕
 ෇༩͞Ε͍ͯΔ

Slide 41

Slide 41 text

ϦτϥΠॲཧͷݺͿλΠϛϯά • ىಈ࣌ɺόοΫϑΥΞ࣌ɺίΠϯ࢒ߴදࣔ࣌ʹ
 ϦτϥΠॲཧΛߦ͏ Ϣʔβʔ͕ίΠϯ࢒ߴΛ֬ೝ͢ΔલʹϦτϥΠ͢ΔΑ͏ʹͯ͠ɺ
 ෆ੔߹ʹؾ෇͔ͤͮΒ͍ͤͯ͘͞Δ

Slide 42

Slide 42 text

ϦτϥΠॲཧͷ஫ҙ఺ • ະ׬ྃτϥϯβΫγϣϯ͸SKPaymentQueue.transactionsͰ औಘͰ͖Δ ߪೖதͷτϥϯβΫγϣϯ΋ؚ·ΕΔ
 • ਖ਼ৗͳߪೖϑϩʔͷࡍ͸ϦτϥΠॲཧ
 ΛߦΘͳ͍ͳͲͷॲཧ͕ඞཁ

Slide 43

Slide 43 text

AbemaTVʹ͓͚Δ
 ফ໣ܕ՝ۚͷ
 ಈ࡞ݕূ

Slide 44

Slide 44 text

ݕূ߲໨ͷೝࣝ߹Θͤ • ߪೖϑϩʔ͕τϥϯβΫγϣϯͳͲͷ಺෦ͷঢ়ଶʹґଘͯ͠ ͍ΔͷͰɺQAνʔϜʹγʔέϯεਤΛ౉ͯ͠΋
 ݕূ߲໨Λ࡞੒͢Δͷ͕೉͍͠ • ࣮ࡍʹͲͷΑ͏ͳঢ়گͰͲͷΑ͏ͳૢ࡞Λ͢Ε͹ɺͲͷΑ͏ ͳঢ়ଶʹͳΔ͔ͷೝࣝ߹ΘͤΛ͠ͳ͍ͱ
 ݕূ߲໨Λ࡞੒Ͱ͖ͳ͍

Slide 45

Slide 45 text

Mind Meister • ϚΠϯυϚοϓ࡞੒πʔϧͷMind MeisterΛ༻͍ͯ
 ೝࣝ߹ΘͤΛ͠·ͨ͠ https://www.mindmeister.com/1309256136?t=X6wMB2GxG6

Slide 46

Slide 46 text

ίΠϯपΓͷදࣔܥ

Slide 47

Slide 47 text

ίΠϯपΓͷදࣔܥ

Slide 48

Slide 48 text

੒ޭ͢Δߪೖϑϩʔ

Slide 49

Slide 49 text

ࣦഊ͢Δߪೖϑϩʔ

Slide 50

Slide 50 text

ߪೖϑϩʔͷಈ࡞ݕূ • ফ໣ܕ՝ۚͷߪೖϑϩʔΛ࣮૷ͨ͠αϯϓϧϓϩδΣΫτ https://github.com/Nonchalant/Consumable - Consumable In-App Purchase - Combine - SwiftUI

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

·ͱΊ

Slide 53

Slide 53 text

·ͱΊ • ফ໣ܕ՝ۚ͸ΠϯηϯςΟϒΛ෇༩͢Δ·Ͱ
 τϥϯβΫγϣϯΛऴྃ͠ͳ͍ ࠶ߪೖ͢Δͱߪೖཤྺ্͕ॻ͖͞ΕΔͨΊ • ߪೖϑϩʔͰࣦഊ͢Δ͜ͱ͕͋ΔͷͰϦτϥΠػߏ͕ඞཁ ਖ਼ৗͳߪೖಋઢ্ͰϦτϥΠ͠ͳ͍

Slide 54

Slide 54 text

Thank you