• EnglishEspañol日本語한국어Português
  • Log inStart now

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 NewRelic 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.
// © 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
@end

Call the API

Next, call [NewRelic saltDeviceUUID:YES]; before your [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"];
...
}
...
@end

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

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.