I am using using deprecated API and I want to update my code to use non-depcreated code.
So my big question is how do I get the response list?
- (void) buyFeature:(NSString*) featureId
{
// SKProduct *myProduct;
if ([SKPaymentQueue canMakePayments])
{
SKPayment *payment = [SKPayment paymentWithProductIdentifier:featureId];
// SKPayment *payment = [SKPayment paymentWithProduct:myProduct];
[[SKPaymentQueue defaultQueue] addPayment:payment];
}
else
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"purchaseDone" object:nil];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Warning" message:@"You are not authorized to purchase from AppStore"
delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
[alert show];
[alert release];
}
}
- (void) purchase: (int) productIndex {
[self buyFeature: [aryProductIDs objectAtIndex: productIndex]];
}
aryProductIDs is defined under (id)init
aryProductIDs = [[NSMutableArray alloc] initWithObjects: @"iap_100OrangeDollars",
@"iap_1",
@"iap_2",
@"iap_1month",
@"iap_3month",
@"iap_6month",
@"iap_12month",
@"iap_1lifetime",
nil];
I am not sure what to use for myProduct (Type SKProduct).
Ive seen many examples using NSSet instead of NSMutableArray. Not sure if I need to change it