2
0

Assist the user with store setup and allow continuing anyway.

This commit is contained in:
Maarten Billemont
2017-05-08 14:58:46 -04:00
parent fcbb93762a
commit d361ae2381
3 changed files with 27 additions and 2 deletions

View File

@@ -109,11 +109,28 @@ PearlAssociatedObjectProperty( NSMutableArray*, ProductObservers, productObserve
@"you have a payment method added to the account and purchases are"
@"not disabled under General -> Restrictions."
viewStyle:UIAlertViewStyleDefault initAlert:nil
tappedButtonBlock:nil cancelTitle:@"Thanks" otherTitles:nil];
tappedButtonBlock:^(UIAlertView *alert, NSInteger buttonIndex) {
if (buttonIndex == alert.cancelButtonIndex)
// Cancel
return;
if (buttonIndex == alert.firstOtherButtonIndex) {
// Settings
[PearlLinks openSettingsStore];
return;
}
// Try Anyway
[self performPurchaseProductWithIdentifier:productIdentifier quantity:quantity];
} cancelTitle:@"Cancel" otherTitles:@"Settings", @"Try Anyway", nil];
return;
}
#endif
[self performPurchaseProductWithIdentifier:productIdentifier quantity:quantity];
}
- (void)performPurchaseProductWithIdentifier:(NSString *)productIdentifier quantity:(NSInteger)quantity {
for (SKProduct *product in [self.products allValues])
if ([product.productIdentifier isEqualToString:productIdentifier]) {
SKMutablePayment *payment = [SKMutablePayment paymentWithProduct:product];