Hi Alex here from rebeloper.com and in this epic tutorial series I will teach
you all about in-app purchases in Xcode 10 with Swift 4.2 and in iOS 12. You will
learn about in-app purchases like auto renewable subscriptions, non consumable
subscriptions and of course consumables and non consumables and much much more
how to handle all of this in your code and in the App Store Connect Dashboard
so without further ado let's get started!
Great! Now let me just show you what we are going to build out today and for
that I will show you the final project that I have created here. And please do
know that we need to have a real device to test out in-app purchases because you
could test out some features of in-app purchases on the simulator but
purchasing can be done only on a real device. Okay so let me just show you my
device here and let's just build and run this final project.
Okay let's select our phone here and let's build and run. Okay here we go
and we are in. Okay this is pretty good but before I go into the details let me show
you because this will occur for multiple times in the your development lifecycle
how to get rid of all of the cached data. So what you need to do first is stop
your project from running and let me just show you here. Simply delete your
app from your device or from the simulator.
Okay let's click on done here and off it goes. Next up if you are using
Rebeloper Store Pro because in just a minute I will show you and discuss you about
what's the difference between Rebeloper Store Basic and Rebeloper Store Pro
just go ahead and go into RebeloperStoreSetup and under resetKeychainToDefaultValues
set this to true. Okay I will go into these details just in a few
videos from now. Okay next up what you want to do is go under product and select
Clean Build Folder. Okay and now update the clean has been done again build and
run. Okay let us just wait for that and build has succeeded let me just simply
let me just stop that again so I may remove the place of my app to the front
screen so you don't see any new projects coming up. I will simply build and run
again. Here we go there is our Rebeloper Store and a build. And now you
will get a brand new build of your project. And now let us just grow
through what we have here. First of all and do take a look at the log when any
action is performed in the app so you may see how Rebeloper Store logs your
actions. Okay, first of all we have a Consumables screen and we are going to
start this tutorial off with this screen. And as you saw earlier the bag of coins
and the chest of coins have fetched from App Store Connect all the
information is displayed in this nice UI collection view. Next up and of course we
have our 1000 coins added on the first launch of our app and this little
red arrow at the top right corner of our screen is the restored purchases button.
Okay let's go to our non consumables. Now no consumables are like that no ads non
consumable in-app purchase or let's say unlock a new level. As you can see here
we have a banner a go to next level button and the two in-app purchases.
Let's go further! Here we have our Auto Renewable subscriptions. Now we have set
up two groups one for drink coffee and the other one is eat donuts. Okay for now
we are not trying for that and we have free in-app purchases for drink coffee: a
weekly, a monthly and quarterly and the one for eat donuts and that is for a
weekly subscription. Okay let's go even further we have our non-renewable
subscriptions and here we have only a drink coffee subscription. Okay let's go
even further and this is where the real magic happens. Let me just show you what
this last tab bar means and as you can see we have virtual goods and a
secondary virtual currency. Let's select virtual goods. Ok now you can see that we
have 1,000 points, 50 gems, 10 bombs 0 swords and 0 helmets. Okay and of course we
have our Use Bomb button because that is a virtual good that is consumable. Great
and below you can see the free virtual goods. One is the sward that can be
bought with coins. This is virtual non-consumable because
you just buy it and use it and you buy it for coins. Let's jump right down to
the helmet which is again another virtual good that is a non consumable
but this time you buy it with 18 gems. So not just coins you buy it with the
secondary virtual currency. Now let's talk about the bombs. Now the bombs are
a consumable type of virtual good and of course you can buy it at this time with
150 coins. You could buy it with gems too. So that is it for our app. Let we just go...
Oh I just forgot how do you buy secondary virtual currency the gems well
it is pretty simple let's go to secondary virtual currency
and here we have our stats for the currencies and then we have an option,
two options to buy secondary virtual currencies: bag of gems and chest objects.
Of course you buy gems the secondary virtual currency with the first or
primary virtual currency with coins and that is how easy it is to have virtual
goods, virtual currencies that is really important for modern let's say
free-to-play games in your portfolio. Okay that is it for the walkthrough of our
app that we are going to build now let's take a closer look at the project.
As you can see I have created a starter project so where can you download this
starter project well go ahead and click the link down below and you will be
taken to all of the resources needed. Okay, and let's just talk about a few how this
project is set up. Okay, first of all let me just show you
where you will be taken with the link to my starter project so you will be able
to download it and we will do that in the next video but for now let me just
show you the GitHub repository. Here it is RebeloperStoreStarter
you will be taken with the link to this project. Okay, you can clone it or
download it we will clone it in the next tutorial. Now let's take a look at some
helper repositories that really make up the good stuff that Rebeloper Store has
to offer. And for that I will go back to my Xcode
here and let's take a look at the podfile. And I will just minimize this lock
here of course the platform is iOS 12 and we
are looking right now at the podfile and we are using MerchantKit. Now
MerchantKit is a really really good alternative to the others out there
because it's a brand new approach of using the store kit framework and let me
just show you where that is of course all of these will be linked in the
resources. It is about from a Benjamin Mayo if I spelled that out correctly and
you can take a look at how a MerchantKit works but you really don't have to
because Rebeloper Store takes care of simplifying all of the actions. Now let
me just go back to my Xcode project here and you can see that here we have Pots
for Rebeloper Store Basic. And for the Rebeloper Store Basic that's basically it
so you don't need kitchen swift or bulletin board that is because we
Rebeloper Store Basic supports only the consumables. If you want to have non
consumables, auto-renewable subscriptions, non-renewable
subscriptions and the whole virtual goods
and currency stuff then you need to upgrade to Rebeloper Store Pro but I
will talk about that in just a few lessons. For now do know that LeychainSwift
and BulletinBoard are needed only for Rebeloper Store Pro. Now you can
see that I have Pods for our example project too because all of these
UICollectionViews and all of these views inside them need to be handled by some
pro good GitHub repositories and I have chosen CollectionKit and
TinyConstraints. And I'm just show you there so here is Keychain-swift here is a
BulletinBoard, if you want to take a look at it. And here we have CollectionKit
that handles UICollectionView controllers and it is so sweet I will
create separate videos on this. And TinyConstraints that handles anchoring
and positioning views inside our app. And I will most probably create new videos
on TinyConstraints too. Let's get back into our Xcode and as you can see we
have some version limitations and that is because I want to make sure that the
Pod that you install works correctly. Of course I will periodically update to the
newest version of MerchantKit and the other Pod files too. Now I hope you are
really excited about the new ways of creating in-app purchases into your apps
and hope you are eager to find out more about Rebeloper Store and the Rebeloper
Store starter project so in the next video we are going to do just that,
we are going to download Rebeloper Stored starter project and we are going
to get working on in-app purchases. Now I hope you enjoyed this video, if you did
go ahead and give it a thumbs up and subscribe to the channel and I tell you
to hit that notification that to get notified when
new uploads of this awesome in-app purchases tutorial series will be
updated with new videos so without further ado let's get into the next
video so I will see you in the next one!