0

TL;DR
错误是 url 中的一个空格没有被编码。将由他们身边的分支人员修复


我集成了 iOS SDK 并按照指南中的说明完成了通用链接的所有设置。我已经正确配置了所有内容(或者看起来如此),打开一个链接会将我带到应用程序。但是,此问题似乎与深度链接功能无关。

脚步:

1.- 打开应用程序
2.- 返回主屏幕(不要关闭应用程序)
3.- 再次打开应用程序
4.- 崩溃

指定的 URL 具有不受支持的方案。仅支持 HTTP 和 HTTPS URL

线路崩溃是(BNCStrongMatchHelper.m:114):
UIViewController * safController = [[SFSafariViewControllerClass alloc] initWithURL:[NSURL URLWithString:urlString]];

但此时urlString是一个https链接。

更多信息:

    Fatal Exception: NSInvalidArgumentException
    0 CoreFoundation 0x1819bae38 __exceptionPreprocess
    1 libobjc.A.dylib 0x18101ff80 objc_exception_throw
    2 CoreFoundation 0x1819bad80 -[NSException initWithCoder:]
    3 SafariServices 0x18dd9e3fc -[SFSafariViewController initWithURL:entersReaderIfAvailable:]
    4 [myapp] 0x1002acc00 -[BNCStrongMatchHelper presentSafariVCWithBranchKey:] (BNCStrongMatchHelper.m:114)
    5 [myapp] 0x1002ac590 -[BNCStrongMatchHelper createStrongMatchWithBranchKey:] (BNCStrongMatchHelper.m:66)
    6 [myapp] 0x1002bdef0 -[Branch registerInstallOrOpen:] (Branch.m:1369)
    7 [myapp] 0x1002bdd74 -[Branch initializeSession] (Branch.m:1354)
    8 [myapp] 0x1002bd914 -[Branch initUserSessionAndCallCallback:] (Branch.m:1328)
    9 [myapp] 0x1002bc104 -[Branch applicationDidBecomeActive] (Branch.m:1203)
    10 CoreFoundation 0x18195ceac __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__
    11 CoreFoundation 0x18195c6cc _CFXRegistrationPost
    12 CoreFoundation 0x18195c44c ___CFXNotificationPost_block_invoke
    13 CoreFoundation 0x1819c5494 -[_CFXNotificationRegistrar find:object:observer:enumerator:]
    14 CoreFoundation 0x18189a788 _CFXNotificationPost
    15 Foundation 0x1822a289c -[NSNotificationCenter postNotificationName:object:userInfo:]
    16 UIKit 0x186b8e014 -[UIApplication _stopDeactivatingForReason:]
    17 UIKit 0x186dacdc4 __62-[UIApplication _sceneSettingsPostLifecycleEventDiffInspector]_block_invoke1180
    18 FrontBoardServices 0x18334c7b4 __52-[FBSSettingsDiffInspector inspectDiff:withContext:]_block_invoke27
    19 Foundation 0x1823517e8 __NSIndexSetEnumerate
    20 BaseBoard 0x1832d4728 -[BSSettingsDiff inspectChangesWithBlock:]
    21 FrontBoardServices 0x183347d94 -[FBSSettingsDiff inspectOtherChangesWithBlock:]
    22 FrontBoardServices 0x18334c58c -[FBSSettingsDiffInspector inspectDiff:withContext:]
    23 UIKit 0x186dad648 __70-[UIApplication scene:didUpdateWithDiff:transitionContext:completion:]_block_invoke
    24 UIKit 0x186dad2a4 -[UIApplication scene:didUpdateWithDiff:transitionContext:completion:]
    25 FrontBoardServices 0x18335b7ac __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__
    26 FrontBoardServices 0x18335b618 -[FBSSerialQueue _performNext]
    27 FrontBoardServices 0x18335b9c8 -[FBSSerialQueue _performNextFromRunLoopSource]
    28 CoreFoundation 0x181971124 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
    29 CoreFoundation 0x181970bb8 __CFRunLoopDoSources0
    30 CoreFoundation 0x18196e8b8 __CFRunLoopRun
    31 CoreFoundation 0x181898d10 CFRunLoopRunSpecific
    32 GraphicsServices 0x183180088 GSEventRunModal
    33 UIKit 0x186b6df70 UIApplicationMain
    34 [myapp] 0x1001b6984 main (main.m:16)
    35 libdispatch.dylib 0x1814368b8 (Missing)
4

2 回答 2

1

来自 Branch.io 的 Alex 更新:经过一些调试,我们确定这是由于urlString(从应用程序版本号传递)中的空格造成的。删除此空间解决了崩溃。

来自 Branch 的更持久的解决方案也在制定中。

于 2016-05-11T19:35:47.757 回答
0

尝试将此添加到您的 Info.plist 文件中:

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>
于 2016-05-11T09:43:20.790 回答