Splash Screens
。一
对于特定的一组客户和另一组客户
顾客。据我所知, Apple 不允许显示两个闪光
屏幕,因为它已经签署到Bundle
。所以我决定
使用UIImageView
并按照checking
群组更改图片。deep links
提供的Branch.io
组。当有人来自我们创建的referral
链接时,会显示一个image
,如果有人来自正常方式,我们会将另一个image
显示为launch
图片,而不是启动画面。它运作正常。Black Screen
五到六秒(相当长的时间)并显示图像。 以下是我用来检查条件并在另一个image
中显示viewController
的方法。
在AppDelegate
中,在我使用didFinishLaunchWithOption
检查的branch
方法中,如下所示。
let branch:Branch = Branch.getInstance() // branch.setDebug()
branch.initSessionWithLaunchOptions(launchOptions) { (params, error) in
if error == nil {
let clickedBranchlink : Bool = params["+clicked_branch_link"] as! Bool
let isfirstSession : Bool = params["+is_first_session"] as! Bool
if clickedBranchlink == true {
let theReferrer : String = params["referrer"] as! String
if theReferrer == "groupA" {
// in here I checked the group and set userdefault values and navigate to the view which the image view has and show the image according to this condition.
}
}
}
注意:是否有办法增加此过程并减少 黑屏。我是否在主线程中执行此操作。因为第一次 避免通过
branch.initSessionWithLaunchOptions
然后 它经历了它。希望你的帮助。
答案 0 :(得分:0)
每次启动应用程序并且应用程序不在后台时,都会调用此initSessionWithLaunchOptions。鉴于您的观察结果仅在第一次安装应用程序时出现问题,我的预感是您在调用Branch initSessionWithLaunchOptions函数之前在didFinishLaunchingWithOptions中运行代码。
分支初始化过程涉及发送网络请求然后等待响应,因此这总是需要一些时间 - 但安装与其他任何打开所花费的时间没有区别。在执行didFinishLaunchtingWithOptions中的任何其他代码之前,尽快启动此异步分支初始化,并且您应该能够缩短启动页面显示之前的时间。这应该消除显示您认为可能与Branch相关的启动图像所花费的时间的任何变化。