Created
October 20, 2016 22:46
-
-
Save theawesomecoder61/cdc2b6cd5380d7b4e8384bdcae08490d to your computer and use it in GitHub Desktop.
A code snippet written in Cocoa (Objective-C) that detects if an application was downloaded from the Mac App Store, that returns as a boolean.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)isFromMAS:(NSURL *)appURL { | |
bool mas = NO; | |
if(appURL != nil) { | |
mas = [[NSFileManager defaultManager] fileExistsAtPath:[[appURL URLByAppendingPathComponent:@"/Contents/_MASReceipt/receipt"] relativePath]]; | |
} | |
return mas; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment