Transcript for:
Guide to In-App Subscriptions Setup

In this tutorial series, you'll be building this demo which features in-app subscriptions. You'll learn how to set up renewable subscription in-app purchases, you'll learn how to display those in-app purchases in your app and let users buy them, and you'll learn how to programmatically check the user's level of access so that you can unlock the paid content if they've bought the subscription. Hey Code Crew, I'm Chris and welcome to Code with Chris, the place to be if you want to learn how to code and build apps. Now there's a lot of talk about how difficult and finicky it is to implement in-app purchases in your app and you know what people are right it can be a nightmare and that's why I haven't covered in-app purchases on this channel up until now. The folks over at Revenue Cat reached out and were kind enough to sponsor this video for me to check out their platform to see how they help us implement in-app purchases and you know what I found out using Revenue Cat it only takes a few lines of code to implement in-app purchases in your app. In addition to that, it also makes it easy for you to get detailed analytics about how users are interacting with your in-app purchases and to also experiment with different offers so that you can optimize the revenue per user. It's such a smooth experience and this is what I want to show you through this app series. So here's how we're going to do it. Step one, we're going to set up the accounts that we need. and this includes an Apple Developer Program Membership as well as a free Revenue Cat account. Step 2, we're going to set up our Xcode project for the demo we saw earlier, and we're going to set up our App Store listing through the App Store Connect Portal. After that, we're going to configure our in-app subscriptions through the App Store Connect Portal. I'll show you how to set pricing, I'll show you some best practices and tips for configuring your in-app purchases so that you can build your product catalog in the future without it becoming impregnable. big mess. After that we're going to add our app to the Revenue Cat platform and we're going to configure our products offers and entitlements and this is where the magic happens. It's going to allow us to easily implement in-app purchases in our app even if it spans across multiple platforms and it's going to allow us to mix and match different products with offers and allow us to experiment with which ones work best with our users. Step five we're going to get down and dirty with Xcode and we're actually going to build that demo that you saw earlier. After that, we're going to add the revenue SDK to our Xcode project. Then we're going to add those couple of code snippets that's going to allow us to pull our offers down to display in-app. It's going to allow the user to make purchases and it's going to allow us to check the level of access that the user should have. And that's how we know what content to unlock in our app. Finally, I'll show you how to set up some sandbox test user accounts so that you can actually test those in-app purchases in a sandbox environment on an actual device. In this lesson, we'll get started with steps one and two. Let's go. All right, so let's set up the two accounts we need. The first one is an Apple Developer Program account. Now, it's not enough to have an Apple Developer account, you need to be enrolled in the Apple Developer Program that you see here. And the reason for that is because it's going to allow you to submit apps to the App Store, and in turn be able to set up app listings. and configure in-app purchases for your app. If you're not enrolled in the program, unfortunately, you won't even have access to the portal where you're going to be able to configure those in-app purchases for your app. So that's number one. Number two is you're going to need a free Revenue Cat account. Now, Revenue Cat doesn't just make it easier for you to implement in-app purchases into your app, but it also has a lot of additional features for you to track your analytics. and experiment and mix different products and offers to see which ones convert better and in turn make you more money. The best thing about it is that it's free to use until you're making $10,000 per month in revenue. And hey, if you're at that point, you'll definitely have enough money to invest in a tool like Revenue Cat, which is going to in turn make you even more money. So to sign up for your free account, go to cwc.to slash revcat. Now I don't get any compensation for that, but... it does let the team know that you guys are interested in seeing more content on in-app purchases and app monetization. So if you want to see more tutorials in that area, then definitely go through that link cwc.to slash revcat to sign up for your free Revenue Cat account. All right, now we're on to step two. We're going to create our Xcode project, and then we're going to jump into the App Store Connect portal and set up that App Store listing. in preparation for configuring our in-app purchases. So here I've got Xcode open. I'm going to create a brand new Xcode project and I'm going to, let me just move that up here. I'm going to choose Single View App and for this product name, I'm going to call it the RevCat Demo. And all of this is going to be the same language as Swift User Interface is stored. report for this project and you're not going to be needing any of these options so leave those all unchecked what's really important to note here is this bundle identifier com.co with Chris dot rev cat dash demo and this string here is comprised of this information that you have up here that's going to be really important because we're going to need this for our App Store listing let's go ahead and click Next to create this project And I'm just going to go ahead and save that on my desktop. And as you can see here in the project properties, this is the bundle identifier that we're going to need. The next thing I want you to do is go over to the signing in capabilities tab and just take a look at what you have here. You should have it automatically manage signing if you've attached your Apple developer account to your Xcode preferences. And what it's going to do is. it's going to generate all of the provisioning profiles app ids and certificates that you need all automatically under this bundle identifier now sometimes it doesn't generate that app id right away but there's one thing that we can do here to sort of get xcode to automatically generate those things straight away click on plus capability here and scroll down all the way to in-app purchases and you can go ahead double click that and add that right here. You saw some activity happening there. It was generating the app ID based on this bundle identifier, the provisioning profile, and all of that stuff. Now, don't worry if you weren't able to add this capability right now, or you weren't able to get this part to work. I'll show you later in the portal how you can manually generate that app ID and provisioning profiles. all right so now with your xcode project set up we have our bundle identifier and we should have our app id what we're going to do is jump into the app store connect portal and this is something you get access to when you enroll in the apple developer program you manage your app store listings here you can look at analytics and how they've been selling you can also submit all of your uh banking and contract information i mean where's apple going to send your money right all of that sort of stuff and here in users and access you can set up other administrators and also test users which we'll get to in the latter part of this series because we're going to need to test our in-app purchases and this is where we would set up our test users as well so the first thing we want to do is go into my apps and we're going to set up a new app store listing for the demo that we just created so click on the plus icon up here and choose new app and we're going to select the ios platform and for this name we're going to choose revcat demo let's set the primary language to english i'm going to set it to canada because i'm canadian and for the bundle identifier this is where we want to look for that bundle id that we had set in our xcode project so hit this drop down and see if you can find it see if you can find a revenue or whatever you used for me it's this one right here com.codewithchris.revcat-demo. If you can't find your bundle ID in this drop-down right here, what you're going to need to do is go to the provisioning portal and that's at developer.apple.com slash account. You log in with your Apple account that is enrolled in the Apple Developer Program and you're going to see on the left hand side navigation certificates IDs and profiles. So go ahead and click that. And you're going to want to go to identifiers. So here you're going to manually add the app ID since it hasn't automatically been generated yet by Xcode. So go ahead and hit this plus icon and register a new app ID. Click Continue. Choose app. as the type click continue and in the bundle id here you would basically copy what you have in xcode for this bundle identifier and you would paste it in here and then you would set up some description and under capabilities just double check that in-app purchases is enabled or at least enabled and grayed out you know if that's the case let's see we have to put in some sort of demo here rev cat demo then you would hit continue and you would go through the rest of the wizard to create this or register this app id with this bundle identifier after you do that you go back to this app store connect portal and you're going to have to cancel out of this dialog And just hit refresh on the entire page and then try to add your app again and go through that same process that. We just went through, set the primary language, and your bundle ID and app ID should show up here now. Okay, so SKU is for internal purposes. I'm just going to call this rcdemo3. User access, we can just leave it as the default right now, unless you do have multiple users on your account and you know what to select here. Let's go ahead and create our new app. So once this app store listing has been created, now we're going to be able to customize the in-app purchases. If you look at the left hand side navigation, you'll see in-app purchases. Go ahead and click manage. All right, so here we're going to click this little blue plus icon and you're going to see that there are different types of in-app purchases that we can create. In this app series, I'm going to show you how to do auto-renewable subscriptions, but you can see that there are also consumable, which are... things like potions and magic items that you can buy in games, for example, or credits, things that can be used up. Non-consumable are unlockables, so things like maybe unlocking a racetrack in a game that you would indefinitely have access to, or unlocking extra levels, or unlocking costumes in a game, or something like that. Auto-renewable subscription is something that you're probably used to. It's It's like your Netflix subscription or your Spotify subscription. It just renews every billing period. And non-renewing subscription is the same thing, except that at the end of the period, it doesn't automatically renew. So in the next video, we're going to go forward with auto-renewable subscription, and I'll show you how to set these things up. Alright, so far we've completed steps 1 and 2 in our outline. We've enrolled in the Apple Developer Program and we've set up our free RevenueCat account. If you haven't done that already, go through the link cwc.to slash revcat to sign up for your free RevenueCat account. Again, I'm not going to be compensated in any way if you do that, but it is going to allow their team to know that we want to see more content on in-app purchases and app monetization. So if that is the case for you, then definitely go through that link and sign up for your free account. Alright, now I want to turn it over to you. Do you want to monetize your app and make money off of it or is it going to be free without monetization? Let me know by leaving a quick comment below. Lastly, if you like this video, please give it a thumbs up and don't forget to subscribe so you don't miss the next lesson. In the next lesson, we're going to configure our in-app subscription products in the App Store Connect portal. Alright, thanks for watching. I'll see you there.