DM-2540 We need to have SUFeedURL inside Info.plist file should be optional for DevMate customer.

This commit is contained in:
Dmytro Tretiakov committed 2014-08-19 13:17:49 +03:00
1 parent 313daa4711
commit 1dcb87cc44
1 file changed
+10 -2
+10 -2
View File
@@ -480,10 +480,18 @@ static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefault
{
// A value in the user defaults overrides one in the Info.plist (so preferences panels can be created wherein users choose between beta / release feeds).
NSString *appcastString = [host objectForKey:SUFeedURLKey];
if( [delegate respondsToSelector: @selector(feedURLStringForUpdater:)] )
if ([delegate respondsToSelector: @selector(feedURLStringForUpdater:)])
{
appcastString = [delegate feedURLStringForUpdater: self];
}
if (!appcastString) // Can't find an appcast string!
[NSException raise:@"SUNoFeedURL" format:@"You must specify the URL of the appcast as the SUFeedURL key in either the Info.plist or the user defaults!"];
{
static NSString * const sDevMateFeedURLBase = @"http://updates.devmate.com/";
NSString *bundleId = [[host bundle] bundleIdentifier] ? : @"";
NSString *feedURLComponent = [bundleId stringByAppendingPathExtension:@"xml"];
appcastString = [sDevMateFeedURLBase stringByAppendingPathComponent:feedURLComponent];
}
NSCharacterSet* quoteSet = [NSCharacterSet characterSetWithCharactersInString: @"\"\'"]; // Some feed publishers add quotes; strip 'em.
NSString* castUrlStr = [appcastString stringByTrimmingCharactersInSet:quoteSet];
if( !castUrlStr || [castUrlStr length] == 0 )