1
00:00:07,050 --> 00:00:08,500
Hey everybody what is going on.

2
00:00:08,500 --> 00:00:10,610
This is Caleb with Dev's slopes dot com.

3
00:00:10,630 --> 00:00:17,620
And in this video we're going to conform to the S-K receipt refresh request delegate and that's basically

4
00:00:17,620 --> 00:00:22,280
going to allow us to call a delegate method called request did finish.

5
00:00:22,360 --> 00:00:26,990
This is called Every single time a subscription is made.

6
00:00:27,110 --> 00:00:27,620
OK.

7
00:00:27,730 --> 00:00:33,730
So whenever a request to buy something like our subscription is made it's going to upload the receipt

8
00:00:33,730 --> 00:00:34,720
to iTunes.

9
00:00:34,720 --> 00:00:39,910
It's going to go ahead and check to see if it's valid if it is we're going to go ahead and move on and

10
00:00:39,910 --> 00:00:44,790
check if our subscription is active using our function is subscription active.

11
00:00:44,950 --> 00:00:49,720
Then if it is active We're going to send a notification saying hey we're subscribed we're good to go

12
00:00:50,080 --> 00:00:56,830
and we'll set our non consumable purchase of hiding the ads will set that to be true if it's not if

13
00:00:56,830 --> 00:01:02,360
it's not active We're going to set it to be false and make those ads reappear.

14
00:01:03,070 --> 00:01:07,990
Otherwise if our receipt is not valid just like we've already checked if it's not valid we're just going

15
00:01:07,990 --> 00:01:13,860
to set everything to false so that the ads still hide and the payment is not valid for them.

16
00:01:13,860 --> 00:01:15,940
So that's what we're going to dive into.

17
00:01:15,940 --> 00:01:19,550
So pull open that X code project and let's get started.

18
00:01:19,550 --> 00:01:22,400
I am so excited to do this now.

19
00:01:22,420 --> 00:01:26,900
Like I said we're going to be conforming to S.K. receipt refresh request.

20
00:01:26,900 --> 00:01:28,550
But that's a mouthful.

21
00:01:28,750 --> 00:01:36,050
And so to do that we actually need to go up to the top and change how we're doing our IP service fundamentally.

22
00:01:36,160 --> 00:01:42,220
Now right now we are conforming to N.S. object which is a requirement of the S-K product request delegate.

23
00:01:42,400 --> 00:01:49,450
But watch what happens if I replace that with S.K. receipt refresh request.

24
00:01:49,450 --> 00:01:52,870
Now if I build it you'll see that it looks good although we're going to have to change the name of our

25
00:01:52,870 --> 00:01:56,880
delegate property here but I want to show you what happens if I put it at the end.

26
00:01:56,910 --> 00:02:03,130
OK if I put it over here wups if I put it over here S-K receipt refresh request.

27
00:02:03,130 --> 00:02:09,400
Watch this guy build it says superclass must appear first in the inheritance clause.

28
00:02:09,400 --> 00:02:10,550
Interesting.

29
00:02:10,570 --> 00:02:17,110
So if we do that let's put that here S-K receipt refresh request and then what if we tried to conform

30
00:02:17,110 --> 00:02:19,150
to N.S. object as well.

31
00:02:19,150 --> 00:02:20,390
Watch what happens.

32
00:02:21,200 --> 00:02:25,400
Multiple inheritance from S-K receipt request and N.S. object.

33
00:02:25,460 --> 00:02:27,870
That's because S A K receipt.

34
00:02:27,960 --> 00:02:28,700
Right.

35
00:02:28,910 --> 00:02:35,210
That's because S-K receipt refresh request also inherits from N.S. object so it's like a multiple inheritance.

36
00:02:35,210 --> 00:02:36,530
We don't need it.

37
00:02:36,590 --> 00:02:43,400
So now that we have properly inherited from S-K receipt refresh request we can go ahead and look through

38
00:02:43,400 --> 00:02:45,300
some of these errors that are popping up.

39
00:02:45,320 --> 00:02:49,580
So it's saying property delegate with type IAP service delegate.

40
00:02:49,580 --> 00:02:54,480
That's our protocol cannot override a property with type S-K request delegate.

41
00:02:54,690 --> 00:02:55,280
OK guys.

42
00:02:55,310 --> 00:03:02,480
So this is what the deal is since we are now inheriting from this class and conforming to this protocol

43
00:03:02,690 --> 00:03:05,760
we need to actually rename our custom delegate here.

44
00:03:05,850 --> 00:03:11,540
This is the protocol that we use to tell our other view controller when all of our in-app purchase products

45
00:03:11,540 --> 00:03:12,440
are loaded.

46
00:03:12,440 --> 00:03:18,410
So we're just going to call this IAP delegate and that will solve our problem because we are not trying

47
00:03:18,410 --> 00:03:24,770
to set the delegate of this we're trying to set the delegate of our protocol here to be our view controller

48
00:03:24,770 --> 00:03:26,480
and the other on the other screen.

49
00:03:26,570 --> 00:03:33,950
But if I build it now you'll notice there is another error and it's saying value of type S-K request

50
00:03:33,950 --> 00:03:37,000
delegate has no member IAP products loaded.

51
00:03:37,040 --> 00:03:41,990
That's because this delegate is the S-K request delegate and not our IAP delegate from up above.

52
00:03:41,990 --> 00:03:49,420
So we need to rename it IAP delegate like so IAP delegate and press ENTER build it.

53
00:03:49,610 --> 00:03:52,280
And you'll notice we are failing.

54
00:03:52,290 --> 00:03:53,940
Let's figure out why we're failing.

55
00:03:53,960 --> 00:03:59,720
It says can not assign value of type storefront VC to S.K. request delegate.

56
00:03:59,720 --> 00:04:05,720
Now it's asking us to cast it as S-K request delegate but that is not what the delegate is of our IP

57
00:04:05,720 --> 00:04:06,470
service.

58
00:04:06,550 --> 00:04:13,220
It's I a p delegate and if I build it you'll notice all of our issues go away because now we have properly

59
00:04:13,490 --> 00:04:14,630
fixed that.

60
00:04:14,630 --> 00:04:17,180
But we are not finished.

61
00:04:17,210 --> 00:04:22,850
So now that we are inheriting from S-K receipt refresh request I want to show you what is inside of

62
00:04:22,850 --> 00:04:28,100
this class Kasal Let's go into it and let's take a look.

63
00:04:28,100 --> 00:04:32,930
And what we're going to be able to do is to see what we can actually do inside this class.

64
00:04:32,930 --> 00:04:40,460
Now that we are officially inheriting from it so we can access receipt properties K like so we can call

65
00:04:40,460 --> 00:04:43,650
a function called S-K terminate for invalid receipt.

66
00:04:43,880 --> 00:04:45,200
We can call S-K receipt.

67
00:04:45,200 --> 00:04:48,940
Property is expired S.K. receipt property is revoked.

68
00:04:48,950 --> 00:04:51,590
S.K. receipt property is volume purchase case.

69
00:04:51,590 --> 00:04:53,880
We can even do some cool volume purchasing.

70
00:04:53,900 --> 00:04:58,360
This is only for sandbox testing so we we are.

71
00:04:58,460 --> 00:05:00,660
You wouldn't do this in like a real application.

72
00:05:00,800 --> 00:05:05,690
So you can use it for sandboxing but we're going to dive even deeper into S-K request.

73
00:05:05,830 --> 00:05:10,330
And if you look you'll see there are a couple methods in here and a couple of properties.

74
00:05:10,340 --> 00:05:14,260
The delegate that's the one that it was trying to set for us which we didn't want.

75
00:05:14,330 --> 00:05:19,550
We have a cancell we have a start which I'll show you where we've already called start in just a moment.

76
00:05:19,790 --> 00:05:26,680
But then we have S-K request delegate and inside of this there is the function request did finish ok

77
00:05:26,690 --> 00:05:32,540
and request did fail with air but we care about request did finish so let's go ahead and head back into

78
00:05:32,540 --> 00:05:34,850
our IP service here.

79
00:05:34,910 --> 00:05:39,510
By the way I said we already called start on an instance of S-K request.

80
00:05:39,740 --> 00:05:45,590
We did because the S-K products request if you dive deep you'll see it comes from S-K request so we're

81
00:05:45,590 --> 00:05:51,140
calling start from S-K request on our S-K products request pretty cool anyway.

