$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Promoting IAP対応から学ぶ外部アプリ内課金実装 / Promoting IAP a...
Search
uzzu
April 10, 2019
Technology
2
1.5k
Promoting IAP対応から学ぶ外部アプリ内課金実装 / Promoting IAP and others
In-tamachi Billing Night 登壇資料
https://billing-night.connpass.com/event/125510/
uzzu
April 10, 2019
Tweet
Share
More Decks by uzzu
See All by uzzu
Context Receiversに思いを馳せる / Context Receivers
uzzu
0
720
StoreKitのこれまでとこれから / StoreKit 2 from 1
uzzu
5
19k
Autofill Framework
uzzu
0
140
アプリ内課金の最新事情 クライアントサイド編 / In-app Purchase in Cookpad 2019
uzzu
3
4.6k
Billing Client 2.0 acknowledgement
uzzu
0
17k
ブログ作り直した / My blog @ Othlo Tech
uzzu
0
190
新規アプリ開発を支えるユーザ・決済基盤
uzzu
2
2.9k
kotlin-mpp-library-tips
uzzu
1
6.4k
Coroutine Kyuin
uzzu
2
320
Other Decks in Technology
See All in Technology
特別捜査官等研修会
nomizone
0
570
アプリにAIを正しく組み込むための アーキテクチャ── 国産LLMの現実と実践
kohju
0
220
日本Rubyの会: これまでとこれから
snoozer05
PRO
6
240
AIBuildersDay_track_A_iidaxs
iidaxs
4
1.3k
AgentCore BrowserとClaude Codeスキルを活用した 『初手AI』を実現する業務自動化AIエージェント基盤
ruzia
7
1.5k
意外と知らない状態遷移テストの世界
nihonbuson
PRO
1
250
Identity Management for Agentic AI 解説
fujie
0
470
AI駆動開発の実践とその未来
eltociear
2
490
Bedrock AgentCore Memoryの新機能 (Episode) を試してみた / try Bedrock AgentCore Memory Episodic functionarity
hoshi7_n
2
1.9k
株式会社ビザスク_AI__Engineering_Summit_Tokyo_2025_登壇資料.pdf
eikohashiba
1
110
ハッカソンから社内プロダクトへ AIエージェント ko☆shi 開発で学んだ4つの重要要素
leveragestech
0
160
AgentCoreとStrandsで社内d払いナレッジボットを作った話
motojimayu
1
950
Featured
See All Featured
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
170
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
280
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.7k
Code Reviewing Like a Champion
maltzj
527
40k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
130
Bash Introduction
62gerente
615
210k
Statistics for Hackers
jakevdp
799
230k
[RailsConf 2023] Rails as a piece of cake
palkan
58
6.2k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
300
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
750
Large-scale JavaScript Application Architecture
addyosmani
515
110k
A Tale of Four Properties
chriscoyier
162
23k
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が使えるなら使いたいが未検証)
終 ありがとうございました