Google Analytics for iOS 不调度事件

发布于 2024-12-01 12:57:49 字数 1189 浏览 2 评论 0原文

我正在使用最新的 SDK 版本以及注册和发送页面视图的基本代码:

[[GANTracker sharedTracker] startTrackerWithAccountID:@"UA-MY_ACCOUNT_ID-1"
                                           dispatchPeriod:10
                                                 delegate:self];

NSError *error;

if (![[GANTracker sharedTracker] trackPageview:@"/firstpage"
                                     withError:&error]) {
  NSLog(@"tracker failed: %@",error);
}

但是,事件不是从设备或模拟器调度的。也没有错误。当我打开调试标志时,我可以看到以下内容:

dispatch called
dispatching 4 events
[after 10 seconds]
dispatch called
...dispatcher was busy
[after 10 seconds]
dispatch called
...dispatcher was busy

我的委托方法从未被调用:

- (void)trackerDispatchDidComplete:(GANTracker *)tracker
                  eventsDispatched:(NSUInteger)eventsDispatched
              eventsFailedDispatch:(NSUInteger)eventsFailedDispatch{
    NSLog(@"success: %d failures: %d",eventsDispatched,eventsFailedDispatch);
}
  • 我尝试创建一个新的发布者 ID,但它也没有帮助。
  • 我的设备和模拟器确实有互联网连接,
  • 我在尝试之前删除了该应用程序。
  • 我玩了调度周期 - 将其设置为 -1 并手动调用调度

没有任何帮助.... :(

我现在已经为此苦苦挣扎了一天...我怎样才能让它工作?

I'm using the latest SDK version, and the basic code to register and send a page view:

[[GANTracker sharedTracker] startTrackerWithAccountID:@"UA-MY_ACCOUNT_ID-1"
                                           dispatchPeriod:10
                                                 delegate:self];

NSError *error;

if (![[GANTracker sharedTracker] trackPageview:@"/firstpage"
                                     withError:&error]) {
  NSLog(@"tracker failed: %@",error);
}

However the events are not dispatched from the device or simulator. There are no errors as well. When i turn on the debug flag, i can see the following:

dispatch called
dispatching 4 events
[after 10 seconds]
dispatch called
...dispatcher was busy
[after 10 seconds]
dispatch called
...dispatcher was busy

My delegate method never gets called:

- (void)trackerDispatchDidComplete:(GANTracker *)tracker
                  eventsDispatched:(NSUInteger)eventsDispatched
              eventsFailedDispatch:(NSUInteger)eventsFailedDispatch{
    NSLog(@"success: %d failures: %d",eventsDispatched,eventsFailedDispatch);
}
  • I tried to create a new publisher ID but it did not help as well.
  • I do have internet connection from the device and simulator
  • I deleted the app before trying.
  • I played with the dispatch period - setting it to -1 and call the dispatch manually

Nothing helped.... :(

I'm struggling with this for a day now... how can i make it work?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

戏剧牡丹亭 2024-12-08 12:57:49

我对调度员也有同样的问题(“......调度员很忙”)。就我而言,这是因为我在后台正常运行我的应用程序,并且它正在使用调度程序。当我尝试将设备连接到 Xcode 来运行和调试应用程序时,控制台向我显示了该消息。所以解决方案很简单:

  • 在 Xcode 中停止应用程序
  • 在后台关闭应用程序

就是这样。

I had the same problem with the dispatcher ("...dispatcher was busy"). In my case, it was because I had run my app normally in the background, and it was using the dispatcher. When I tried to connect the device to Xcode to run and debug the app, the console showed me that message. So the solution was easy:

  • Stop the app in Xcode
  • Close the app in background

That's it.

倾听心声的旋律 2024-12-08 12:57:49

您可以在调用 GANTracker 后进行手动调度,如下所示:
[[GANTracker共享Tracker]调度];
它工作得很好

you can put after calling the GANTracker a manual dispatch like that:
[[GANTracker sharedTracker] dispatch];
and it work perfectly

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文