0 1 00:00:00,950 --> 00:00:04,660 Hello, everyone. It's Angela from the App Brewery here again. 1 2 00:00:04,670 --> 00:00:10,580 And in this module, we're going to learn all about In-App Purchases and how to implement them 2 3 00:00:10,580 --> 00:00:16,490 for our apps to start earning extra bucks for all of the apps that you make. Now, if you ever played any sort 3 4 00:00:16,490 --> 00:00:20,300 of game on the iPhone, you should be familiar with in-app purchases as well. 4 5 00:00:20,320 --> 00:00:28,490 A lot of apps will push them heavily onto you. And you can buy a whole wide range of in-app 5 6 00:00:28,490 --> 00:00:36,120 purchases from gems, the time, the energy, the coins, and, basically, everything that you can imagine. 6 7 00:00:36,200 --> 00:00:41,530 Now, the most important thing to notice about in-app purchases is that they are virtual. 7 8 00:00:41,540 --> 00:00:45,120 So essentially, it doesn't cost you any money 8 9 00:00:45,200 --> 00:00:51,830 when a user purchases one of these in-app purchases. It's only digital bits and bytes being moved around 9 10 00:00:51,860 --> 00:00:56,960 on Apple's servers and it's not something that you have to provide like an actual physical T-shirt that 10 11 00:00:56,960 --> 00:01:01,110 you're selling them or sending them an Uber car driver who'll drive them around. 11 12 00:01:01,190 --> 00:01:07,640 And this is why Apple has the privilege of charging you 30% of everything you make through in-app 12 13 00:01:07,640 --> 00:01:08,600 purchases. 13 14 00:01:08,600 --> 00:01:15,230 So if you charge a pound, they'll take 30p. If you charge a dollar, they'll take 30 cents, essentially. 14 15 00:01:15,320 --> 00:01:20,780 Now, it's really important that you remember that. In-app purchases are only for virtual products and 15 16 00:01:20,990 --> 00:01:26,660 all virtual products that you sell through the App Store has to go through Apple, and therefore, you have 16 17 00:01:26,660 --> 00:01:28,550 to pay them the 30%. 17 18 00:01:28,550 --> 00:01:31,670 It's a little bit like a Mafia protection money. 18 19 00:01:31,910 --> 00:01:34,040 But, anyways, let's move on. 19 20 00:01:34,040 --> 00:01:37,130 So why do we need in-app purchases anyways? 20 21 00:01:37,130 --> 00:01:42,970 Well, because it's a really good way of increasing conversions on your free apps. 21 22 00:01:43,070 --> 00:01:46,000 So this allows you to put out your apps for free, 22 23 00:01:46,130 --> 00:01:52,460 making it more tempting and easier for users to download your app, giving it a go, and seeing what the 23 24 00:01:52,460 --> 00:01:59,890 features are before you start charging them for, say, premium features or to remove ads. And in-app purchases 24 25 00:01:59,900 --> 00:02:02,080 work extremely well. 25 26 00:02:02,090 --> 00:02:06,830 This is one of the reasons why if you search on the App Store and you look at the top grossing iPhone 26 27 00:02:06,830 --> 00:02:11,110 apps, you can see that pretty much all of them are free to download, 27 28 00:02:11,240 --> 00:02:14,030 but they all include in-app purchases 28 29 00:02:14,060 --> 00:02:18,910 every single one of these, usually. And that is how they make big bucks. 29 30 00:02:18,950 --> 00:02:25,460 So the best way of implementing in-app purchases, from my experience, is giving the user about 80 percent 30 31 00:02:25,520 --> 00:02:33,440 of all the functionality of your app for free, and only then put up a pay wall where they have to pay 31 32 00:02:33,770 --> 00:02:40,340 to get an in-app purchase to upgrade to the premium version or to remove ads, or whatever it is that 32 33 00:02:40,340 --> 00:02:44,280 gets them that last 20% out of your app. 33 34 00:02:44,330 --> 00:02:50,600 This is what has worked really well in a lot of other apps including one of my favorite which is called 34 35 00:02:50,750 --> 00:02:51,560 Overcast. 35 36 00:02:51,560 --> 00:02:58,700 It is one of the best podcast apps out there. Hands down. And the developer is a really cool guy called 36 37 00:02:58,710 --> 00:03:05,620 Marco and he's an incredible developer, but he's also managed to implement this 80:20 with a paywall 37 38 00:03:05,630 --> 00:03:09,160 in a middle type of strategy really well. 38 39 00:03:09,200 --> 00:03:14,080 So check out the app and see how he implements these in-app purchases. 39 40 00:03:14,090 --> 00:03:21,080 Now, before we get started adding in-app purchases to our app, there are two things that you have to have 40 41 00:03:21,080 --> 00:03:25,250 before you can actually even run or test the code. 41 42 00:03:25,250 --> 00:03:33,530 First thing is you need a full Apple developer program and you have to enroll on this program before 42 43 00:03:33,530 --> 00:03:39,410 you can start adding in-app purchases to your apps in Xcode and start testing them. 43 44 00:03:39,410 --> 00:03:46,340 So this means that you stop paying them $99 per year and, ideally, you are close to releasing 44 45 00:03:46,340 --> 00:03:47,210 your app. 45 46 00:03:47,240 --> 00:03:53,000 Now, the other requirement is that you have to have a physical iPhone device to test in-app purchases. 46 47 00:03:53,450 --> 00:03:55,400 Even if you write all of the code right, 47 48 00:03:55,400 --> 00:04:02,360 it just won't work on the simulator, and it doesn't tell you very explicitly that it's not working because 48 49 00:04:02,360 --> 00:04:04,090 you're running on a simulator. 49 50 00:04:04,100 --> 00:04:10,190 So just be aware you need a full Apple developer account and you need to have a physical iPhone device 50 51 00:04:10,190 --> 00:04:11,380 to test it on. 51 52 00:04:11,390 --> 00:04:13,700 It doesn't have to be the latest or the greatest. 52 53 00:04:13,700 --> 00:04:17,840 It just has to be one that can run and side load your apps. 53 54 00:04:17,840 --> 00:04:22,550 So, now let's check out what we'll build by the end of this module. 54 55 00:04:22,550 --> 00:04:31,250 So this is a really simple app which will display a table view of motivational quotes for the user, and 55 56 00:04:31,340 --> 00:04:34,630 they get 6 for free when they download the app for free. 56 57 00:04:34,880 --> 00:04:40,580 And then there's another six or however many you want to put in there that are hidden behind the paywall 57 58 00:04:40,640 --> 00:04:46,760 and they have to purchase an in-app purchas in order to view the rest of the quotes. 58 59 00:04:46,820 --> 00:04:55,160 So when they tap on Buy, then they will be a pop-up and they'll have to enter their Apple ID and password. 59 60 00:04:55,520 --> 00:05:00,070 And once they've been charged, then you give them access to the rest of the content 60 61 00:05:00,230 --> 00:05:02,710 or whatever other content you want to give them. 61 62 00:05:02,780 --> 00:05:09,800 So in the process, we're going to be looking at how you restore in-app purchases, how you make purchases, 62 63 00:05:09,800 --> 00:05:10,730 and how you detect 63 64 00:05:10,760 --> 00:05:16,730 once they've been successful or if there are any errors. And so by the end of this module, you should 64 65 00:05:16,730 --> 00:05:22,580 understand how to implement in-app purchases for any future app that you decide to build and be able 65 66 00:05:22,580 --> 00:05:28,520 to listen for when the purchase has gone through successfully so that you can enable the premium features 66 67 00:05:28,520 --> 00:05:32,750 in your app and give your users access to more of your app. 67 68 00:05:32,750 --> 00:05:33,050 All right. 68 69 00:05:33,050 --> 00:05:36,020 So I hope you're as excited as I am about this tutorial. 69 70 00:05:36,080 --> 00:05:37,160 So once you're ready, 70 71 00:05:37,160 --> 00:05:39,320 head over to the next lesson and we'll get started.