Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Promoting IAP対応から学ぶ外部アプリ内課金実装 / Promoting IAP a...
Search
uzzu
April 10, 2019
Technology
1.6k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Promoting IAP対応から学ぶ外部アプリ内課金実装 / Promoting IAP and others
In-tamachi Billing Night 登壇資料
https://billing-night.connpass.com/event/125510/
uzzu
April 10, 2019
More Decks by uzzu
See All by uzzu
あなたは 何をして 何をもたらすのか? / reskilling-at-tokyo-2026
uzzu
0
40
Context Receiversに思いを馳せる / Context Receivers
uzzu
0
790
StoreKitのこれまでとこれから / StoreKit 2 from 1
uzzu
5
22k
Autofill Framework
uzzu
0
160
アプリ内課金の最新事情 クライアントサイド編 / In-app Purchase in Cookpad 2019
uzzu
3
4.7k
Billing Client 2.0 acknowledgement
uzzu
0
17k
ブログ作り直した / My blog @ Othlo Tech
uzzu
0
230
新規アプリ開発を支えるユーザ・決済基盤
uzzu
2
3k
kotlin-mpp-library-tips
uzzu
1
6.5k
Other Decks in Technology
See All in Technology
負債のメタファと2026年 / Debt Metaphor in Agentic Engineering Age 202609 Edition
twada
PRO
11
6.6k
Making AI Agents Safe and Fast- Jev, Obsidian, and the Meta-Harness
x5gtrn
PRO
0
130
え、こんなに早く改修できるの?──新人エンジニアとスクラムマスターの2人が語る、AI×アジャイル開発の現場
ysasago
2
700
人にやさしく、AIにやさしく、書き手を選ばないIaCのガードレール再考 / Rethinking IaC Guardrails for Humans and AI Alike
kohbis
2
380
特殊変数大全
dak2
0
110
登壇の自信を奪う3匹のオバケ / 3 Ghosts That Rob You of Your Confidence in Public Speaking
pauli
9
1.1k
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
3
590
Antigravity SDK for the Java Developer
glaforge
0
190
なぜ「決定性」が 決定的に重要なのか? Durable Execution 基盤の数理的理解 #serverlessjp / ServerlessDays Tokyo 2026
ytaka23
3
1.2k
SREへの勘違いに気づいた後の話
tomodakengo
0
150
品質と信頼性を地続きにする
grimoh
2
970
ボードゲームの遊び相手をFoundation Modelsで作る / iOSDC Japan 2026
genda
0
140
Featured
See All Featured
The Limits of Empathy - UXLibs8
cassininazir
1
690
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
So, you think you're a good person
axbom
PRO
2
2.2k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Prompt Engineering for Job Search
mfonobong
0
460
The Cult of Friendly URLs
andyhume
79
7k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
250
Navigating Team Friction
lara
192
16k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
410
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
530
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
680
Transcript
Promoting IAP対応から学ぶ 外部アプリ内課金実装 @uzzu
About me @uzzu (GitHub, Twtter, etc…) Cookpad Inc. ユーザ・決済基盤部 エンジニア
アプリ内課金とは 前職(スマホゲーム開発)からの お付き合い(iOS/Android) https://uzzu.co
https://speakerdeck.com/uzzu/xin-gui-apurikai-fa-wozhi-eruyuzajue-ji-ji-pan
はとりあえず置いといて、Promoting IAPについて説明します 外部アプリ内課金実装?????
Promoting IAPとは •App Storeアプリから アプリ内課金アイテムの購入を 実施する為の機能
Promoting IAPとは
Promoting IAPとは 未インストールユーザも利用できる
Promoting IAPに対応するには •まずはアプリ内課金実装をする •protocol SKPaymentTransactionObserverの optional func paymentQueue(_ queue: SKPaymentQueue,
shouldAddStorePayment: SKPayment, for: SKProduct) -> Bool を実装する •AppStore ConnectでPromoting IAP用の商品設定をする •(任意) SKProductPromotionControllerで表示制御をする ※正確な情報はApp内課金プログラミングガイドを参照してね
テスト itms-services:// ?action=purchaseIntent &bundleId={Bundle Identifier} &productIdentifier={Product Identifier} ※正確な情報はApp内課金プログラミングガイドを参照してね
shouldAddStorePayment public func paymentQueue( _ queue: SKPaymentQueue, shouldAddStorePayment payment: SKPayment,
for product: SKProduct) -> Bool { return true // PaymentQueueʹੵ·ΕΔ } 最短実装。だがしかし…
俺たちには利用規約がある •return trueとしてしまうと、アプリ遷移後にすぐに IAP決済処理が走ってしまう (正確にはSKPaymentQueue#add後、任意のタイミング) •利用規約に同意してもらうタイミングがない アプリ内課金商品によっては年齢確認も必要 •利用規約がなくても、アプリの初期化処理はしばしある その後に処理するようにしないといけない
どうする? // shouldAddStorePaymentͷύϥϝʔλΛ࣋ͭstructΛ༻ҙ public struct PromotingPurchasePayment { public var product:
SKProduct public var payment: SKPayment init(payment: SKPayment, product: SKProduct) { assert(payment.productIdentifier == product.productIdentifier) self.payment = payment self.product = product } } // Promoting IAPͷใΛஷΊΔprotocol public protocol PromotingPurchasePaymentHolder { func add(_ storePayment: StorePayment) func pendingPayments() -> [StorePayment] func consume(_ storePayment: StorePayment) }
どうする? let holder: PromotingPurchasePaymentHolder public func paymentQueue( _ queue: SKPaymentQueue,
shouldAddStorePayment payment: SKPayment, for product: SKProduct) -> Bool { // ͱΓ͋͑ͣஷΊΔ!! holder.add( StorePayment(payment: payment, product: product) ) return false }
どうする? •アプリ初期化後、トップ画面の ViewController上で 未処理のPromoting IAPがあれば 決済処理開始 •クックパッドでは トップ画面とは別の UIViewControllerに遷移して処理している •決済処理が終わったらHolderから破棄
Promoting IAPまとめ •超カジュアル実装ならtrue •アプリ初期化処理や利用規約があるならfalse •個人プロダクトでないアプリであれば だいたいfalseになるんじゃないか? •貯めて特定画面で処理が柔軟
Promoting IAPだけが 特別?
アプリ外に決済起点のある アプリ内課金機能は 他にもある (実際に決済が走っているかはさておき)
例えば •Promotion Code(iOS, Android) •Google Play Points(Android)
一旦貯めるのは柔軟 •iOSの場合はこれまでにお話した通り •Google Play(Android)においては特に貯めずとも BillingClient#queryPurchases を 特定画面で呼び出して購入状況を確認すれば良い iOSと違い決済は既に走っているので 決済後の処理(いわゆる復元処理)をやれば良さそう
まとめ •アプリ外部からのトリガーによるアプリ内課金を処理する前に (時には)サービス利用規約への同意が必要(利用規約の更新もあるよね) その後に 都度課金であれば(時には)年齢確認が必要 定期購読であれば定期購読サービス利用規約の同意が必要 •どのケースにおいても プラットフォームからの通知は貯めておいて 特定画面(アプリ起動後のTOP画面等)でまとめて処理すると 柔軟で良い
(Realtime notificationが使えるなら使いたいが未検証)
終 ありがとうございました