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
41
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
SREへの勘違いに気づいた後の話
tomodakengo
0
160
プラットフォームを「作る」、 チームに「入り込む」
sansantech
PRO
0
120
Argo CDとAtlantisで実現するインフラ管理のセルフサービス化──小規模SREチームで支えるプラットフォーム
cassius7
0
150
AIに任せた品質は、誰が見立てるのか - AI時代のテストマネジメント
nakanao
3
3.1k
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
2
21k
サーバーレスをどこまで使う? WebRTC対戦ゲームで選んだVPSとの共存設計
kaidouji85
0
440
Vibe Coding で作ったプロダクトをどう安全に動かすか / How to Safely Run Products Built with Vibe Coding
glidenote
0
590
EventBridge に「合流」はない ― サーバーレスのワークフローを育てるということ / No Join in EventBridge
yusukeshimizu
2
550
人間はどの意思決定を手放せるのか
kawasima
16
8.3k
What the customer really needed
kawaguti
PRO
3
230
Cloudflare Workers 向けアプリを C# で構築する ~WASM Native AOT への道~
nenonaninu
1
1.6k
2026-09-18 gotanda.sre Terraformで複数環境作ったり、複数Stateに分割したりそれとTerragrunt / Terraform multi envs and multi states
masasuzu
4
730
Featured
See All Featured
How to build a perfect <img>
jonoalderson
1
6k
Leo the Paperboy
mayatellez
10
2.3k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Done Done
chrislema
187
17k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
280
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
HDC tutorial
michielstock
2
910
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
710
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
440
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が使えるなら使いたいが未検証)
終 ありがとうございました