82
00:05:51,140 --> 00:05:57,860
So moving on we are going to go ahead and call that special function from S-K receipt refresh request

83
00:05:57,860 --> 00:06:03,220
and we're going to go ahead and call that right above is subscription active.

84
00:06:03,320 --> 00:06:06,630
So go ahead and call request did finish.

85
00:06:06,800 --> 00:06:13,330
And basically this tells the S-K receipt refresh request delegate that the request has completed.

86
00:06:13,330 --> 00:06:17,480
So click on that and we're going to go ahead and do some stuff now.

87
00:06:17,720 --> 00:06:25,910
So this is basically going to say hey your subscription purchase is complete now at this point we want

88
00:06:25,910 --> 00:06:28,490
to upload Arvi seat to iTunes.

89
00:06:28,490 --> 00:06:31,540
So let's go ahead and do that by calling upload receipt.

90
00:06:31,970 --> 00:06:35,390
We already wrote that function that verifies that our purchase is legit.

91
00:06:35,720 --> 00:06:40,180
Press enter on the completion handler and name the boolean property valid.

92
00:06:40,550 --> 00:06:45,710
Then what we're going to do is we're going to say if valid meaning if our subscription is good we're

93
00:06:45,710 --> 00:06:55,540
going to do some stuff we're going to actually check to see if subscription subscription is still active.

94
00:06:55,840 --> 00:06:56,330
OK.

95
00:06:56,450 --> 00:07:06,680
Otherwise or else we're going to go ahead and basically lock out the subscription benefits because if

96
00:07:06,680 --> 00:07:12,410
the purchase is not actually valid if someone kind of hacked their way onto it we're not going to benefit

97
00:07:12,410 --> 00:07:13,940
them we're just going to lock them out.

98
00:07:14,360 --> 00:07:19,490
So let's go ahead and let's dive into checking if the subscription is still active.

99
00:07:19,550 --> 00:07:24,080
How are we going to do that our function right we wrote is subscription active.

100
00:07:24,300 --> 00:07:30,260
And if the current date is less than the expiration date then we should still be active in we past.

101
00:07:30,260 --> 00:07:33,880
True back to our completion handler otherwise we passed false.

102
00:07:34,050 --> 00:07:35,970
So let's check to see if it's still active.

103
00:07:35,970 --> 00:07:39,060
By calling self because we're in a closure now.

104
00:07:39,070 --> 00:07:45,050
Self is subscription active push enter and then push enter on the completion handlers.

105
00:07:45,060 --> 00:07:53,160
Well now name this property active and we can say hey if the subscription is active We're going to do

106
00:07:53,160 --> 00:07:57,810
something otherwise we're going to do something else obviously.

107
00:07:57,840 --> 00:08:04,260
So what we want to do here is we want to think what are we going to do if our subscription is definitely

108
00:08:04,260 --> 00:08:04,740
active.

109
00:08:04,740 --> 00:08:08,440
And remember this gets called every time we purchase our subscription.

110
00:08:08,670 --> 00:08:15,390
So what we have been doing is whenever we have purchased the subscription we go into complete we say

111
00:08:15,390 --> 00:08:21,560
hey comp. We bought a subscription here and we are sending a notification for subscribed with a boolean.

112
00:08:21,570 --> 00:08:28,470
True but what if what if our subscription is not active we need to send a boolean false how are we going

113
00:08:28,470 --> 00:08:28,950
to do that.

114
00:08:28,950 --> 00:08:30,570
We're going to need to send false somehow.

115
00:08:30,580 --> 00:08:35,280
So I'm actually going to go ahead and copy these two because we're going to need both of these functions

116
00:08:35,850 --> 00:08:40,130
but we're also going to go ahead and modify them so that we can pass in fall.

117
00:08:40,140 --> 00:08:46,370
So copy those move back into receipt or requested finish.

118
00:08:46,540 --> 00:08:53,640
And if our purchase is active meaning if we are good to go if they have a subscription it's valid and

119
00:08:53,640 --> 00:08:54,520
it's still active.

120
00:08:54,540 --> 00:08:55,910
So go ahead and paste that in.

121
00:08:55,920 --> 00:08:59,040
And as you can see it's going to start yelling at us check it out.

122
00:08:59,240 --> 00:09:03,660
I try to build it it will say hey you need to call self because we're in a closure or we need a reference

123
00:09:03,660 --> 00:09:04,170
to self.

124
00:09:04,170 --> 00:09:09,270
So go ahead and call self-treat setting on consumable purchase and we're also going to call self dot

125
00:09:09,330 --> 00:09:15,000
send notification for status but it's going to keep yelling at us because at this point in this function

126
00:09:15,300 --> 00:09:18,210
we can't actually access the current transaction.

127
00:09:18,210 --> 00:09:23,760
But thankfully that property is nil and we don't actually have to use it for a subscription.

128
00:09:23,880 --> 00:09:27,660
OK I'm going to pass in nyl here and then I'm going to explain what I mean.

129
00:09:27,990 --> 00:09:30,990
So you're probably thinking well why do we even have it if we don't need it.

130
00:09:30,990 --> 00:09:32,840
Check it out guys so I'm going to go down here.

131
00:09:33,090 --> 00:09:37,580
When we call complete we pass in the transaction right.

132
00:09:37,600 --> 00:09:42,340
We we print purchased we're successful and then the transaction gets passed into complete.

133
00:09:42,420 --> 00:09:43,010
OK.

134
00:09:43,260 --> 00:09:44,130
If it's complete.

135
00:09:44,130 --> 00:09:49,770
It gets passed in here mealtime monthly subscription gets called and if we passed in that transaction

136
00:09:49,800 --> 00:09:53,300
it would basically send our subscription here.

137
00:09:53,310 --> 00:09:59,940
Now this is great but I want to see what happens if I actually remove the mealtime monthly subscription

138
00:09:59,940 --> 00:10:00,690
case.

139
00:10:00,820 --> 00:10:06,810
Because we are already writing this code when we complete the transaction and the request is finished.

140
00:10:06,810 --> 00:10:07,700
Look at this.

141
00:10:07,830 --> 00:10:12,010
We are basically sending the same thing we're sending the subscription.

142
00:10:12,560 --> 00:10:16,640
We're passing it in and we're setting a non consumable purchase.

143
00:10:16,650 --> 00:10:22,710
So let's go ahead and let's actually remove that case because we no longer need it because we just care

144
00:10:22,710 --> 00:10:25,600
about the M.D. and the hide ads that was already there.

145
00:10:25,680 --> 00:10:32,610
Now send notification also is basically saying hey if we're subscribed we're going to go ahead and pass

146
00:10:32,610 --> 00:10:34,530
in the identifier.

147
00:10:34,530 --> 00:10:40,220
But look the subscription notification does not require the identifier only purchased.

148
00:10:40,260 --> 00:10:41,850
And that's where this comes in.

149
00:10:41,850 --> 00:10:43,910
Incomplete right here.

150
00:10:43,950 --> 00:10:48,780
Yeah right here for the meal I.D. that's where we actually pass in that that product identifier that's

151
00:10:48,780 --> 00:10:49,800
where it matters.

152
00:10:50,220 --> 00:10:54,110
As far as a subscription goes all that matters is the boolean valid or not.

153
00:10:54,150 --> 00:10:58,770
So go ahead and go back up to her requested finish.

154
00:10:59,050 --> 00:11:03,480
Now this is where we need to basically set up what happens if our subscription expires.

155
00:11:03,490 --> 00:11:08,790
OK so if our subscription is no longer active We're basically going to do the same exact thing we're

156
00:11:08,790 --> 00:11:09,960
going to send a notification.

157
00:11:09,960 --> 00:11:16,270
So go ahead and call self send notification for status dot subscribed.

158
00:11:16,560 --> 00:11:17,000
Right.

159
00:11:17,100 --> 00:11:21,930
Because it's still the subscription with identifier no doesn't matter.

160
00:11:22,170 --> 00:11:27,840
But the boolean does matter if it's not active We're going to pass false.

161
00:11:27,900 --> 00:11:28,570
OK.

162
00:11:28,980 --> 00:11:35,160
That's what we're going to do then we're going to go ahead and call self set non consumable purchase

163
00:11:35,910 --> 00:11:39,020
like so and we're going to also pass false.

