I have send request to server in delegate method of application:(UIApplication *)application didReceiveRemoteNotification: but when multiple push notification comes at same time app get crash because of no. of request goes to server.
In delegate method I write below code:
if (!downloadInboxQueue) {
downloadInboxQueue = [[NSOperationQueue alloc] init];
downloadInboxQueue.maxConcurrentOperationCount=1;
}
NSNumber *ischatnumber=[[NSNumber alloc] initWithInt:0];
operationObject=[[Operation_Inbox alloc] init];
NSInvocationOperation *operation22= [[NSInvocationOperation alloc] initWithTarget:operationObject selector:@selector(getEventFromServer:) object:ischatnumber];
[downloadInboxQueue addOperation:operation22];
operation22=nil;
NSInvocationOperation *operation2= [[NSInvocationOperation alloc] initWithTarget:operationObject selector:@selector(getEventFromServer:) object:ischatnumber];
[downloadInboxQueue addOperation:operation2];
operation2=nil;
//getEventFromServer: method for sending request and get response..........
please suggest me how to handle that .
- how many times delegate method called when multiple push notification comes ?
- how much time required (max. time)between send http request and get response?