iOS 审核被拒原因记录 (TESTFLIGHT 测试闪退)

2017-07-29  本文已影响505人  学而不思则罔思而不学则殆

错误提示

We were unable to review your app as it crashed on launch. We have attached detailed crash logs to help troubleshoot this issue.
Next Steps
To resolve this issue, please revise your too and test it on a device to ensure it will launch without crashing.

找到突破口

测试半天,最后使用TESTFILGHT 预先测试版本。最终发现问题,用TESTFLIGHT打开APP的时候直接闪退.

分析原因

– (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;

当应用程序启动时执行,应用程序启动入口。只在应用程序启动时执行一次。application参数用来获取应用程序的状态、变量等,值得注意的是字典参数:(NSDictionary *)launchOptions,该参数存储程序启动的原因.

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    NSURL *url = [options objectForKey:UIApplicationLaunchOptionsURLKey];
    if(url){
    }
    NSString *bundleId = [options objectForKey:UIApplicationLaunchOptionsSourceApplicationKey];
    if(bundleId){
    }
    UILocalNotification * localNotify = [options objectForKey:UIApplicationLaunchOptionsLocalNotificationKey];
    if(localNotify){
    }
    NSDictionary * userInfo = [options objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
    if(userInfo){
    }
}

原因: 当你用第三方打开APP的时候,应用程序通过OPENURL:启动 didFinishLaunchingWithOptions方法。

上一篇 下一篇

猜你喜欢

热点阅读