From c76b52490700c0adf371dc2457a0e4386b524484 Mon Sep 17 00:00:00 2001 From: John Knox Date: Mon, 12 Nov 2018 04:22:15 -0800 Subject: [PATCH] iOS - Use bundleId for app ID Summary: The appId field gets embedded into the certificate request, so flipper knows which app to provide the cert to. In iOS this field is never used, so far, because the destination path uniquely identifies the app so this is redundant. For physical iPhones however, knowing the bundle id lets you deploy files into the container, so we can use this value. Reviewed By: passy Differential Revision: D13000296 fbshipit-source-id: 9f21850b908a03f1be87dc204e59d616150cc7ec --- iOS/FlipperKit/FlipperClient.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/iOS/FlipperKit/FlipperClient.mm b/iOS/FlipperKit/FlipperClient.mm index fbacf7ee2..cdf74dc20 100644 --- a/iOS/FlipperKit/FlipperClient.mm +++ b/iOS/FlipperKit/FlipperClient.mm @@ -51,8 +51,9 @@ using WrapperPlugin = facebook::flipper::FlipperCppWrapperPlugin; if (self = [super init]) { UIDevice *device = [UIDevice currentDevice]; NSString *deviceName = [device name]; - NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey]; - NSString *appId = appName; + NSBundle *bundle = [NSBundle mainBundle]; + NSString *appName = [bundle objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey]; + NSString *appId = [bundle bundleIdentifier]; NSString *privateAppDirectory = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES)[0]; NSFileManager *manager = [NSFileManager defaultManager];