diff --git a/Classes/Base.lproj/ShopView.xib b/Classes/Base.lproj/ShopView.xib index 9eb9e0c22..3e494c1a7 100644 --- a/Classes/Base.lproj/ShopView.xib +++ b/Classes/Base.lproj/ShopView.xib @@ -10,6 +10,7 @@ + @@ -17,7 +18,7 @@ - + @@ -40,7 +41,7 @@ - + diff --git a/Classes/InAppProductsManager.m b/Classes/InAppProductsManager.m index d6498ce09..310357b7c 100644 --- a/Classes/InAppProductsManager.m +++ b/Classes/InAppProductsManager.m @@ -24,6 +24,7 @@ #import "XMLRPCHelper.h" #import "LinphoneManager.h" #import "PhoneMainView.h" +#import "StoreKit/StoreKit.h" @interface InAppProductsManager () @property(strong, nonatomic) NSDate *expirationDate; @@ -96,6 +97,12 @@ } SKProduct *prod = [self productIDAvailable:productID]; if (prod) { + // Display waitview on click + UIWindow *window = [[UIApplication sharedApplication] keyWindow]; + UIView *topView = window.rootViewController.view; + UIView *waitview = (UIView *)[topView viewWithTag:288]; + [waitview setHidden:FALSE]; + NSDictionary *dict = @{ @"product_id" : productID }; [self postNotificationforStatus:kIAPPurchaseTrying withDict:dict]; SKMutablePayment *payment = [SKMutablePayment paymentWithProduct:prod]; @@ -189,6 +196,7 @@ } - (void)dealWithXmlRpcResponse:(LinphoneXmlRpcRequest *)request { + //[ShopView hideWaitingView:TRUE]; LOGI(@"XMLRPC query "); const char *requestContent = linphone_xml_rpc_request_get_content(request); NSString *rContent = [NSString stringWithFormat:@"%s", requestContent]; @@ -330,6 +338,10 @@ onSuccess:^(NSString *response) { if (response) { LOGI(@"create and activate_account callback - response: %@", response); + UIWindow *window = [[UIApplication sharedApplication] keyWindow]; + UIView *topView = window.rootViewController.view; + UIView *waitview = (UIView *)[topView viewWithTag:288]; + [waitview setHidden:TRUE]; } }]; @@ -343,6 +355,10 @@ onSuccess:^(NSString *response) { if (response) { LOGI(@"update_expiration_date callback - response: %@", response); + UIWindow *window = [[UIApplication sharedApplication] keyWindow]; + UIView *topView = window.rootViewController.view; + UIView *waitview = (UIView *)[topView viewWithTag:288]; + [waitview setHidden:TRUE]; } }]; diff --git a/Classes/ShopTableView.m b/Classes/ShopTableView.m index 0fd6ce973..8c06a5aba 100644 --- a/Classes/ShopTableView.m +++ b/Classes/ShopTableView.m @@ -7,6 +7,8 @@ // #import "ShopTableView.h" +#import "ShopView.h" +#import "PhoneMainView.h" @implementation ShopTableView @@ -58,6 +60,13 @@ SKProduct *product = LinphoneManager.instance.iapManager.productsAvailable[indexPath.row]; [LinphoneManager.instance.iapManager purchaseWithID:product.productIdentifier]; + + /* UIWindow *window = [[UIApplication sharedApplication] keyWindow]; + UIView *topView = window.rootViewController.view; + UIView *waitview = (UIView*)[topView viewWithTag:288]; + + [waitview setHidden:FALSE]; + */ } @end diff --git a/Classes/ShopView.h b/Classes/ShopView.h index cfe8f14c3..9b9af1c2f 100644 --- a/Classes/ShopView.h +++ b/Classes/ShopView.h @@ -25,6 +25,8 @@ @interface ShopView : UIViewController @property(strong, nonatomic) IBOutlet ShopTableView *tableViewController; +@property(weak, nonatomic) IBOutlet UIView *waitingView; - (IBAction)onDialerBackClick:(id)sender; +- (void)hideWaitingView; @end diff --git a/Classes/ShopView.m b/Classes/ShopView.m index 881b0578e..95137ebd7 100644 --- a/Classes/ShopView.m +++ b/Classes/ShopView.m @@ -55,4 +55,13 @@ static UICompositeViewDescription *compositeDescription = nil; [PhoneMainView.instance popToView:DialerView.compositeViewDescription]; } +- (IBAction)hideWaitingView { + LOGE(@"====>>> ShopView hideWaitingView - bool = %d"); + if (_waitingView.isHidden) { + [_waitingView setHidden:NO]; + } else { + [_waitingView setHidden:YES]; + } +} + @end