Hey What's up ladies and gentlemen Mark Price here at Dev slopes dot com.
And in this exciting section you're going to learn how to make money with in-app purchases.
Well if your app sucks it probably won't make money but you'll still learn how to do the purchases and
don't make a crap yet.
Make a good app and then people will spend money on it.
So let's hope you make some money and let's learn about in-app purchases.
So first things first is I've got my X code open on a different monitor here we're going to go file
new project.
I'm it over here for you.
OK and we're going to do a single view application and our apps can be very simple in terms of how it
looks and feels because this lesson is all about making in-app purchases and the steps that you need
to do.
And it's not as easy as you might think.
So let's go ahead and give this name here our app here is called Daily Dose.
So we're going to call this Daily Dose swift language is good.
Everything else here is good.
And I'm just going to store a folder I have here.
Very very good.
OK.
So a couple of things that are really important to understand is that when working with in-app purchases
you actually have to have an app on the App Store at least on iTunes Connect it doesn't have to be launched
but what I'm saying is you have to have the app there and you can't do that unless you are a paid Apple
developer you have to at least have paid the $99 Apple developer fee in order to even test in-app purchases.
And you're also going to have to set up some things on your developer account as well too.
So remember there's Remember there's developer to Apple dot com and there's iTunes Connect that Apple
dot com iTunes Connect is where you upload the apps and Apple developer is where you manage your developer
account you're going to need to work with both.
But never fear.
I'm going to show you exactly what to do.
So what I'm going to do is open up my browser here and I typically use Safari when working with the
Apple Web sites because they have features that they only work on safari.
It's kind of annoying but so developers at Apple dot com as you can see right here and we are going
to go into account put in your credentials.
If you don't have credentials you're going to need to create a developer account.
It's free there's parts free.
OK.
And then you're going to do is you're going to go to certificates identifiers and profiles and the next
thing that we're going to do is we're going to go over here to the identifier section where it says
app IDs and we're going to create a brand new app I.D.
We're going to call this Daily Dose as the name.
That's just a name for you to recognize it as.
And this is important here.
This is the bunda lady and this is the bundle I.D. that you'll be working with in your ex code.
So one of the com slopes got Daily Dose calmed soap's thought Daily Dose.
That's what we're going to call our bundle subscription here.
Of course you would use your company name or individual account name.
And then what we're going to do is scroll down and click Continue in-app purchases is already selected
by default as a feature.
We're going to click continue.
Everything here looks great and we're going to click register and then done.
So you have to register an app I.D. So your iTunes Connect can find the app every app in the world of
app development has an app I.D. or bundle ID that an app needs to be associated with.
The next thing we're going to do is go to iTunes Connect dot apple dot com.
Now again this portion is where you actually need to have a paid Apple developer account at least an
individual one for $99 a year and you need to make sure that all of your agreements tax and banking
agreements are signed and filled out and ready to go.
Otherwise you can't create new apps.
It won't let you.
OK.
So what we're going to do is we're going to go into my apps again if you don't see this my app section
is because you're not a paid developer and you have to be a paid developer to work with in-app purchases.
And of course to submit apps to the App Store.
So my apps.
And then what we're going to do is we're going to create a brand new app.
Clicking the plus button
we're going to do iOS only and this one we are going to call daily dose.
The language is going to be English.
US at least for my app.
You can choose whatever you want.
The bunda lady is going to be the one that you just created daily dose.
If you did not just create that over a developer to Apple dotcom with your sinked developer account
then this wouldn't be here.
OK.
Barss So that's great.
If you're not seeing it there.
I have noticed that sometimes it takes a few minutes for developer account to refresh with iTunes and
make that connection.
Secondly you're going what you're going to want to make sure that you're a developer to Apple that comic
is associated with your iTunes Connect account.
Hopefully those are with the same iTunes ID on the same account.
So you may have to sync those and get them connected if you're not seeing this here.
The skew is just an internal app name or number that you want to give it.
We're going to call this daily dose limit user access we're not going to do anything with the click
Create.
No it doesn't like this name because someone obviously picked it so we're going to call this daily dose
of slopes.
You can call yours whatever you want.
This is just a test app anyway.
Someone else had that name on the App Store and it wouldn't let us do it so no big deal.
OK this is really cool so we've got we've signed up here.
We've got our app created.
One more thing I want to do before we get started is we're going to I'm going to click this iTunes Connect
right here and we're going to go over to users and rolls and what we're going to do is create a test
account or a sandbox account.
You cannot test in-app purchases unless you come here and create a test account so click sandbox users
on the right hand side.
And what we're going to do is create a new one give it a name.
Anything you want.
So tester.
Tester.
Email can be.
You know Joe at Bob dot com Jobab and password and needs have a lower case upper case a bunch of other
stuff that is put in any any combination of such a password.
I'm doing such a thing.
So secret question secret answer you have to fill all these things out.
So secret answer.
I'm just putting in boilerplate stuff here doesn't mean anything but your date of birth and any date
in here is fine.
And then territory we are going to pick United States.
In my case you can pick whatever country you want and just the Morton thing here to remember is the
e-mail.
Another important thing to remember is if you make a non consumable in that purchase like we're going
to do.
OK.
If you make a purchase like that your account that you create here will will only let you purchase it
once and when you restore restore it so any time you want to do multiple tests you're going have to
keep creating test users for non-consumer purchases because it ties it to that account like it's a real
iTunes account which is what you want.
So Joe at Bob dot com that e-mail is already associated I could well just pick a new one we're going
to say dev at Divell developer dot com
doesn't like that either.
Wow.
OK.
We're going to say what we want to say.
One two three at devah slopes dot com.
Again you're not going to get an e-mail or anything.
Are Just test accounts tester one two three at slopestyle calm.
In my case here OK.
So there we go.
Are One two three it does subside.
So what we've done is we've created a bundle ID on developer dot apple dot com.
And then we went into iTunes Connect that Apple dot com and we created a new app and we associated that
Bonds ID OK.
And the last thing to do is just make sure that our app down here has the exact same bundle ID as the
one in developer to Appledore.
And it doesn't.
So we're going to change that out from the dash to the dot.
So calm that slopes that daily dose and what we can actually do is you can go to X code preferences
OK and you can enter your account here and if you don't have it here already or you can click download
all profiles here if you do have it entered and it will actually download the bundu IDs and match everything
up for you.
So one last thing to do here and ex-coach is go to capabilities.
Now that we have our bundle ID correct go to capabilities go down to in-app purchases and click on and
if both of these have checks it means it's now connected the bundle ID that's on developer to Apple
dot com and you are ready to go.
So I know it was a lot.
I'll recap one more time what we did.
We registered a bundle ID and developer to Apple dot com we created an app on iTunes Connect dot dot
com OK we created a test user so we can actually make a sandbox in-app purchases without spending real
money which you have to have.
And then we came here and X code and we made sure that the bundu ID match what was on developer to Apple
dotcom.
Then we went into capability's thing that's five capabilities and we turned on in-app purchases so you
are now ready to actually start writing code so you can make in-app purchases.
So let's call this video done.
If you're not the speed here go ahead and get up to speed with your account and then I'll see you back
here for the next exciting episode.
Mark Price here at Dove slopes dot.com.
See you soon.