164
00:11:39,030 --> 00:11:44,760
And what that's going to do if you remember if false comes in it's going to go ahead and set the status

165
00:11:44,820 --> 00:11:47,020
for this user defaults boolean.

166
00:11:47,250 --> 00:11:47,820
Right.

167
00:11:47,970 --> 00:11:54,900
So now non consumable purchase was made is false and that means in detail Visi which if you remember

168
00:11:54,900 --> 00:11:59,700
detail Visi is the one that shows the food and you can buy the food and hide the ads and it has that

169
00:11:59,700 --> 00:12:05,130
yellow and red ads view what that's going to do when we create this view controller.

170
00:12:05,130 --> 00:12:10,260
We're going to go ahead and create a variable called Hidden status that pulls the value from non consumable

171
00:12:10,260 --> 00:12:11,070
purchases made.

172
00:12:11,070 --> 00:12:15,120
So at this point if our subscription expired this is now false.

173
00:12:15,120 --> 00:12:23,970
So when we pop up the view hide or chaud show or hide ads it's called and if you look inside that the

174
00:12:24,060 --> 00:12:28,580
hidden status is depending on what comes in from user defaults.

175
00:12:28,590 --> 00:12:32,520
So that will basically set our ads to show again if it becomes false.

176
00:12:32,760 --> 00:12:35,060
So back to the IAP service here.

177
00:12:35,460 --> 00:12:38,000
And let's think if there's anything else we should do.

178
00:12:38,220 --> 00:12:39,730
Let's go back.

179
00:12:40,150 --> 00:12:46,800
OK so if valid we're going to check if it's active if it is we're going to do these things and that's

180
00:12:46,800 --> 00:12:49,110
great then.

181
00:12:49,620 --> 00:12:51,260
Yeah you know I think that is good.

182
00:12:51,270 --> 00:12:56,130
Otherwise we need to go ahead and lock people out using the same exact code.

183
00:12:56,130 --> 00:12:57,990
We're going to set this subscription to be false.

184
00:12:57,990 --> 00:13:01,180
We're going to set the non consumable purchase to also be false.

185
00:13:01,170 --> 00:13:06,530
So go ahead and copy that and then we're just going to paste it in place of that comment.

186
00:13:06,540 --> 00:13:14,310
So now this is going to be called automatically by the stuff that's going on in requested finish so

187
00:13:14,400 --> 00:13:17,250
we can basically have this handled for us automatically.

188
00:13:17,250 --> 00:13:20,310
Now I do want to print out some messages here.

189
00:13:20,310 --> 00:13:22,130
If everything is good to go.

190
00:13:22,260 --> 00:13:27,900
So if our subscription is valid we're going to go ahead and call de-bug print and we're going to print

191
00:13:27,900 --> 00:13:28,920
out Saab's

192
00:13:32,050 --> 00:13:37,970
come on we're going to go ahead and print out subscription valid.

193
00:13:38,290 --> 00:13:44,020
OK and I'm going to just copy this and replace valid here with active because that's if it's active

194
00:13:44,890 --> 00:13:53,150
for here that means it is expired and below that means subscription is invalid.

195
00:13:53,520 --> 00:13:54,170
OK.

196
00:13:54,370 --> 00:13:57,260
So we have four different things that will print out.

197
00:13:57,310 --> 00:13:59,100
What else do we want to do here.

198
00:13:59,110 --> 00:13:59,530
Let's see.

199
00:13:59,530 --> 00:14:03,250
So just to make sure we buy a subscription.

200
00:14:03,250 --> 00:14:12,550
Complete is called K then we don't do anything incomplete but we do finish the transaction so that's

201
00:14:12,550 --> 00:14:13,450
good.

202
00:14:13,660 --> 00:14:19,000
If the transaction is finished okay like right here we upload the receipt if it's valid.

203
00:14:19,000 --> 00:14:20,530
We move on if it's active.

204
00:14:20,530 --> 00:14:23,950
We move on and send the notification so all should be good.

205
00:14:23,980 --> 00:14:32,180
Let's go back to storefront Visi and let's see what actually happens when that subscription status changes.

206
00:14:32,260 --> 00:14:33,310
So we go in.

207
00:14:33,330 --> 00:14:39,300
We print out subscription valid and we need to perform some actions for a active subscription.

