How to Monetize Your iOS App with Tip Jar: A Step-by-Step Guide 💰
ฝัง
- เผยแพร่เมื่อ 5 ส.ค. 2024
- Make Money While You Sleep 😴 Build A Tip Jar In SwiftUI Using StoreKit2 💰
**********************************
🚨 To help with your app submission make sure you watch the chapter with the checklist🚨
Timestamps:
00:00:00 - Intro/Preview
00:00:58 - What is StoreKit2?
00:01:34 - What are the different in app purchase types?
00:02:26 - Project Breakdown
00:04:38 - Creating & Setting Up A StoreKitConfiguration File In Xcode
00:07:01 - Setting Up Test Products With StoreKitConfiguration File
00:10:09 - Getting a single product using StoreKit2
00:14:42 - Changing your StoreKitConfiguration File Storefront
00:15:43 - Getting a list of products using StoreKit2
00:26:15 - Making a purchase using StoreKit2 (Tipping in-app)
00:35:58 - Handling a successful transaction in StoreKit2
00:42:46 - Error handling in StoreKit2
00:51:52 - Listen to transaction updates in StoreKit2
01:00:51 - Handling In-App Purchase Interruptions
01:02:03 - Managing transactions in Xcode
01:05:24 - Filling Out Your Agreements, Tax & Banking
01:07:21 - Setting up products in AppStoreConnect
01:11:40 - Things to note
01:12:07 - Adding Proof During Submission
01:12:45 - Making Sure It Works In TestFlight
01:13:28 - In-App Purchases Debugging Checklist
01:17:54 - Summary
**********************************
In this tutorial, we'll learn how to create a tip jar in a SwiftUI app using the StoreKit2 framework. We'll start by setting up our project and configuring our in-app purchase products. Then, we'll implement the user interface for our tip jar, including a button to initiate the purchase process and a label to display the current balance. Along the way, we'll explore best practices for handling in-app purchases and handling errors. By the end of this video, you'll have a fully functional tip jar in your SwiftUI app, ready for users to start tipping.
**********************************
Check Out My Courses 👨🏽🏫
Enjoy my teaching style? Check out my other courses on my website that may interest you, they range from beginner to advanced topics within iOS development.
Link to Website
tunds.dev/#courses
**********************************
Join the crew 🤝
Want to help support the channel? Become a member with the join link below and get access to exclusive badges, stickers, and other perks coming soon.
Become a channel member
www.youtube.com/@tundsdev/join
Support in other ways 💕
You can support me for free and help the channel grow so that I can continue to make the best iOS development content for you by liking, commenting, subscribing, and hitting the notification bell.
All this really helps my channel grow and allows me to keep making content for you. If you're interested in subscribing to the channel then you can do so with the link below.
Subscribe to the tundsdev TH-cam channel
th-cam.com/users/tundsdev?su...
**********************************
Download Source Code
Interested in looking at the source code? Then check out the GitHub Repo below
github.com/tunds/youtube-cont...
**********************************
EditorKeys
View Editor Keys Amazing Products with the link below and use the discount code for 10% off any product
www.editorskeys.com/tundsdev
Get a 10% Discount Code on any product with the code below
TUNDSDEV
See my keyboard cover in action with my review below 👇🏾
• Increase Your Xcode Pr...
**********************************
RØDE Wireless Mic
amzn.to/3D5qo3V
RØDE SmartLavPlus Microphone
amzn.to/3DtVUdG
2021 Apple MacBook Pro (16-inch, Apple M1 Pro chip with 10‑core CPU and 16‑core GPU, 16GB RAM, 1TB SSD) - Space Grey
amzn.to/3Drc2fH
Apple Magic Keyboard with Numeric Keypad (Wireless, Rechargeable)
amzn.to/3VUctXh
Apple Magic Mouse
amzn.to/3sqXSoM
Secretlab TITAN 2020 Charcoal Blue Gaming Chair
amzn.to/3D2jVXI
ErgoFoam Ergonomic Foot Rest for Under Desk
amzn.to/3srJOLM
Lumbar Support Pillow
amzn.to/3eXVfrg
Macbook Stand for Apple Macbook and All Notebooks
amzn.to/3DqG7vR
Portable Chair Green Screen Background
amzn.to/3gG62GU
**********************************
#iosdev #iosdevelopment #swift #swiftlanguage #xcode #appdevelopment #mobileappdevelopment #iosappdevelopment #appdeveloper #iosprogramming #iosengineer #appdevelopmenttips #iosdevelopmenttips #swiftui
Is not just one of the best videos for Store Kit 2, its the only one who takes you step-by-step including App Store Connect setup. Thanks, Tunds! 🙏
Glad it was helpful!
This is so amazing!! I’ve always just watched your videos quietly but this time I wanted to say I love all of your tutorials! Thanks so much for what you do!!
Glad you’re enjoying it 🤝
God level tutorial Tunds. Now to sit down, do some hard graft and get my first app in the Store.
Thanks for the donation, and you got this. Looking forward to seeing what you build 🤝
@@tundsdev The app is ready, just need to figure out this payment stuff and get it in the store, I'll let you know. Thanks my man!
Excellent….💯 Thank you 🎉
Welcome!
Awesome video as always!...... keep posted.... learning a lot from you
Glad you enjoyed it 🤝
very cool exactly
Thanks!
No problem!
You... you are a wonderful man. Thank you for making this video and the helpful explanations. Learned so many new things from this. Liked and subscribed!
Thanks, glad you enjoyed it 🤝
Tunes, you are a legend. Your vids are awesome - keep up the amazing work. A tip is the least I can do for ma boy
I really appreciate the tip, since i’d be more that happy with you just sharing the vids with others who might find this interesting to help the channel grow, so this means a lot & a big thank you again bro 🤝
This is super important but for some reason there aren't that many StoreKit2 tutorials on YT. Thank you so much!
Glad you think so!
Signor Tunds, I have watched the first 4 minutes of your video, and I can already tell that I'll enjoy it and learn a lot from it, and so I just want to thank you very much. Greetings from Italy.
Dang really appreciate the comment and glad you enjoy the content!
Top tier tutorial ✌
Thanks 🫂
Bro, your videos are helpful 👍
Glad you enjoyed it
Really good video
Thanks 🤝
Thanks this is really helpful
Glad it helped
what a legend
No, you're the legend for the support and watching me!
Thanks
Haha you really didnt have too my man, thanks for the tip 🫂
You saved my day, Tunds! I completely forget about your video and I was struggling a bit, now I fully understand the hole proccess.
Your work is absolutely amazing. You both inspire us and lead us with the best coding skills. One question: Can we have different app users with specific pages and transfer the tip amount to their account instead of ours?
Thanks and nope this would require a third party of some sorts
Great video. Thanks. I don't see the 'Fail Transactions' option in XCode 15. I have XCode 14 also and I can see in that. Any idea if it got moved somewhere?
Thanks & yh it got moved. If you click on the storekit configuration file you should see a new option called “Configuration Settings” change it there 👌🏾
@@tundsdevThank you for the quick reply. Found it there. This video is exactly what I was looking for...to put a donate button in my first app :)
Have another question. I have setup in-app purchases in app store connect. I will create a new storkit synced config file. Does this replace sandbox testing? When I upload it to testflight, do I need to create a sandbox user and test on my real device? Thank you!
Yh if you want to test in app purchases 100% setup a sandbox account for sure
Legendary video!
I added a Dutch locale to the products, but it seems he is only going for the default locale I defined in the StoreConfiguration file. Do you know if there's extra work needed for this? Might also be a bug as I'm on iOS 17 and Xcode 15
So on the StoreConfiguration file you need to click on it and then there should be an option on the editor to change the storefront and you can set it to whatever is available 👌🏾
@@tundsdev I noticed and tested on TestFlight as well, but setting a different language in my system doesn't change the in app purchases locales. The rest of the app is translated correctly though
So it wont work in testflight since that uses the actual products in appstoreconnect so you’d need to set them up in there and then changing your device region and locale should update it.
@@tundsdev Ohhh. I set those all up in App Store Connect, but they are waiting for review. Does that mean the extra locale will not work until Apple has reviewed the in-app purchase?
Hmmm i didnt think it would tbh. I’m not too sure whats going on with your device. But i have defo tested this in xcode before testflight on the simulator and i just changed the locale and it worked fine for me. I’d watch one of the WWDC videos about testing out locales in StoreKit since i can’t attach a vid or screenshots here 😅
I followed the tutorial but instead of using a sheet I used a whole new view for it. It works fine but on iPhone SE 3rd gen simulator, the tips are not displayed at all, the title and description are. Anyone help?
deleted my storekit config file and created new one. Fixed the issue
I'm using Xcode 15 with a iOS 17 app but I get this error when we get to the part where we verify the purchase `Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates.` any ideas on how to fix this?
Nevermind you went over this, just like testing it at each step but I'll continue to follow along haha.
@Bankai3474 Haha no worries, defo watch the whole video and then implement it step by step 👌🏾
Yeah haha, now I get an issue when trying to use the onChange modifier and it expects the TipsAction to conform to equatable.
Ok, well conforming to equatable worked, which makes sense due to the method you wrote. I swear it wasn’t working before lol.
@11:44 maybe you don't have the 'canvas' on, that should enable the embed..
I have it turned off on purpose, since sometimes storekit doesn’t play nicely with the swiftui preview 😅
Using the simulator is way more reliable
@@tundsdev true, but i guess at timestamp @11:44 you were trying to command + click to get the dropdown option “embed in Vstack”. If you have the Canvas on, you will see the option on Cmd+click
Yh I still find it weird how the two are connected, but I do forget that sometimes 😂
Teşekkürler.
Thank you!!!