Permalink
Browse files

CL-183- Handling error log on phone unlock event.

  • Loading branch information...
1 parent 6e225e5 commit 7a95453e6dd4c794ec9a37b7141fde3736de6be3 @tanaji-kadam tanaji-kadam committed Oct 17, 2012
Showing with 7 additions and 6 deletions.
  1. +1 −1 objective-c/3.3/Pubnub/AppDelegate.m
  2. +6 −5 objective-c/3.3/Pubnub/PubNub/CEPubnub.m
@@ -25,7 +25,7 @@ - (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
- [CEPubnub setApplicationActive:YES];
+ [CEPubnub setApplicationActive:NO];
}
- (void)applicationDidEnterBackground:(UIApplication *)application
@@ -189,17 +189,18 @@ - (void)connection:(NSURLConnection*)connection didFailWithError:(NSError*)error
break;
default:
- if(![CEPubnub isApplicationActive]){
+ if([CEPubnub isApplicationActive]){
[_pubNub connection:self didCompleteWithResponse:nil];
- [CEPubnub setApplicationActive:NO];
+ NSLog(@"PubNub request failed with error: %@", error);
}else
{
[_pubNub performSelector:@selector(_resubscribeToChannel:) withObject:_channel afterDelay:kMinRetryInterval];
+ [CEPubnub setApplicationActive:YES];
}
-
+
break;
}
-
+
}
}
@@ -210,7 +211,7 @@ - (void)connection:(NSURLConnection*)connection didReceiveAuthenticationChalleng
@implementation CEPubnub
@synthesize delegate=_delegate;
- BOOL _appState;
+ BOOL _appState = YES;
- (CEPubnub *) initWithSubscribeKey:(NSString *)subscribeKey useSSL:(BOOL)useSSL {
return [self initWithPublishKey:nil subscribeKey:subscribeKey secretKey:nil useSSL:useSSL cipherKey:nil uuid:nil origin:kDefaultOrigin];

0 comments on commit 7a95453

Please sign in to comment.