Skip to content
Browse files

Added new "liveOnAppStore" property to PALAppInfo and the plist format.

Enables delaying listing the app on the "More apps" list until a PhotoAppLink compatible version is available.
  • Loading branch information...
1 parent 81ea219 commit d71a967d51f158053b9502aea11a03a3217c607b @pocketpixels committed Jun 18, 2011
Showing with 69 additions and 3 deletions.
  1. +3 −0 PhotoAppLink/PALAppInfo.h
  2. +2 −1 PhotoAppLink/PALAppInfo.m
  3. +4 −2 PhotoAppLink/PALManager.m
  4. +60 −0 photoapplink_debug.plist
View
3 PhotoAppLink/PALAppInfo.h
@@ -26,6 +26,7 @@
BOOL canSend;
BOOL canReceive;
BOOL installed;
+ BOOL liveOnAppStore;
NSString* appDescription;
NSURL* scheme;
NSString* bundleID;
@@ -44,6 +45,8 @@
// Flag indicating whether the app is installed on this device
// (only valid for apps that can receive images, NO for other apps)
@property (nonatomic, readonly) BOOL installed;
+// Whether a version with PhotoAppLink support is live on the App Store
+@property (nonatomic, readonly) BOOL liveOnAppStore;
// Flag whether the app supports sending images to other apps
@property (nonatomic, readonly) BOOL canSend;
// Flag whether the app supports receiving images
View
3 PhotoAppLink/PALAppInfo.m
@@ -10,7 +10,7 @@ @implementation PALAppInfo
@synthesize name, scheme, appDescription, bundleID, appleID;
@synthesize platform, freeApp;
-@synthesize thumbnailURL, installed, canSend, canReceive;
+@synthesize thumbnailURL, installed, liveOnAppStore, canSend, canReceive;
@synthesize thumbnail;
- (id)initWithPropertyDict:(NSDictionary*)properties {
@@ -20,6 +20,7 @@ - (id)initWithPropertyDict:(NSDictionary*)properties {
name = [[properties objectForKey:@"name"] copy];
canSend = [[properties objectForKey:@"canSend"] boolValue];
canReceive = [[properties objectForKey:@"canReceive"] boolValue];
+ liveOnAppStore = [[properties objectForKey:@"liveOnAppStore"] boolValue];
NSString* schemeStr = [[properties objectForKey:@"scheme"] stringByAppendingString:@"://"];
if (schemeStr != nil) scheme = [[NSURL alloc] initWithString:schemeStr];
appleID = [[properties objectForKey:@"appleID"] copy];
View
6 PhotoAppLink/PALManager.m
@@ -169,10 +169,12 @@ - (NSArray*)moreApps
NSPredicate* appsToShowPredicate;
// Only show apps that are not yet installed (as far as we can tell) and that are supported on the user's device
if (isIPad) {
- appsToShowPredicate = [NSPredicate predicateWithFormat:@"installed=FALSE AND NOT platform BEGINSWITH[cd] 'iPhone'"];
+ appsToShowPredicate = [NSPredicate predicateWithFormat:
+ @"installed=FALSE AND liveOnAppStore=TRUE AND NOT platform BEGINSWITH[cd] 'iPhone'"];
}
else {
- appsToShowPredicate = [NSPredicate predicateWithFormat:@"installed=FALSE AND NOT platform BEGINSWITH[cd] 'iPad'"];
+ appsToShowPredicate = [NSPredicate predicateWithFormat:
+ @"installed=FALSE AND liveOnAppStore=TRUE AND NOT platform BEGINSWITH[cd] 'iPad'"];
}
return [self.supportedApps filteredArrayUsingPredicate:appsToShowPredicate];
View
60 photoapplink_debug.plist
@@ -6,13 +6,41 @@
<array>
<dict>
<key>appleID</key>
+ <string>287273856</string>
+ <key>bundleID</key>
+ <string>com.dummy.dummyApp</string>
+ <key>canReceive</key>
+ <true/>
+ <key>canSend</key>
+ <true/>
+ <key>liveOnAppStore</key>
+ <true/>
+ <key>description</key>
+ <string>An app that doesn&apos;t exist</string>
+ <key>freeApp</key>
+ <true/>
+ <key>name</key>
+ <string>DummyApp</string>
+ <key>platform</key>
+ <string>universal</string>
+ <key>scheme</key>
+ <string>dummyApp-photoapplink</string>
+ <key>thumbnail2xURL</key>
+ <string>http://server.com/dummy.png</string>
+ <key>thumbnailURL</key>
+ <string>http://server.com/dummy.png</string>
+ </dict>
+ <dict>
+ <key>appleID</key>
<string>304871603</string>
<key>bundleID</key>
<string>com.hkueck.colorsplash</string>
<key>canReceive</key>
<true/>
<key>canSend</key>
<true/>
+ <key>liveOnAppStore</key>
+ <true/>
<key>description</key>
<string>Fun and intuitive selective coloring app.</string>
<key>freeApp</key>
@@ -37,6 +65,8 @@
<true/>
<key>canSend</key>
<true/>
+ <key>liveOnAppStore</key>
+ <true/>
<key>description</key>
<string>Add notes to your pictures!</string>
<key>freeApp</key>
@@ -61,6 +91,8 @@
<true/>
<key>canSend</key>
<true/>
+ <key>liveOnAppStore</key>
+ <true/>
<key>description</key>
<string>Fun and intuitive selective coloring app.</string>
<key>freeApp</key>
@@ -85,6 +117,8 @@
<true/>
<key>canSend</key>
<true/>
+ <key>liveOnAppStore</key>
+ <true/>
<key>description</key>
<string>App for testing the protocol</string>
<key>freeApp</key>
@@ -109,6 +143,8 @@
<true/>
<key>canSend</key>
<true/>
+ <key>liveOnAppStore</key>
+ <true/>
<key>description</key>
<string>Full featured photo editing app.</string>
<key>freeApp</key>
@@ -124,6 +160,30 @@
<key>thumbnailURL</key>
<string>http://photoapplinkicons.s3.amazonaws.com/Photogene.png</string>
</dict>
+ <dict>
+ <key>appleID</key>
+ <string>318944927</string>
+ <key>bundleID</key>
+ <string>unknown.autostitch</string>
+ <key>canReceive</key>
+ <false/>
+ <key>canSend</key>
+ <true/>
+ <key>liveOnAppStore</key>
+ <true/>
+ <key>description</key>
+ <string>Generate high quality panoramas automatically</string>
+ <key>freeApp</key>
+ <false/>
+ <key>name</key>
+ <string>Autostitch</string>
+ <key>platform</key>
+ <string>iPhone</string>
+ <key>thumbnail2xURL</key>
+ <string>http://photoapplinkicons.s3.amazonaws.com/Autostitch@2x.png</string>
+ <key>thumbnailURL</key>
+ <string>http://photoapplinkicons.s3.amazonaws.com/Autostitch.png</string>
+ </dict>
</array>
</dict>
</plist>

0 comments on commit d71a967

Please sign in to comment.
Something went wrong with that request. Please try again.