iOS SDK中集成的Mixpanel未发送事件

问题描述

我有一个iOS SDK项目,其中包含很多模块(在Objective-C中)。 我想开始跟踪事件,以查看客户如何使用我们的SDK,但是在“见解”标签中什么也看不到。我究竟做错了什么?

enter image description here

在进入SDK时,我已经添加了它(仅在文档之后):

   [Mixpanel sharedInstanceWithToken:@"myTOKEN"];
   self.mixpanel.serverURL = @"https://api-eu.mixpanel.com";

    [self.mixpanel track:@"Video play" properties:@{
        @"genre": @"hip-hop",@"duration in seconds": @42,}];

我可以通过断点看到执行的代码,但是我的见解完全是空的。

我还尝试了使用无代码跟踪添加事件,并且看起来工作正常并且可以连接到应用程序,但事件未显示在“见解”标签中。

enter image description here

解决方法

我认为,如果尚未在您发布的代码之外完成共享实例,则需要将共享实例分配给您的本地资源。

   [Mixpanel sharedInstanceWithToken:@"myTOKEN"];
   self.mixpanel = [Mixpanel sharedInstance]; // assign here
   self.mixpanel.serverURL = @"https://api-eu.mixpanel.com";

    [self.mixpanel track:@"Video play" properties:@{
        @"genre": @"hip-hop",@"duration in seconds": @42,}];

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...