Vasilis

addition of getinbox2 again

......@@ -284,10 +284,8 @@ WL_VERSION_INTERFACE()
*/
- (BOOL)getInboxWithSuccessBlock:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure;
- (BOOL)getInbox2WithSuccessBlock:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure;
- (void)getProductsWithSuccessBlock:(NSString*)filter :(void(^)(NSMutableArray *params))success failureBlock:(void(^)(NSError *error))failure;
- (void)sendContactWithSuccessBlock:(NSString *)name andEmail:(NSString *)email andMsisdn:msisdn andMessage:message :(void(^)(NSMutableArray *params)) success failureBlock:(void(^)(NSError *error))failure;
......@@ -363,6 +361,7 @@ WL_VERSION_INTERFACE()
- (void) validateCouponWithSuccessBlock:(NSString*) coupon :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
- (void)loginCosmoteWithSuccessBlock:(NSString*)guid andAppUuid:(NSString*)appUuid andTicket:(NSString*)ticket :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
/*!
@abstract Get the full page add accordint to the display_type of a campaign.
@attributeblock successBlock This block is called when getInbox is sucessful and allOffers is empty or nil and returns an array with the available WLInboxItem items. Otherwise, the allOffers array is filtered.
......
This diff is collapsed. Click to expand it.
......@@ -16,7 +16,6 @@
- (void) setToStage;
- (void) setLang:(NSString*) lang;
- (UIViewController *) openCoupons:(UIView*) parentView;
- (UIViewController *) openGifts;
- (void) applicationDidEnterBackground:(UIApplication *)application;
- (void) applicationWillEnterForeground:(UIApplication *)application;
- (void) applicationDidBecomeActive:(UIApplication *)application;
......@@ -60,6 +59,7 @@
- (NSDictionary*)getCouponSetsWithActive:(NSNumber*)active andVisible:(NSNumber*)visible andUuids:(NSArray*)uuids;
- (NSDictionary*)redeemCouponWithCoupon:(NSString*)coupon;
- (NSDictionary*)validateCouponWithCoupon:(NSString*)coupon;
- (NSDictionary*)loginCosmoteWithGuid:(NSString*)guid andAppUuid:(NSString*)appUuid andTicket:(NSString*)ticket;
@end
#endif /* MyApi_h */
......
......@@ -47,19 +47,11 @@ NSString *LANG;
}
- (UIViewController *) openCoupons:(UIView*) parentView{
UIViewController *couponsViewController = [CouponsViewInterface couponsViewController:parentView];
return couponsViewController;
}
- (UIViewController *) openGifts{
UIViewController *giftsViewController = [GiftsViewInterface giftsViewController];
// controller = [[UINavigationController alloc]initWithRootViewController:profileViewController];
// [window makeKeyAndVisible];
return giftsViewController;
}
//- (UIViewController *) openCoupons {
//// NSString* const frameworkBundleID = @"framework.warp.ly.WarplySDKFrameworkIOS";
//// NSBundle* bundle = [NSBundle bundleWithIdentifier:frameworkBundleID];
......@@ -1132,4 +1124,31 @@ NSString *LANG;
}
return resp;
}
- (NSDictionary*)loginCosmoteWithGuid:(NSString*)guid andAppUuid:(NSString*)appUuid andTicket:(NSString*)ticket {
__block NSDictionary *resp = [NSDictionary alloc];
__block BOOL isRunLoopNested = NO;
__block BOOL isOperationCompleted = NO;
[[Warply sharedService] loginCosmoteWithSuccessBlock:guid andAppUuid:appUuid andTicket:ticket :^(NSDictionary *response) {
resp = response;
isOperationCompleted = YES;
if (isRunLoopNested) {
CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns
}
} failureBlock:^(NSError *error) {
NSLog(@"%@", error);
resp = nil;
isOperationCompleted = YES;
if (isRunLoopNested) {
CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns
}
}];
if ( ! isOperationCompleted) {
isRunLoopNested = YES;
NSLog(@"Waiting...");
CFRunLoopRun(); // Magic!
isRunLoopNested = NO;
}
return resp;
}
@end
......