mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
InApp: continue
This commit is contained in:
parent
eff5cfdd5d
commit
5facb216a7
2 changed files with 8 additions and 3 deletions
|
|
@ -54,12 +54,15 @@ typedef NSString* IAPPurchaseNotificationStatus;
|
|||
@property (nonatomic, strong) NSMutableArray *productsAvailable;
|
||||
@property (nonatomic, strong) NSMutableArray *productsIDPurchased;
|
||||
|
||||
- (void)loadProducts;
|
||||
|
||||
- (BOOL)isPurchasedWithID:(NSString*)productId;
|
||||
- (void)purchaseWithID:(NSString*)productId;
|
||||
// restore user purchases. Must be a user action ONLY.
|
||||
- (void)restore;
|
||||
- (void)retrievePurchases;
|
||||
// internal API only due to methods conflict
|
||||
- (void)XMLRPCRequest:(XMLRPCRequest *)request didReceiveResponse:(XMLRPCResponse *)response;
|
||||
// internal API only due to methods conflict
|
||||
- (void)XMLRPCRequest:(XMLRPCRequest *)request didFailWithError:(NSError *)error;
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -130,6 +130,8 @@ NSString *const kLinphoneIAPurchaseNotification = @"LinphoneIAProductsNotificati
|
|||
|
||||
-(void)restore {
|
||||
LOGI(@"Restoring user purchases...");
|
||||
//force new query of the server
|
||||
latestReceiptMD5 = nil;
|
||||
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
|
||||
}
|
||||
|
||||
|
|
@ -177,6 +179,7 @@ NSString *const kLinphoneIAPurchaseNotification = @"LinphoneIAProductsNotificati
|
|||
|
||||
XMLRPCRequest *request = [[XMLRPCRequest alloc] initWithURL: URL];
|
||||
[request setMethod: @"get_expiration_date" withParameters:[NSArray arrayWithObjects:
|
||||
@"ios account email",
|
||||
receiptBase64,
|
||||
@"",
|
||||
@"apple",
|
||||
|
|
@ -268,7 +271,7 @@ NSString *const kLinphoneIAPurchaseNotification = @"LinphoneIAProductsNotificati
|
|||
} else if([response object] != nil) {
|
||||
//Don't handle if not object: HTTP/Communication Error
|
||||
if([[request method] isEqualToString:@"get_expiration_date"]) {
|
||||
if(false && [response object] == [NSNumber numberWithInt:1]) {
|
||||
if([response object] > [NSNumber numberWithInt:1]) {
|
||||
LOGE(@"Todo: parse the response");
|
||||
// [_productsIDPurchased addObject:@"test.auto_renew_7days"];
|
||||
[self postNotificationforStatus:IAPReceiptSucceeded];
|
||||
|
|
@ -293,7 +296,6 @@ NSString *const kLinphoneIAPurchaseNotification = @"LinphoneIAProductsNotificati
|
|||
otherButtonTitles:nil,nil];
|
||||
[errorView show];
|
||||
[errorView release];
|
||||
[waitView setHidden:true];
|
||||
latestReceiptMD5 = nil;
|
||||
[self postNotificationforStatus:IAPReceiptFailed];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue