-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBundle.mm
More file actions
26 lines (21 loc) · 623 Bytes
/
Bundle.mm
File metadata and controls
26 lines (21 loc) · 623 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifdef __APPLE__
#include "Bundle.h"
#include <Foundation/Foundation.h>
std::string getBundlePath() {
NSBundle *mainBundle = [NSBundle mainBundle];
NSString *bundlePath = [mainBundle bundlePath];
return [bundlePath UTF8String];
}
std::string getBytecodePathFromBundle() {
NSBundle *mainBundle = [NSBundle mainBundle];
if ([mainBundle objectForInfoDictionaryKey:@"NativeScriptApplication"] ==
nil) {
return "";
}
NSString *bytecodePath = [mainBundle pathForResource:@"app" ofType:@"hbc"];
if (bytecodePath == nil) {
return "";
}
return [bytecodePath UTF8String];
}
#endif // __APPLE__