Vasilis

addition of getinbox2 again

...@@ -284,10 +284,8 @@ WL_VERSION_INTERFACE() ...@@ -284,10 +284,8 @@ WL_VERSION_INTERFACE()
284 */ 284 */
285 - (BOOL)getInboxWithSuccessBlock:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure; 285 - (BOOL)getInboxWithSuccessBlock:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure;
286 286
287 -
288 - (BOOL)getInbox2WithSuccessBlock:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure; 287 - (BOOL)getInbox2WithSuccessBlock:(void (^)(NSArray *list))success failureBlock:(void (^)(NSError *error))failure;
289 288
290 -
291 - (void)getProductsWithSuccessBlock:(NSString*)filter :(void(^)(NSMutableArray *params))success failureBlock:(void(^)(NSError *error))failure; 289 - (void)getProductsWithSuccessBlock:(NSString*)filter :(void(^)(NSMutableArray *params))success failureBlock:(void(^)(NSError *error))failure;
292 290
293 - (void)sendContactWithSuccessBlock:(NSString *)name andEmail:(NSString *)email andMsisdn:msisdn andMessage:message :(void(^)(NSMutableArray *params)) success failureBlock:(void(^)(NSError *error))failure; 291 - (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() ...@@ -363,6 +361,7 @@ WL_VERSION_INTERFACE()
363 361
364 - (void) validateCouponWithSuccessBlock:(NSString*) coupon :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; 362 - (void) validateCouponWithSuccessBlock:(NSString*) coupon :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
365 363
364 +- (void)loginCosmoteWithSuccessBlock:(NSString*)guid andAppUuid:(NSString*)appUuid andTicket:(NSString*)ticket :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure;
366 /*! 365 /*!
367 @abstract Get the full page add accordint to the display_type of a campaign. 366 @abstract Get the full page add accordint to the display_type of a campaign.
368 @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. 367 @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 @@ ...@@ -16,7 +16,6 @@
16 - (void) setToStage; 16 - (void) setToStage;
17 - (void) setLang:(NSString*) lang; 17 - (void) setLang:(NSString*) lang;
18 - (UIViewController *) openCoupons:(UIView*) parentView; 18 - (UIViewController *) openCoupons:(UIView*) parentView;
19 -- (UIViewController *) openGifts;
20 - (void) applicationDidEnterBackground:(UIApplication *)application; 19 - (void) applicationDidEnterBackground:(UIApplication *)application;
21 - (void) applicationWillEnterForeground:(UIApplication *)application; 20 - (void) applicationWillEnterForeground:(UIApplication *)application;
22 - (void) applicationDidBecomeActive:(UIApplication *)application; 21 - (void) applicationDidBecomeActive:(UIApplication *)application;
...@@ -60,6 +59,7 @@ ...@@ -60,6 +59,7 @@
60 - (NSDictionary*)getCouponSetsWithActive:(NSNumber*)active andVisible:(NSNumber*)visible andUuids:(NSArray*)uuids; 59 - (NSDictionary*)getCouponSetsWithActive:(NSNumber*)active andVisible:(NSNumber*)visible andUuids:(NSArray*)uuids;
61 - (NSDictionary*)redeemCouponWithCoupon:(NSString*)coupon; 60 - (NSDictionary*)redeemCouponWithCoupon:(NSString*)coupon;
62 - (NSDictionary*)validateCouponWithCoupon:(NSString*)coupon; 61 - (NSDictionary*)validateCouponWithCoupon:(NSString*)coupon;
62 +- (NSDictionary*)loginCosmoteWithGuid:(NSString*)guid andAppUuid:(NSString*)appUuid andTicket:(NSString*)ticket;
63 63
64 @end 64 @end
65 #endif /* MyApi_h */ 65 #endif /* MyApi_h */
......
...@@ -47,19 +47,11 @@ NSString *LANG; ...@@ -47,19 +47,11 @@ NSString *LANG;
47 } 47 }
48 48
49 - (UIViewController *) openCoupons:(UIView*) parentView{ 49 - (UIViewController *) openCoupons:(UIView*) parentView{
50 +
50 UIViewController *couponsViewController = [CouponsViewInterface couponsViewController:parentView]; 51 UIViewController *couponsViewController = [CouponsViewInterface couponsViewController:parentView];
51 return couponsViewController; 52 return couponsViewController;
52 } 53 }
53 54
54 -- (UIViewController *) openGifts{
55 -
56 - UIViewController *giftsViewController = [GiftsViewInterface giftsViewController];
57 -// controller = [[UINavigationController alloc]initWithRootViewController:profileViewController];
58 -
59 -// [window makeKeyAndVisible];
60 - return giftsViewController;
61 -}
62 -
63 //- (UIViewController *) openCoupons { 55 //- (UIViewController *) openCoupons {
64 //// NSString* const frameworkBundleID = @"framework.warp.ly.WarplySDKFrameworkIOS"; 56 //// NSString* const frameworkBundleID = @"framework.warp.ly.WarplySDKFrameworkIOS";
65 //// NSBundle* bundle = [NSBundle bundleWithIdentifier:frameworkBundleID]; 57 //// NSBundle* bundle = [NSBundle bundleWithIdentifier:frameworkBundleID];
...@@ -1132,4 +1124,31 @@ NSString *LANG; ...@@ -1132,4 +1124,31 @@ NSString *LANG;
1132 } 1124 }
1133 return resp; 1125 return resp;
1134 } 1126 }
1127 +
1128 +- (NSDictionary*)loginCosmoteWithGuid:(NSString*)guid andAppUuid:(NSString*)appUuid andTicket:(NSString*)ticket {
1129 + __block NSDictionary *resp = [NSDictionary alloc];
1130 + __block BOOL isRunLoopNested = NO;
1131 + __block BOOL isOperationCompleted = NO;
1132 + [[Warply sharedService] loginCosmoteWithSuccessBlock:guid andAppUuid:appUuid andTicket:ticket :^(NSDictionary *response) {
1133 + resp = response;
1134 + isOperationCompleted = YES;
1135 + if (isRunLoopNested) {
1136 + CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns
1137 + }
1138 + } failureBlock:^(NSError *error) {
1139 + NSLog(@"%@", error);
1140 + resp = nil;
1141 + isOperationCompleted = YES;
1142 + if (isRunLoopNested) {
1143 + CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns
1144 + }
1145 + }];
1146 + if ( ! isOperationCompleted) {
1147 + isRunLoopNested = YES;
1148 + NSLog(@"Waiting...");
1149 + CFRunLoopRun(); // Magic!
1150 + isRunLoopNested = NO;
1151 + }
1152 + return resp;
1153 +}
1135 @end 1154 @end
......