-
Notifications
You must be signed in to change notification settings - Fork 143
Expand file tree
/
Copy pathRNVersionNumber.m
More file actions
32 lines (25 loc) · 1.05 KB
/
RNVersionNumber.m
File metadata and controls
32 lines (25 loc) · 1.05 KB
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
27
28
29
30
31
32
#import "RNVersionNumber.h"
@implementation RNVersionNumber
- (dispatch_queue_t)methodQueue
{
return dispatch_get_main_queue();
}
RCT_EXPORT_MODULE()
- (NSDictionary *)constantsToExport
{
NSString* receipt = [[[NSBundle mainBundle] appStoreReceiptURL] path];
#if TARGET_IPHONE_SIMULATOR
NSLog(@"Running on the Device, installationSource might not be able to be detected. Should only happen on Xcode versions running the app with Rosetta");
receipt = receipt != nil ? receipt : @"file:///private/var/mobile/Containers/Data/CoreSimulator/Application/FAKE_M1_Rosetta_Fallback/StoreKit/sandboxReceipt";
#endif
return @{@"appVersion" : [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"],
@"buildVersion": [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey],
@"installationSource" : receipt,
@"bundleIdentifier" : [[NSBundle mainBundle] bundleIdentifier]
};
}
+ (BOOL)requiresMainQueueSetup
{
return YES;
}
@end