如何获取HockeyApp的唯一用户ID?

4
在HockeyApp SDK v.3.5中,他们已经采用了一种新的用户识别方法。在SDK的早期版本中,有一个回调方法- (NSString*)userNameForCrashManager:(BITCrashManager *)crashManager,该方法可以设置一个字符串,用于标识客户端发送的所有崩溃报告。
然而,在SDK的3.5版本中,似乎已经弃用了这种方法,更推荐您直接调用:
[[BITHockeyManager sharedHockeyManager].authenticator authenticateInstallation];

这将为用户设置一个唯一的ID。但是我如何访问此标识符?我想将其附加到支持电子邮件上,以便我可以搜索用户提交的崩溃报告。

2个回答

3
  1. You can use the following delegate to set the userName:

    - (NSString *)userNameForHockeyManager:(BITHockeyManager *)hockeyManager componentManager:(BITHockeyBaseManager *)componentManager
    

    This is documented in the header and help ofBITHockeyManagerDelegate and the replacement is also mentioned in the header and help of BITCrashManagerDelegate documentation.

  2. BITAuthenticator is only used for beta distribution due to the fact that Apple removed the UDID calls from iOS 7. See the documentation and help. It is automatically disabled in App Store builds and without further setup creates anonymous IDs! Please read the mentioned documentation.


哦,所以在最新版本的SDK中userNameForHockeyManager:仍然起作用?总的文档不清楚做事情的首选方式是什么。 - Jason
是的,它没有被标记为已弃用或类似的内容。文档中哪些地方不清楚?请通过支持联系我们并提供更多详细信息,或在我们的存储库中提供拉取请求,以便我们改进它。 - Kerni

-1

我认为你正在寻找publicInstallationIdentifier。它应该返回一个NSString,对于每个用户都是唯一的。

看一下这个头文件-BITAuthenticator.h

另外,在BITHockeyManager中,有一个名为configureWithIdentifier:的方法,你可以在其中传递标识符。


1
  1. BITAuthenticator仅适用于beta版本,不适用于应用商店,并且不应该在应用商店中使用!只有当identificationType设置为BITAuthenticatorIdentificationTypeHockeyAppEmail时,它才会返回电子邮件。
  2. configureWithIdentifier:是初始化SDK的设置方法,您可以在HockeyApp上获取应用程序标识符,详见文档
- Kerni
好的,谢谢您让我知道。我可能没有充分阅读文档。 - Dominik Hadl

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接