-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
EXClientReleaseType.m
41 lines (37 loc) · 1.45 KB
/
EXClientReleaseType.m
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
33
34
35
36
37
38
39
40
41
// Copyright 2015-present 650 Industries. All rights reserved.
#import "EXClientReleaseType.h"
#if __has_include(<EXApplication/EXProvisioningProfile.h>)
#import <EXApplication/EXProvisioningProfile.h>
#endif
@implementation EXClientReleaseType
+ (NSString *)clientReleaseType
{
// The only scenario in which we care about the app release type is when the App Store release of
// the Expo development client is run on a real device so the development client knows to restrict
// projects it can run. We always include expo-application in the App Store release of the
// development client, so we correctly return "APPLE_APP_STORE" in the aforementioned scenario.
//
// In all other scenarios, we don't restrict the projects the client can run and can return either
// the actual release type or "UNKNOWN" for the same behavior, so it doesn't matter whether
// expo-application is linked.
#if __has_include(<EXApplication/EXProvisioningProfile.h>)
EXAppReleaseType releaseType = [[EXProvisioningProfile mainProvisioningProfile] appReleaseType];
switch (releaseType) {
case EXAppReleaseTypeUnknown:
return @"UNKNOWN";
case EXAppReleaseSimulator:
return @"SIMULATOR";
case EXAppReleaseEnterprise:
return @"ENTERPRISE";
case EXAppReleaseDev:
return @"DEVELOPMENT";
case EXAppReleaseAdHoc:
return @"ADHOC";
case EXAppReleaseAppStore:
return @"APPLE_APP_STORE";
}
#else
return @"UNKNOWN";
#endif
}
@end