From ab161ca1f904295078f555e6cdf252961b70d83b Mon Sep 17 00:00:00 2001 From: Evgeny Sokolov Date: Wed, 5 Feb 2020 10:42:00 +0300 Subject: [PATCH 1/5] Fixed build issues as proposed by xcode --- xcall.xcodeproj/project.pbxproj | 6 +++--- xcall/Base.lproj/Main.storyboard | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xcall.xcodeproj/project.pbxproj b/xcall.xcodeproj/project.pbxproj index 0265f02..fb3c54b 100644 --- a/xcall.xcodeproj/project.pbxproj +++ b/xcall.xcodeproj/project.pbxproj @@ -109,7 +109,7 @@ }; buildConfigurationList = 5BB15AC81E925DA30006DA29 /* Build configuration list for PBXProject "xcall" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -258,7 +258,7 @@ DEVELOPMENT_TEAM = X5AZV975AG; INFOPLIST_FILE = xcall/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.12; PRODUCT_BUNDLE_IDENTIFIER = "de.martin-finke.xcall"; PRODUCT_NAME = "$(TARGET_NAME)"; }; @@ -272,7 +272,7 @@ DEVELOPMENT_TEAM = X5AZV975AG; INFOPLIST_FILE = xcall/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.12; PRODUCT_BUNDLE_IDENTIFIER = "de.martin-finke.xcall"; PRODUCT_NAME = "$(TARGET_NAME)"; }; diff --git a/xcall/Base.lproj/Main.storyboard b/xcall/Base.lproj/Main.storyboard index 357094d..fdabcf5 100644 --- a/xcall/Base.lproj/Main.storyboard +++ b/xcall/Base.lproj/Main.storyboard @@ -1,8 +1,8 @@ - + - + From 146a0055be402f57a9ae678a85fbe9ba18737415 Mon Sep 17 00:00:00 2001 From: Evgeny Sokolov Date: Wed, 5 Feb 2020 11:00:57 +0300 Subject: [PATCH 2/5] URL-encode x-success/x-error callbacks Enables Bear.app to recognize that it is expected to provide response to its action --- xcall/AppDelegate.m | 12 ++++++++++-- xcall/Info.plist | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/xcall/AppDelegate.m b/xcall/AppDelegate.m index 8da54ea..9476ca2 100644 --- a/xcall/AppDelegate.m +++ b/xcall/AppDelegate.m @@ -104,8 +104,16 @@ - (void)executeXCallbackURL:(NSURL *)url activateApp:(BOOL)activateApp + (NSArray *)sourceCallbacks { - return @[[NSURLQueryItem queryItemWithName:@"x-success" value:@"xcall066958CA://x-callback-url/handle-success"], - [NSURLQueryItem queryItemWithName:@"x-error" value:@"xcall066958CA://x-callback-url/handle-error"]]; + NSString *xSuccess = @"xcall066958CA://x-callback-url/handle-success"; + NSString *xError = @"xcall066958CA://x-callback-url/handle-error"; + + NSString *encodedXSuccess = [xSuccess stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]; + NSString *encodedXError = [xError stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]; + + return @[[NSURLQueryItem queryItemWithName:@"x-success" value:encodedXSuccess], + [NSURLQueryItem queryItemWithName:@"x-error" value:encodedXError]]; + //return @[[NSURLQueryItem queryItemWithName:@"x-success" value:xSuccess], + // [NSURLQueryItem queryItemWithName:@"x-error" value:xError]]; } + (NSString *)jsonStringFromQueryItems:(NSArray *)queryItems diff --git a/xcall/Info.plist b/xcall/Info.plist index eb8f8e4..8eea74d 100644 --- a/xcall/Info.plist +++ b/xcall/Info.plist @@ -15,6 +15,8 @@ CFBundleTypeRole Viewer + CFBundleURLName + com.esokolov.xcall CFBundleURLSchemes xcall066958CA From 7c7345476683c7b50ead7b60a27b4b9dff5e7f14 Mon Sep 17 00:00:00 2001 From: Evgeny Sokolov Date: Wed, 5 Feb 2020 11:07:39 +0300 Subject: [PATCH 3/5] Updated list of xcode files/directories to be excluded from version control --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index ef6ade8..155dc54 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ xcuserdata *.xcscmblueprint *.xcuserstate *.xcworkspacedata +*.xcworkspace +xcshareddata From e36c788011e95f82a16222a0a759ed723819d7d3 Mon Sep 17 00:00:00 2001 From: Evgeny Sokolov Date: Thu, 6 Feb 2020 19:52:50 +0300 Subject: [PATCH 4/5] Rolling back my changes These changes do not address issue of Bear not calling back to xcall. Thanks to u/trix180 for helping me understand that :) --- xcall/AppDelegate.m | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/xcall/AppDelegate.m b/xcall/AppDelegate.m index 9476ca2..8da54ea 100644 --- a/xcall/AppDelegate.m +++ b/xcall/AppDelegate.m @@ -104,16 +104,8 @@ - (void)executeXCallbackURL:(NSURL *)url activateApp:(BOOL)activateApp + (NSArray *)sourceCallbacks { - NSString *xSuccess = @"xcall066958CA://x-callback-url/handle-success"; - NSString *xError = @"xcall066958CA://x-callback-url/handle-error"; - - NSString *encodedXSuccess = [xSuccess stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]; - NSString *encodedXError = [xError stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]; - - return @[[NSURLQueryItem queryItemWithName:@"x-success" value:encodedXSuccess], - [NSURLQueryItem queryItemWithName:@"x-error" value:encodedXError]]; - //return @[[NSURLQueryItem queryItemWithName:@"x-success" value:xSuccess], - // [NSURLQueryItem queryItemWithName:@"x-error" value:xError]]; + return @[[NSURLQueryItem queryItemWithName:@"x-success" value:@"xcall066958CA://x-callback-url/handle-success"], + [NSURLQueryItem queryItemWithName:@"x-error" value:@"xcall066958CA://x-callback-url/handle-error"]]; } + (NSString *)jsonStringFromQueryItems:(NSArray *)queryItems From 543d1f075a9dd0e34553676b1bf95e150766faa3 Mon Sep 17 00:00:00 2001 From: Evgeny Sokolov Date: Thu, 6 Feb 2020 19:56:09 +0300 Subject: [PATCH 5/5] Change role to 'Editor' in URL Types Fix for issue #4. Reason is that MacOS was not always able to identify particular xcall.app instance as 'xcall066958CA' protocol owner which caused sometimes inability to get x-success/x-error responses Project preferences changes in URL Types section: - Role changed from 'Viewer' to 'Editor' to allow xcall.app to be identified by MacOS as protocol owner - Added identifier of original xcall.app developer - Martin Finke --- xcall/Info.plist | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/xcall/Info.plist b/xcall/Info.plist index 8eea74d..60ba8b2 100644 --- a/xcall/Info.plist +++ b/xcall/Info.plist @@ -8,33 +8,33 @@ $(EXECUTABLE_NAME) CFBundleIconFile - LSBackgroundOnly - + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 CFBundleURLTypes CFBundleTypeRole - Viewer + Editor CFBundleURLName - com.esokolov.xcall + de.martin-finke.xcall CFBundleURLSchemes xcall066958CA - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 CFBundleVersion 1 + LSBackgroundOnly + LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSHumanReadableCopyright