gpt4 book ai didi

ios - appInviteDialog didCompleteWithResults 委托(delegate)方法中的 EXC_BREAKPOINT | Facebook 应用程序邀请

转载 作者:搜寻专家 更新时间:2023-10-31 23:02:11 26 4
gpt4 key购买 nike

我从 crashlytics 收到以下崩溃报告。在 iOS 上接收 Facebook sdk 的 appInviteDialog 的委托(delegate)方法时,我的应用程序崩溃了。问题是 ImplicitlyUnwrappedOptional 所以 facebook 似乎在委托(delegate)方法上发送 nil 。但我不确定。有谁知道这是 FB SDK 上的错误还是我做错了什么?

Thread : Crashed: com.apple.main-thread
0 MY_APP 0x00000001000a7c28 function signature specialization <Arg[0] = Owned To Guaranteed, Arg[1] = Owned To Guaranteed, Arg[2] = Owned To Guaranteed> of MY_APP.GameScene.appInviteDialog (MY_APP.GameScene)(Swift.ImplicitlyUnwrappedOptional<ObjectiveC.FBSDKAppInviteDialog>, didCompleteWithResults : Swift.ImplicitlyUnwrappedOptional<Swift.Dictionary<ObjectiveC.NSObject, Swift.AnyObject>>) -> () (GameScene.swift:1569)
1 MY_APP 0x00000001000884c4 @objc MY_APP.GameScene.appInviteDialog (MY_APP.GameScene)(Swift.ImplicitlyUnwrappedOptional<ObjectiveC.FBSDKAppInviteDialog>, didCompleteWithResults : Swift.ImplicitlyUnwrappedOptional<Swift.Dictionary<ObjectiveC.NSObject, Swift.AnyObject>>) -> () (GameScene.swift)
2 MY_APP 0x00000001005588a4 -[FBSDKAppInviteDialog _invokeDelegateDidCompleteWithResults:] (FBSDKAppInviteDialog.m:143)
3 MY_APP 0x0000000100558744 -[FBSDKAppInviteDialog _handleCompletionWithDialogResults:error:] (FBSDKAppInviteDialog.m:124)
4 MY_APP 0x0000000100558510 __28-[FBSDKAppInviteDialog show]_block_invoke (FBSDKAppInviteDialog.m:83)
5 MY_APP 0x00000001005585f0 __28-[FBSDKAppInviteDialog show]_block_invoke64 (FBSDKAppInviteDialog.m:98)
6 MY_APP 0x000000010038b4c4 -[FBSDKApplicationDelegate applicationDidBecomeActive:] (FBSDKApplicationDelegate.m:178)
7 CoreFoundation 0x00000001862ee010 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
8 CoreFoundation 0x000000018622b0f0 _CFXNotificationPost + 2060
9 Foundation 0x000000018715aa80 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
10 UIKit 0x000000018ae47298 -[UIApplication _stopDeactivatingForReason:] + 516
11 UIKit 0x000000018b059458 -[UIApplication _handleNonLaunchSpecificActions:forScene:withTransitionContext:] + 2716
12 UIKit 0x000000018b04f9f0 -[UIApplication workspace:didReceiveActions:] + 128
13 FrontBoardServices 0x000000018eb893c8 __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 32
14 CoreFoundation 0x00000001862fffc8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
15 CoreFoundation 0x00000001862ff0d0 __CFRunLoopDoBlocks + 312
16 CoreFoundation 0x00000001862fd6f4 __CFRunLoopRun + 1756
17 CoreFoundation 0x0000000186228f74 CFRunLoopRunSpecific + 396
18 GraphicsServices 0x000000018fc8b6fc GSEventRunModal + 168
19 UIKit 0x000000018ae2ad94 UIApplicationMain + 1488
20 MY_APP 0x00000001000c2c58 main (AppDelegate.swift:16)
21 libdyld.dylib 0x000000019866ea08 start + 4

这是我在 GameScene 文件中的代码。请注意,这是一个委托(delegate)方法:

func appInviteDialog(appInviteDialog: FBSDKAppInviteDialog!, didCompleteWithResults results: [NSObject : AnyObject]!) {
if(results.count == 1){
println("facebook invite successful \(results)")
if(self.isSaveMeButtonPressed){
Flurry.logEvent("FBInvite")
var build = GAIDictionaryBuilder.createEventWithCategory("Growth", action: "Facebook", label: "FBInvite", value: nil).build() as [NSObject : AnyObject]
googleTracker.send(build)
}
}
}

崩溃报告中显示的行号是函数的右括号(函数的最后一行)。请注意,该应用程序并不总是崩溃,事实上,直到现在我还无法重现上述崩溃。

最佳答案

实现这两个委托(delegate)。

(void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog    didCompleteWithResults:(NSDictionary *)results { 
NSLog(@"app invite result: %@", results);
}

(void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didFailWithError:(NSError *)error {
NSLog(@"app invite error: %@", error.localizedDescription);
}

关于ios - appInviteDialog didCompleteWithResults 委托(delegate)方法中的 EXC_BREAKPOINT | Facebook 应用程序邀请,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32372112/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com