208
00:14:39,340 --> 00:14:46,050
And so I think what we should do is we should actually go in and modify what happens in this label here.

209
00:14:46,090 --> 00:14:48,400
When we open the app it says updating.

210
00:14:48,460 --> 00:14:48,930
Right.

211
00:14:49,180 --> 00:14:50,990
But we need to do some things.

212
00:14:51,580 --> 00:14:55,620
When the subscription is active we should update it to a subscription active.

213
00:14:55,780 --> 00:15:00,100
Then we should change it to where if it expires it says subscription expired.

214
00:15:00,100 --> 00:15:06,160
So to do that we're going to go ahead and go back into storefront B.C and inside this function status

215
00:15:06,160 --> 00:15:10,750
has changed what we're going to do is we're going to go ahead and first remove this because we're already

216
00:15:10,750 --> 00:15:14,200
printing subscription valid back in our IP service.

217
00:15:14,200 --> 00:15:17,810
We can get rid of that and get rid of the comment as well.

218
00:15:17,830 --> 00:15:23,590
So if our subscription status comes back as true meaning it's valid and it's active what we're going

219
00:15:23,590 --> 00:15:28,630
to do is we're going to go ahead and first change what the label says and change its font color.

220
00:15:28,630 --> 00:15:37,210
So go ahead and call self dot subscription status label dot text and it's going to say sub scription

221
00:15:38,920 --> 00:15:41,870
active then we're going to set the font color.

222
00:15:41,890 --> 00:15:51,910
So go ahead and call self subscription label dot text color like so and set it to be equal to a color

223
00:15:51,910 --> 00:15:56,800
literal and we can choose that nice green color that we've been using.

224
00:15:56,800 --> 00:15:57,940
Very cool.

225
00:15:58,480 --> 00:15:59,250
So that's great.

226
00:15:59,290 --> 00:16:05,080
But what if it comes in as expired we should set the text to say subscription expired and change the

227
00:16:05,080 --> 00:16:08,490
font color to something like red indicating expiration.

228
00:16:08,710 --> 00:16:14,290
OK so delete that and I'm actually just going to go ahead and copy this for time and paste it in.

229
00:16:14,380 --> 00:16:21,500
Change active to expired and change this color literal to be something like.

230
00:16:21,790 --> 00:16:26,440
Well you know I don't really like any of those reds So let's go ahead and let's choose another red which

231
00:16:26,440 --> 00:16:30,620
I like this one if you like it too you can use D2 5 0 4.

232
00:16:31,210 --> 00:16:37,780
And now we should be able to get a subscription expired or subscription active when we build this app.

233
00:16:37,780 --> 00:16:41,980
So let's go let's go test it and then we can lock down some other things and unlock other things with

234
00:16:41,980 --> 00:16:42,640
the subscription.

235
00:16:42,640 --> 00:16:44,870
So go ahead and build and run.

236
00:16:44,890 --> 00:16:47,780
Let's go see how it is.

237
00:16:47,890 --> 00:16:52,360
Pull open the simulator device here and here we go.

238
00:16:52,360 --> 00:16:54,750
So it says updating and look at that.

239
00:16:54,970 --> 00:16:55,540
OK great.

240
00:16:55,540 --> 00:17:00,010
So it's printing out some errors here it's saying no receipt your L That means we have not bought a

241
00:17:00,010 --> 00:17:01,160
subscription.

242
00:17:01,210 --> 00:17:05,670
It also is saying subscription invalid because it's recognizing that there is no subscription.

243
00:17:05,670 --> 00:17:06,460
So that's perfect.

244
00:17:06,460 --> 00:17:08,170
That's exactly what we want.

245
00:17:08,170 --> 00:17:15,310
Now if I go ahead and tap on this you know what I was recording videos yesterday I logged out of the

246
00:17:15,310 --> 00:17:18,460
test account to log into my own personal account to download an app.

247
00:17:18,460 --> 00:17:25,240
So now we're logged out of that previous test user but that's OK because actually after you test six

248
00:17:25,300 --> 00:17:30,460
subscriptions like if it expires six times you actually have to create a new sandbox user.

249
00:17:30,460 --> 00:17:37,240
So let's go ahead let's do that really quick pull open iTunes Connect here and we'll add a new sandbox

