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

In-App Purchase 定期更新購読のアプリ内課金

In-App Purchase 定期更新購読のアプリ内課金

フェンリル株式会社で開かれた Mobile Act TOKYO #1 ( https://mobileact.connpass.com/event/80816/ ) にて発表を行ったスライドです。 In-App Purchase, 定期更新購読のアプリ内課金について発表を行いました。

813284c4797302276436a9f61695c1ff?s=128

tanibeta

March 20, 2018
Tweet

Other Decks in Programming

Transcript

  1. In-App Purchase VLaboͷఆظߋ৽ߪಡͷ࣮૷Ͱಘͨ͜ͱ

  2. • ͨʹ͙ͪͳ͓ / Twitter: @tanibeta • VLabo։ൃ୲౰

  3. • try! Swift Tokyo 2018ʹࢀՃ͖ͯ͠·͠ ͨʂ #tryswiftconf | ϑΣϯϦϧגࣜձࣾ

  4. None
  5. Introduction • ࠓճͷεϥΠυ͸ఆظߋ৽ߪಡͷIn-App Purchaseͷ࣮૷Λྫͱ͍ͯ͠·͢ • SandboxͱProductionͷڍಈͷҧ͍(ͱࣗ෼ͷ ࢥ͍ࠐΈ)ͰੜΜͰ͠·ͬͨෆ۩߹ͷ঺հ • ҧ͍ΛReceiptͷ؍఺͔Βઆ໌

  6. Introduction • ͜ͷൃදͰ࿩͞ͳ͍͜ͱ • ఆظߋ৽ߪಡͷςετ࣌ʹ͔͔Δ੍ݶ • ΞϓϦ಺՝ۚΛ࣮ݱ͍ͯ͠ΔΞϓϦͱࣗࣾ αʔόʔͷؔ܎ • ηΩϡϦςΟʹؔ࿈͢Δ͜ͱ

  7. Terms • Sandbox • iTunes ConnectͰςετΞΧ΢ϯτΛ࡞੒͢Δ͜ ͱͰ࣮૷தʹΞϓϦ಺՝ۚͷςετ͕ߦ͑Δ؀ڥ • Production •

    AppStoreʹϦϦʔε͞ΕϢʔβʔʹద༻͞ΕΔ ؀ڥ
  8. Terms • Receipt • ΞϓϦ಺՝ۚΛ؅ཧ͢ΔͨΊʹΞϓϦ಺ʹ ੜ੒͞ΕΔσʔλٴͼɺͦΕΛAppleʹૹ৴ ͠ಘΒΕΔJSON

  9. • ۩ମతʹͲ͏ҧ͏ͷʁ Sandbox? or Production?

  10. Receiptͷڍಈͷҧ͍

  11. Receiptͷ͋Γ͔ static var appStoreReceiptUrl: URL? { return Bundle.main.appStoreReceiptURL } *

    appStoreReceiptURL - Bundle | Apple Developer Documentation
  12. ͍ͭ Receipt ͕ੜ੒͞ΕΔʁ • Sandbox • ΞϓϦ಺՝ۚΛ͓͜ͳͬͨͱ͖ • ՝ۚૢ࡞ʹΑͬͯReceipt͕࡞ΒΕΔΠϝʔδ •

    Production • AppStore͔ΒΠϯετʔϧͨ͠ͱ͖ • ՝ۚૢ࡞ʹΑͬͯReceipt͕ߋ৽͞ΕΔΠϝʔδ
  13. ͍ͭ Receipt ͕ੜ੒͞ΕΔʁ • ՝ۚத͔Ͳ͏͔Λ൑அ͢Δʹ͸ • ࣮૷ॳظʹReceiptͷ༗ແΛϢʔβʔ͕՝ۚ ͍ͯ͠Δ͔ͷ൑அͷҰͭͱͯ͠ෆ۩߹ൃੜ • ͜Εʹ͍ͭͯ͸Receiptͷத਎Ͱ൑அ͠ղܾ

  14. Ͳ͏൑அ͢Δʁ • ProductionͷReceipt͸Ϣʔβʔ͕ߦͳͬͨΞ ϓϦ಺՝ۚͷૢ࡞ʹΑͬͯߋ৽ • Ͳ͏ߋ৽͞ΕΔʁͱ͍͏ٙ໰Λղܾ͍ͨ͠ʂ

  15. Appleֹ݄՝ۚʹ͍ͭͯ ʲProductionϨγʔτʳ - Qiita

  16. State Change of Receipt 1. Πϯετʔϧ࣌ (ະ՝ۚ࣌) 2. ΞϓϦ಺՝ۚ࣌ 3.

    ϦετΞ࣌ 4. ఆظߋ৽ߪಡͷߋ৽࣌ * Appleֹ݄՝ۚʹ͍ͭͯʲProductionϨγʔτʳ - Qiita
  17. State Change of Receipt • ະ՝ۚ࣌ • “in_app” : []

    ͷfield͕ۭ • ՝ۚ / ϦετΞ࣌ • “in_app” : [] ͷfieldʹ՝ۚ৘ใ͕֨ೲ * Appleֹ݄՝ۚʹ͍ͭͯʲProductionϨγʔτʳ - Qiita
  18. State Change of Receipt • ఆظߋ৽ߪಡͷߋ৽࣌ • “latest_receipt_info” : []

    ʹσʔλ͕֨ೲ͞ Ε͍ͯ͘ * Appleֹ݄՝ۚʹ͍ͭͯʲProductionϨγʔτʳ - Qiita
  19. Ͳ͏൑அ͢Δʁ • “latest_receipt_info” : [] • ͜ͷ഑ྻதͷobject͔Β࠷৽ͷ “expire_date”Λऔಘ -> ߪಡத͔Ͳ͏͔

    • “in_app” : [] ͱ “latest_receipt_info” : [] ͸഑ ྻͷத਎͕ҟͳΔ৔߹͋Γ * Appleֹ݄՝ۚʹ͍ͭͯʲProductionϨγʔτʳ - Qiita
  20. Productionͷςετ͸ʁ

  21. In-App Purchase Diagram Debug AdHoc / InHouse TestFlight ϓϩϞʔγ ϣϯίʔυ

    AppStore Receipt Sandbox Sandbox Sandbox Sandbox Production ՝ۚૢ࡞ Մ/ෆՄ ◦ ◦ ◦ × (*Ḽ1) ◦ ର৅ Ϣʔβʔ Sandboxς ελʔ Sandboxς ελʔ TestFlight ςελʔ ίʔυΛड ͚औͬͨਓ ୭Ͱ΋ ੥ٻ ༗ / ແ × × × × ◦
  22. Promotion Code == Sandbox • Promotion CodeͰΠϯετʔϧͨ͠ΞϓϦͰ͸ ՝ۚૢ࡞͸ෆՄೳ • App಺՝ۚϓϩϞʔγϣϯίʔυ͸ར༻Մ

    • ఆظߋ৽ߪಡͷApp಺՝ۚ͸͜ͷϓϩϞʔγϣ ϯίʔυͰߋ৽͕૸Βͳ͍ -> ߋ৽࣌ͷڍಈΛς ετͰ͖ͳ͍
  23. Productionͷςετ͸ AppStoreϦϦʔεޙʂ

  24. Conclusion • Receipt • த਎ͷঢ়ଶมԽͷཧղ͕ඞਢ • Test • ProductionͷReceiptΛςετͰ͖Δͷ͸AppStoreϦ Ϧʔεޙ

    • ϦϦʔεޙʹෆ۩߹Λੜ·ͳ͍ͨΊͷʮ༧๷ʯ͕େม
  25. ࠙਌ձͰ͸ΞϓϦ಺՝ۚͷ࿩ ͕͍ͨ͠ʂ

  26. ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