構文
recordBreadcrumb:(NSString* __nonnull)name attributes:(NSDictionary* __nullable)attributes;NewRelic.recordBreadcrumb(string $Name, map $eventAttributes)
MobileBreadcrumbイベントを記録し、クラッシュ分析に役立ちます。
要件
エージェント バージョン 5.13.0 以上.
説明
この呼び出しは、 MobileBreadcrumb
イベントを作成して記録します。このイベントは、NRQLおよびクラッシュイベントトレイルで照会できます。モバイルブレッドクラムはクラッシュ分析に役立ちます。クラッシュのトラブルシューティングに役立つと思われるアプリアクティビティ用に作成します。
選択したカスタム属性に加えて、イベントにはセッション属性も関連付けられます。 setAttribute
を使用するのとは異なり、ブレッドクラムイベントに属性を追加すると、そのイベントにのみ属性が追加されます。それらはセッション属性ではありません。
この呼び出しを使用すると、イベントタイプとしてMobileBreadcrumb
を使用してrecordCustomEvent
呼び出しを使用した場合と同じ結果になります。このAPIの使用方法のコンテキストについては、カスタム属性とイベントの送信に関するドキュメントを参照してください。
パラメーター
パラメータ | 説明 |
---|---|
ストリング | 必須項目です。パンくずイベントにつける名前。 |
マップ<文字列, オブジェクト> | 任意です。パンくずイベントの属性のリストを含むマップです。役に立ちそうなイベント記述子の属性を作成します。 |
戻り値
イベントが正常に記録された場合はtrue
を返し、そうでない場合はfalse
を返します。
例
Objective-C
方法です。
+ (BOOL) recordBreadcrumb:(NSString* __nonnull)name attributes:(NSDictionary* __nullable)attributes;
例:
[NewRelic recordBreadcrumb:@"user 11-3435 tapped sign-in button on LaunchViewController" attributes:@{ @"button" : @"sign-in", @"action" : @"tapped", @"userId" : @"11-3435", @"location" : @"LaunchViewController"}];
Swift
方法です。
NewRelic.recordBreadcrumb(Name: String!, attributes:[NSObject : AnyObject]!) -> Bool
例:
let eventRecorded = NewRelic.recordBreadcrumb("Name",attributes: ["attributeName1" : "value1", "attributeName2": 2])
let eventRecorded = NewRelic.recordBreadcrumb("user 11-3435 tapped sign-in from LaunchViewController" attributes:["button" : "sign-in", "userId" : "11-3435", "action" : "tapped", "location" : "LaunchViewController"])