250
00:17:37,240 --> 00:17:38,170
tester.

251
00:17:38,200 --> 00:17:43,480
We're also going to need Nahda So let's go ahead and add a new Nahda inbox.

252
00:17:43,670 --> 00:17:46,800
Let's do meals.

253
00:17:46,910 --> 00:17:50,620
Well it's do meals Dasch meals at a male duck club.

254
00:17:50,990 --> 00:17:58,340
OK I'm going to copy that email and paste it in here to iTunes Connect and just say meal meals plan.

255
00:17:58,400 --> 00:18:02,540
It's going to be their name their e-mail have their password is going to be the same.

256
00:18:02,540 --> 00:18:04,910
Test test one two three exclamation mark.

257
00:18:04,910 --> 00:18:07,700
Test test one two three.

258
00:18:07,700 --> 00:18:13,940
What is a test might really secure a question and then I put the password as the test answer so that's

259
00:18:14,390 --> 00:18:16,790
extra secure random birthday.

260
00:18:16,910 --> 00:18:22,820
I'm just moving here quickly guys because we've already done this said United States and save this user

261
00:18:23,690 --> 00:18:25,090
as soon as it's done.

262
00:18:25,130 --> 00:18:31,190
We're going to go ahead and head back to nada verify the Apple I.D. and as soon as it's verified or

263
00:18:31,190 --> 00:18:35,600
well I guess I have to enter my password now.

264
00:18:35,600 --> 00:18:36,070
OK.

265
00:18:36,140 --> 00:18:37,120
E-mail address verified.

266
00:18:37,120 --> 00:18:40,770
So now let's go back to the code and back to our simulator here.

267
00:18:40,970 --> 00:18:48,550
Let's log into that account meals dash dash meals at a male club.

268
00:18:49,450 --> 00:18:50,640
And the password was.

269
00:18:50,640 --> 00:18:54,060
Test test one two three exclamation mark.

270
00:18:54,130 --> 00:19:02,510
Tap by and it's going to ask us to sign in again I believe Yep hoops because you can't see that huh.

271
00:19:02,650 --> 00:19:03,010
There we go.

272
00:19:03,040 --> 00:19:03,960
OK.

273
00:19:04,210 --> 00:19:11,430
Miles Dasch meals at a male club.

274
00:19:13,310 --> 00:19:17,070
Password is test test one two.

275
00:19:17,080 --> 00:19:19,190
Exclamation mark and press OK.

276
00:19:19,460 --> 00:19:22,070
And it's not going to do anything because that just logged in.

277
00:19:22,060 --> 00:19:24,290
So now tap the subscribe button again.

278
00:19:24,410 --> 00:19:29,790
Now it's going to ask for the password one last time one two three exclamation mark.

279
00:19:30,020 --> 00:19:34,190
And now we're going to get a pop up saying hey subscribe to the meal plan.

280
00:19:34,290 --> 00:19:39,380
It's tap not now on that don't don't ever tap settings when that pops up by the way because if you do

281
00:19:39,380 --> 00:19:43,530
tap settings and log in on the app store settings page is actually going to activate it as a real Apple

282
00:19:43,550 --> 00:19:44,950
I.D. and you don't want that.

283
00:19:44,960 --> 00:19:50,380
So we can now subscribe to our meal plan it says it will automatically renew every month for forty nine

284
00:19:50,470 --> 00:19:51,140
ninety nine.

285
00:19:51,140 --> 00:19:55,910
So when I press continue we should finish the transaction.

286
00:19:55,910 --> 00:20:00,370
We should send a notification through and it should update our label to say subscription active.

287
00:20:00,380 --> 00:20:04,980
So push continue push confirm and watch what happens.

288
00:20:08,280 --> 00:20:11,240
Boom it says your purchase was successful.

289
00:20:12,110 --> 00:20:13,230
Hey everybody what's going on.

290
00:20:13,230 --> 00:20:18,780
This video is getting a bit long so I actually cut it into two halves Part One and Part Two So why don't

291
00:20:18,780 --> 00:20:22,230
you head over to the next part now and we'll finish up this video.

292
00:20:22,230 --> 00:20:23,720
Thanks guys.
