I have integrated branch.io(https://branch.io/) in my app for deep linking. Here the response that I am getting in the branch handler has a slight delay. Once I get the response I do some other processing and then decide whether to navigate to first screen or the second screen.
The problem is even before getting the branch response, the first screen is displayed. I want to delay the splash screen for a while (which is not good as most of the people say but I do not have any option probably). I referred to various links, How can I display a splash screen for longer on an iPhone? where they suggest to add a splash view. But this is not working. I donot know for what reason. I also used [NSThread sleepForTimeInterval:6.0];
But this blocks the main thread. I also used GCD which didn't help.
In didFinishLaunchingWithOptions, this is what I have coded,
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, NULL), ^{
dispatch_async(dispatch_get_main_queue(), ^{
//get branch response
});
});
But the first screen is appearing before getting the response from branch.io. Kindly help.... This is major problem in my app without which I cannot test anything.. Please help me... Let me know if I have not made myself clear..