• /
  • ログイン
  • 無料アカウント

iOS device ID obfuscation

New Relic uses Apple's vendor ID to track specific devices for accurate counts of users. One of the special features of the vendor ID is it is unique across a suite of apps using the same bundle ID base. For example, the vendor ID is the same across apps that use the same bundle ID: com.company-name.* .

This article describes how to obscure this cross-app identifier using a hidden API (available in iOS agent version 6.11.0):

+[NewRelic saltDeviceUUID:(BOOL)enabled]

Enable device uuid salt

To access the hidden method +[NewRelic saltDeviceUUID:(BOOL)enabled], add a category to the new relic object:

@interface NewRelic (salt)
+ (void) saltDeviceUUID:(BOOL)enabled;
@end

This can be added in your AppDelegate.h after #include <NewRelic/NewRelic.h> and before the @implementation AppDelgate:

//
//  AppDelegate.m
// 
//  Created on 9/11/12.
//  Copyright (c) 2012 New Relic. All rights reserved.
//

#import "AppDelegate.h"
#import <NewRelic/NewRelic.h>

@interface NewRelic (salt) 
  + (void) saltDeviceUUID:(BOOL)enabled;
@end

@implementation AppDelegate
// code 
@end

Call the API

Next, call [NewRelic saltDeviceUUID:YES]; before your [NewRelic startWithApplicationToken:]

// 
// AppDelegate.m 
// 
// Created on 9/11/12. 
// Copyright (c) 2012 New Relic. 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"];

  ...

}

...

@end

You device IDs are now be obfuscated in all events and data sent to New Relic.

その他のヘルプ

さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:

問題を作成するこのページを編集する
Copyright © 2020 New Relic Inc.