-
-
Save anonymous/8c0b5c3a8cd93204bb15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AppDelegate.m | |
- (void)applicationDidFinishLaunching { | |
... | |
if ([SKPaymentQueue canMakePayments]) { | |
[[SKPaymentQueue defaultQueue] addObserver:self]; | |
} | |
... | |
} | |
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { | |
// processing code | |
[[NSNotificationCenter defaultCenter] postNotificationName:@"MyPurchaseNotification" object:self]; | |
} | |
// MyPurchaseClass.m | |
- (void)viewDidLoad { | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(gotTransactionNotification:) name:@"MyPurchaseNotification" object:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment