From cd16154d8c42a0ea7321c3ba76ab5ba3c1539aee Mon Sep 17 00:00:00 2001 From: Chris Bobbe Date: Fri, 3 Jul 2020 15:37:54 -0700 Subject: [PATCH] native ios: Rename ZLPInfoProperties to ZLPConstants. We're about to expose a constant here that doesn't come from the Info.plist (the "information property list file") [1]. It seems silly to make a new NativeModule for the new constant, so, rename the file so it makes sense for both constants. [1]: https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/AboutInformationPropertyListFiles.html --- ios/ZulipMobile.xcodeproj/project.pbxproj | 12 ++++++------ ios/ZulipMobile/ZLPConstants.h | 5 +++++ .../{ZLPInfoProperties.m => ZLPConstants.m} | 9 ++++----- ios/ZulipMobile/ZLPInfoProperties.h | 5 ----- 4 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 ios/ZulipMobile/ZLPConstants.h rename ios/ZulipMobile/{ZLPInfoProperties.m => ZLPConstants.m} (67%) delete mode 100644 ios/ZulipMobile/ZLPInfoProperties.h diff --git a/ios/ZulipMobile.xcodeproj/project.pbxproj b/ios/ZulipMobile.xcodeproj/project.pbxproj index a3f9adba4a1..0ae0abee265 100644 --- a/ios/ZulipMobile.xcodeproj/project.pbxproj +++ b/ios/ZulipMobile.xcodeproj/project.pbxproj @@ -12,7 +12,7 @@ 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 42689E9C23466FF7007540AA /* webview in Resources */ = {isa = PBXBuildFile; fileRef = 42689E9B23466FF7007540AA /* webview */; }; - 8BEA1EF024A6983D00674040 /* ZLPInfoProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BEA1EEE24A6983D00674040 /* ZLPInfoProperties.m */; }; + 8BEA1EF024A6983D00674040 /* ZLPConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 8BEA1EEE24A6983D00674040 /* ZLPConstants.m */; }; A148FEFC1E9D8CB900479280 /* zulip.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = A148FEFB1E9D8CB900479280 /* zulip.mp3 */; }; C091D09FD11FDDB8E939257D /* libPods-ZulipMobile.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 74F3CD22CB932FA7EEE0BB66 /* libPods-ZulipMobile.a */; }; CFA67D201EC23BCB0070048E /* UtilManager.m in Sources */ = {isa = PBXBuildFile; fileRef = CFA67D1F1EC23BCB0070048E /* UtilManager.m */; }; @@ -33,8 +33,8 @@ 42689E9B23466FF7007540AA /* webview */ = {isa = PBXFileReference; lastKnownFileType = folder; path = webview; sourceTree = ""; }; 66E34CC6219226D10091B852 /* ZulipMobile-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ZulipMobile-Bridging-Header.h"; sourceTree = ""; }; 74F3CD22CB932FA7EEE0BB66 /* libPods-ZulipMobile.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ZulipMobile.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 8BEA1EEE24A6983D00674040 /* ZLPInfoProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ZLPInfoProperties.m; path = ZulipMobile/ZLPInfoProperties.m; sourceTree = ""; }; - 8BEA1EEF24A6983D00674040 /* ZLPInfoProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZLPInfoProperties.h; path = ZulipMobile/ZLPInfoProperties.h; sourceTree = ""; }; + 8BEA1EEE24A6983D00674040 /* ZLPConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ZLPConstants.m; path = ZulipMobile/ZLPConstants.m; sourceTree = ""; }; + 8BEA1EEF24A6983D00674040 /* ZLPConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZLPConstants.h; path = ZulipMobile/ZLPConstants.h; sourceTree = ""; }; A148FEFB1E9D8CB900479280 /* zulip.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = zulip.mp3; sourceTree = ""; }; CF6CFE2C1E7DC55100F687C7 /* Build-Phases */ = {isa = PBXFileReference; lastKnownFileType = folder; path = "Build-Phases"; sourceTree = ""; }; CFA67D1F1EC23BCB0070048E /* UtilManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UtilManager.m; path = ZulipMobile/UtilManager.m; sourceTree = ""; }; @@ -60,8 +60,8 @@ 13B07FAE1A68108700A75B9A /* ZulipMobile */ = { isa = PBXGroup; children = ( - 8BEA1EEF24A6983D00674040 /* ZLPInfoProperties.h */, - 8BEA1EEE24A6983D00674040 /* ZLPInfoProperties.m */, + 8BEA1EEF24A6983D00674040 /* ZLPConstants.h */, + 8BEA1EEE24A6983D00674040 /* ZLPConstants.m */, 3C4249EC1EF6E16500D245F1 /* ZulipMobile.entitlements */, 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */, @@ -365,7 +365,7 @@ buildActionMask = 2147483647; files = ( CFA67D201EC23BCB0070048E /* UtilManager.m in Sources */, - 8BEA1EF024A6983D00674040 /* ZLPInfoProperties.m in Sources */, + 8BEA1EF024A6983D00674040 /* ZLPConstants.m in Sources */, 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 13B07FC11A68108700A75B9A /* main.m in Sources */, ); diff --git a/ios/ZulipMobile/ZLPConstants.h b/ios/ZulipMobile/ZLPConstants.h new file mode 100644 index 00000000000..d9c6aa0aeef --- /dev/null +++ b/ios/ZulipMobile/ZLPConstants.h @@ -0,0 +1,5 @@ +#import + +@interface ZLPConstants : NSObject + +@end diff --git a/ios/ZulipMobile/ZLPInfoProperties.m b/ios/ZulipMobile/ZLPConstants.m similarity index 67% rename from ios/ZulipMobile/ZLPInfoProperties.m rename to ios/ZulipMobile/ZLPConstants.m index 11050948f0d..9fee8ff9eff 100644 --- a/ios/ZulipMobile/ZLPInfoProperties.m +++ b/ios/ZulipMobile/ZLPConstants.m @@ -1,6 +1,6 @@ -#import "ZLPInfoProperties.h" +#import "ZLPConstants.h" -@implementation ZLPInfoProperties +@implementation ZLPConstants RCT_EXPORT_MODULE() @@ -13,10 +13,9 @@ + (BOOL)requiresMainQueueSetup - (NSDictionary *)constantsToExport { - // Items from the Info.plist. return @{ - // We've added a custom entry that gives us the App ID - // Prefix (a.k.a. the Team ID plus a dot). Access it. + // In the Info.plist, our custom entry for the App ID + // Prefix (a.k.a. the Team ID plus a dot). @"appIdentifierPrefix": [[NSBundle mainBundle] objectForInfoDictionaryKey:@"AppIdentifierPrefix"] ?: [NSNull null], }; } diff --git a/ios/ZulipMobile/ZLPInfoProperties.h b/ios/ZulipMobile/ZLPInfoProperties.h deleted file mode 100644 index 96e81406299..00000000000 --- a/ios/ZulipMobile/ZLPInfoProperties.h +++ /dev/null @@ -1,5 +0,0 @@ -#import - -@interface ZLPInfoProperties : NSObject - -@end