Vasilis

addition of inbox call exposure

......@@ -21,6 +21,7 @@
- (void) application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
- (void) application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
- (void) application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo;
- (NSMutableArray *)getInbox;
- (NSMutableArray *)getProducts:(NSString *) filter;
- (NSMutableArray*)sendContact:(NSString*)name email:(NSString*)email msisdn:(NSString*)msisdn message:(NSString*)message;
- (NSMutableArray *)getContentWithCategory:(NSString *)category tags:(NSArray *)tags;
......
......@@ -92,6 +92,33 @@ NSString *LANG;
[[Warply sharedService].pushManager resetBadge];
}
- (NSMutableArray *)getInbox {
__block NSArray *in = [NSMutableArray alloc];
__block BOOL isRunLoopNested = NO;
__block BOOL isOperationCompleted = NO;
[[Warply sharedService] getInboxWithSuccessBlock :^(NSArray *inbox) {
in = inbox;
isOperationCompleted = YES;
if (isRunLoopNested) {
CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns
}
} failureBlock:^(NSError *error) {
NSLog(@"%@", error);
in = nil;
isOperationCompleted = YES;
if (isRunLoopNested) {
CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns
}
}];
if ( ! isOperationCompleted) {
isRunLoopNested = YES;
NSLog(@"Waiting...");
CFRunLoopRun(); // Magic!
isRunLoopNested = NO;
}
return in;
}
- (NSMutableArray *)getProducts:(NSString *) filter {
__block NSMutableArray *prods = [NSMutableArray alloc];
__block BOOL isRunLoopNested = NO;
......