New Relic は Apple のベンダー IDを使用して特定のデバイスを追跡し、正確なユーザー数を確認します。ベンダー ID の特別な機能の 1 つは、同じバンドル ID ベースを使用する一連のアプリ全体で一意であることです。たとえば、ベンダー ID は、同じバンドル ID com.company-name.*を使用するアプリ間で同じです。
この記事では、隠しAPIを使用して、このクロスアプリの識別子を不明瞭にする方法を説明します(iOS agentバージョン6.11.0で利用可能)。
+[NewRelic saltDeviceUUID:(BOOL)enabled]デバイスのuuidを有効にする salt
非表示のメソッド+[NewRelic saltDeviceUUID:(BOOL)enabled]にアクセスするには、 NewRelicオブジェクトにカテゴリを追加します。
@interface NewRelic (salt) + (void) saltDeviceUUID:(BOOL)enabled;@endこれは、 #include <NewRelic/NewRelic.h> } の後、 @implementation AppDelgateの前にAppDelegate.hに追加できます。
//// AppDelegate.m// // Created on 9/11/12.// © 2012 New Relic, Inc. All rights reserved.//
#import "AppDelegate.h"#import <NewRelic/NewRelic.h>
@interface NewRelic (salt) + (void) saltDeviceUUID:(BOOL)enabled;@end
@implementation AppDelegate// code @endAPIの呼び出し
次に、前に[NewRelic saltDeviceUUID:YES];を呼び出します [NewRelic startWithApplicationToken:]
// // AppDelegate.m // // Created on 9/11/12. // © 2012 New Relic Inc. All rights reserved. //
#import "AppDelegate.h"#import <NewRelic/NewRelic.h>
@interface NewRelic (salt)+ (void) saltDeviceUUID:(BOOL)enabled;@end
@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [NewRelic saltDeviceUUID:YES]; [NewRelic startWithApplicationToken:@"MY_TOKEN"];
...}
...
@endNew Relic に送信されるすべてのイベントやデータにおいて、デバイス ID が難読化されるようになりました。