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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
45
Context Receiversに思いを馳せる / Context Receivers
uzzu
0
800
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
「作れる」と「リリースできる」の間にあったもの── PdMを外して見えた、PdMがやるべき仕事/Buildable ≠ Shippable: What Removing the PM Taught Me About the PM’s Job
yappli_developers
0
340
クラウドエージェントの先駆け Devin。今も最先端を走る、他との違い
kinopeee
1
500
Patterns in AI Driven Software Development
akosma
PRO
0
320
渡米前の準備を制す!re:Invent 2026徹底準備術 / The Ultimate Preparation Guide for re:Invent 2026
yuj1osm
1
370
これだけは抑えておきたい!後悔しない re:Invent の過ごし方 / AWS re:Invent 2026 prestudy
kinunori
2
520
書き手が人でもAIでも正しくなる道、SREを埋め込んだDeveloper Platform / tech drivers day8
chmikata
4
810
AIエージェント時代、Kaggleにどう取り組むか
takanao
2
360
Claude Code をローカルとサーバー上で利用した際の Bedrock 利用料をユーザー単位で一本化してみる
ohorig
0
180
"計画的無茶振り"を通してAIネイティブ世代の新人を育てる
subroh0508
1
120
推論基盤と Scale-Up Interconnect の現状と制約から俯瞰する技術動向
markunet
2
580
Claude Codeから見る、エンジニアの世界の変容とその先
oikon48
7
4.7k
AWSDirectConnectの構築の進め方を整理してみた
masa_my
1
210
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
699
190k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Navigating Weather and Climate Data
rabernat
0
560
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
600
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
540
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
720
WENDY [Excerpt]
tessaabrams
14
40k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
230
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
350
Raft: Consensus for Rubyists
vanstee
143
7.8k
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が使えるなら使いたいが未検証)
終 ありがとうございました