your app loads indefinitely upon launch

2019-07-09 04:43发布

问题:

I have an app which works fine on below devices.

iPhone 4s (iOS 7.1) iPhone 5 (iOS 9.1) iPhone 6 (iOS 9.1)

However app is rejecting saying below rejection.

We discovered one or more bugs in your app when reviewed on iPad and iPhone running iOS 9.1 on both Wi-Fi and cellular networks.

  • App did not load its contents, did not load beyond the flash screen.

However when I run this from my side, its working fine but it has problem at Apple end only. I don't know how can app run at my end and its giving problem at Apple end only? I tried to upload with iOS 8.4, but still Apple reply still we can't go beyond splash screen.

Did anyone face such issue OR does anyone point me where I can be wrong?

I have uploaded 6 builds and all are rejected saying same reason.

Note: Same app was working fine earlier (before iOS 9.1 release), but when I try to upload now, it is giving this error.

The biggest challenge for me is, I don't know what is the problem, but I need to FIX this problem


Edit 1

I have first screen as language screen where I have animation of images.

animationImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 1080, 1920)];
animationImageView.hidden = NO;
animationImageView.animationImages = mArray;
animationImageView.animationDuration = 1.5;
animationImageView.animationRepeatCount = 1;
[self.view addSubview:animationImageView];
[animationImageView startAnimating];

回答1:

After testing on testflight, I found a problem.

If I open the app after clicking app icon, it was working fine.

The problem comes when I click Open button from testflight

When I click Open button, launchOptions in AppDelegate was not nil, so the code in push was going wrong and internally it was crashing but still app was hanged at splash screen (not sure why though)

Below is what I have when I print launchOptions in AppDelegate didFinishLaunchingWithOptions

launchOptions==={
    UIApplicationLaunchOptionsSourceApplicationKey = "com.apple.TestFlight";
}

So I changed my code to below and all is working perfectly.

NSLog(@"launchOptions===%@", launchOptions);

if (launchOptions!=nil) {
    NSMutableDictionary *userInfo = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];

    NSLog(@"userInfo===%@", userInfo);
    NSLog(@"userInfo===%d", userInfo.count);

    if (userInfo.count>=1) {
          // here is my code on what to do if i click on push
    }
}

Do let me know if someone is not clear

It was crashing saying below

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithString:]: nil argument'

So I feel problem was at line below.

NSString *badge =[[NSString alloc] initWithFormat:@"%@", [apsInfo objectForKey:@"badge"]];

But after putting above condition, all was working fine.



回答2:

Did you test using "Run" from Xcode, or using Test Flight? Test Flight gets you the app in the same environment as Apple gets it, while running directly from Xcode may yield different results (different push notification environment, possibly different compilation options...).

Also, do you have access to the logs of the server that the app queries? If so, have you checked them to see what happens when Apple try to use the app? Is the query correctly formed? Was there an error (status code different from 200, or in the error log)?

What kind of request does your app perform? Is it a regular http(s) request? Or are you using an unusual protocol which may be blocked somehow?

I suppose the server queried is fully reachable from the Internet (i.e. you did not put a server that is only accessible on your local network)?

You should add error handling in your code, to test the result of requests and display information about it, so that if there's an error when they test it, at least they can report what the error is.