You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
UIAlertView is deprecated in iOS 8.0, as it's superseded by UIAlertController.
Hence changed the code in 'initiatePaymentRequestForProductWithIdentifier:' to switch between UIAlertView and UIAlertController in case the latter exists. Also suppressed the deprecation warning for UIAlertView:
if (![SKPaymentQueue canMakePayments]) {
#if TARGET_OS_IPHONE
if ([UIAlertController class]) {
// iOS 8.0+
UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"In App Purchasing Disabled", @"")
message:NSLocalizedString(@"Check your parental control settings and try again later", @"")
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"Okay", @"")
style:UIAlertActionStyleCancel
handler:nil];
[alert addAction:cancelAction];
// Show Alert:
[[[[UIApplication sharedApplication] keyWindow] rootViewController] presentViewController:alert
animated:YEScompletion:nil];
}
else {
// Before iOS 8.0:
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"In App Purchasing Disabled", @"")
message:NSLocalizedString(@"Check your parental control settings and try again later", @"")
delegate:selfcancelButtonTitle:NSLocalizedString(@"Okay", @"")
otherButtonTitles:nil] show];
#pragma clang diagnostic pop
}
#elif TARGET_OS_MAC
NSAlert *alert = [[NSAlertalloc] init];
alert.messageText = NSLocalizedString(@"In App Purchasing Disabled", @"");
alert.informativeText = NSLocalizedString(@"Check your parental control settings and try again later", @"");
[alert runModal];
#endifreturn;
}
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
UIAlertView is deprecated in iOS 8.0, as it's superseded by UIAlertController.
Hence changed the code in 'initiatePaymentRequestForProductWithIdentifier:' to switch between UIAlertView and UIAlertController in case the latter exists. Also suppressed the deprecation warning for UIAlertView:
The text was updated successfully, but these errors were encountered: