summaryrefslogtreecommitdiff
path: root/platform/darwin/src/NSBundle+MGLAdditions.m
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/NSBundle+MGLAdditions.m')
-rw-r--r--platform/darwin/src/NSBundle+MGLAdditions.m9
1 files changed, 9 insertions, 0 deletions
diff --git a/platform/darwin/src/NSBundle+MGLAdditions.m b/platform/darwin/src/NSBundle+MGLAdditions.m
index ad122831ba..f383a50300 100644
--- a/platform/darwin/src/NSBundle+MGLAdditions.m
+++ b/platform/darwin/src/NSBundle+MGLAdditions.m
@@ -31,4 +31,13 @@
return bundle.infoDictionary;
}
++ (nullable NSString *)mgl_applicationBundleIdentifier {
+ NSString *bundleIdentifier = [NSBundle mainBundle].bundleIdentifier;
+ if (!bundleIdentifier) {
+ // There’s no main bundle identifier when running in a unit test bundle.
+ bundleIdentifier = [NSBundle bundleForClass:[MGLAccountManager class]].bundleIdentifier;
+ }
+ return bundleIdentifier;
+}
+
@end