アプリに分析機能を追加したかったので、Flurry にアカウントを作成し、プロジェクトに SDK を追加しました。次に、通常のイベントと時間指定のイベントをいくつか記録しました。
ここまでは特に何もありませんでした :) しかし、2 日経っても Flurry のダッシュボードにこれらのイベントが表示されません。セッション数は表示されるので、アプリが実際に何かを送信しているのだと思います。しかし、イベントはありません。
何かアイデアはありますか? コードに関して特別なことは何もしていません。自分の ID で登録しています (これは前に言ったとおり正しいです)
[FlurryAnalytics startSession:flurryKey];
以下を使用してイベントをログに記録します:
[FlurryAnalytics logEvent:@"MyEvent"];
ベストアンサー1
セットアップに加えて、Flurry がイベントをログに記録する方法を理解することも重要です。コメントのおかげで、デバッグ モードでいくつかのテストを実行できました。デバッグ モードを有効にするには、次の操作を行います。
[Flurry setDebugLogEnabled:YES];
アプリが起動すると、ユーザー ID とページビューのログが設定されます。ログ出力は次のとおりです。
2013-05-27 12:19:00.636 MyApp[8492:907] Flurry: Starting session on Agent Version [115]
2013-05-27 12:19:00.659 MyApp[8492:907] Flurry: setUserID[<cut>]
2013-05-27 12:19:00.684 MyApp[8492:120b] FlurrySession: Add session with startTime[2013-05-27 15:46:22 +0000] to saved sessions
2013-05-27 12:19:00.704 MyApp[8492:120b] FlurrySession: Add crashed former session
2013-05-27 12:19:00.713 MyApp[8492:120b] FlurrySession: Event logging enabled[1]
2013-05-27 12:19:00.714 MyApp[8492:120b] FlurrySession: Session reports on close enabled[1]
2013-05-27 12:19:00.715 MyApp[8492:120b] FlurrySession: Session reports on pause enabled[0]
2013-05-27 12:19:00.716 MyApp[8492:120b] FlurrySession: Crash reporting enabled[0]
2013-05-27 12:19:00.717 MyApp[8492:120b] FlurrySession: set pushToken [(null)], _pushToken = [(null)]
2013-05-27 12:19:00.719 MyApp[8492:907] FlurryPageViewDelegate: delegate[(null)] created
2013-05-27 12:19:00.720 MyApp[8492:907] FlurryPageViewDelegate: delegate[(null)] created
2013-05-27 12:19:00.736 MyApp[8492:120b] FlurrySession: Initialized session from scratch with startTime[2013-05-27 16:19:00 +0000]
2013-05-27 12:19:00.737 MyApp[8492:120b] FlurrySession: Created active session with API[<cut>]
2013-05-27 12:19:00.738 MyApp[8492:120b] FlurrySession: Session reports on close enabled[1]
2013-05-27 12:19:00.739 MyApp[8492:120b] FlurrySession: Session reports on pause enabled[1]
2013-05-27 12:19:00.740 MyApp[8492:120b] FlurrySession: Event logging enabled[1]
2013-05-27 12:19:00.741 MyApp[8492:120b] FlurrySession: Crash reporting enabled[0]
2013-05-27 12:19:00.742 MyApp[8492:120b] FlurrySession: Sending sessions to server, include current NO
2013-05-27 12:19:00.763 MyApp[8492:120b] FlurrySession: Initial timestamp[2013-02-20 00:46:06 +0000] from saved source
2013-05-27 12:19:00.780 MyApp[8492:907] FlurryPageViewDelegate: delegate[(null)] created
2013-05-27 12:19:01.192 MyApp[8492:120b] Flurry: start background task
2013-05-27 12:19:01.202 MyApp[8492:120b] FlurrySession: Scheduled send 1 session(s).
2013-05-27 12:19:01.215 MyApp[8492:120b] FlurrySession: Set userID[<cut>]
2013-05-27 12:19:01.217 MyApp[8492:120b] FlurrySession: dealloc session
2013-05-27 12:19:04.857 MyApp[8492:907] FlurrySession: networkStatusChanged to reachable
2013-05-27 12:19:05.616 MyApp[8492:907] Flurry: HTTP connection delegate received response[<NSHTTPURLResponse: 0x1c5a1310>]
2013-05-27 12:19:05.624 MyApp[8492:7f03] FlurrySession: async http response code: 200, id [D1038462-66E2-48AE-8304-83A24B0E26EB]
2013-05-27 12:19:05.634 MyApp[8492:7f03] Flurry: stop background task
Flurry は初期セッション設定を自動的に送信したので、分析ページにセッションが表示されます (上記のセクション、非同期 http 応答コード: 200 は成功です)。Add crashed previous session と表示されていることに気付くでしょう。これは、XCode で Stop をクリックしてアプリを強制終了したためです。これにより、Flurry はイベントをログに記録できませんでした。ログに記録されたイベントは表示されますが、送信セッションはスケジュールされていません。
2013-05-27 12:19:41.184 MyApp[8492:aa07] FlurrySession: Recording event eventName[Doc Save] with parameters[{myparams = "xyz";
}] complete
Flurry が実際にログに記録されたイベントを送信するには、まずデバイスのホーム ボタンをクリックする必要があります。ホームをクリックすると、ログに次の内容が表示されます。
2013-05-27 12:21:15.884 MyApp[8492:a30f] FlurrySession: Pause session with pauseTime[2013-05-27 16:21:15 +0000]
2013-05-27 12:21:15.885 MyApp[8492:a30f] FlurrySession: Finish session with endTime[2013-05-27 16:21:15 +0000]
2013-05-27 12:21:15.887 MyApp[8492:a30f] FlurrySession: ending all unterminated timed events with _endTime[2013-05-27 16:21:15 +0000]...
2013-05-27 12:21:15.890 MyApp[8492:a30f] FlurrySession: ...finished ending un-ended timed events.
2013-05-27 12:21:15.891 MyApp[8492:a30f] FlurrySession: Sending sessions to server, include current YES
2013-05-27 12:21:15.900 MyApp[8492:a30f] FlurrySession: Initial timestamp[2013-02-20 00:46:06 +0000] from saved source
2013-05-27 12:21:15.914 MyApp[8492:a30f] Flurry: start background task
2013-05-27 12:21:15.919 MyApp[8492:a30f] FlurrySession: Scheduled send 1 session(s).
2013-05-27 12:21:16.729 MyApp[8492:907] Flurry: HTTP connection delegate received response[<NSHTTPURLResponse: 0x1c5ac0b0>]
2013-05-27 12:21:17.090 MyApp[8492:9c0b] FlurrySession: async http response code: 200, id [BB7CE5C1-D9C4-412F-9A41-6A838174B8FC]
2013-05-27 12:21:17.293 MyApp[8492:9c0b] Flurry: stop background task
その後、XCodeのStopでアプリを終了できます。