From 48edcd87a8e2bb272cc8e1d51f09c6f8da3f179a Mon Sep 17 00:00:00 2001 From: Ryan Linton Date: Thu, 24 Aug 2023 11:03:34 -0600 Subject: [PATCH] gracefully handle HostAppURLScheme --- IOS_INSTRUCTIONS.md | 4 ++-- ios/ShareViewController.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/IOS_INSTRUCTIONS.md b/IOS_INSTRUCTIONS.md index f3eb2fc2..68da8394 100644 --- a/IOS_INSTRUCTIONS.md +++ b/IOS_INSTRUCTIONS.md @@ -97,7 +97,7 @@ Add the following to your app's `Info.plist` (if you already had other URL Schem CFBundleURLSchemes A_URL_SCHEME_UNIQUE_TO_YOUR_APP - + @@ -110,7 +110,7 @@ Add the following to your Share Extension's `Info.plist`: YOUR_APP_TARGET_BUNDLE_ID HostAppURLScheme YOUR_APP_URL_SCHEME_DEFINED_ABOVE - + NSExtension NSExtensionAttributes diff --git a/ios/ShareViewController.swift b/ios/ShareViewController.swift index 12d8c92d..0e2ea9b3 100644 --- a/ios/ShareViewController.swift +++ b/ios/ShareViewController.swift @@ -222,7 +222,7 @@ class ShareViewController: SLComposeServiceViewController { return } - let url = URL(string: urlScheme) + let url = URL(string: urlScheme.contains("://") ? urlScheme : "\(urlScheme)://") let selectorOpenURL = sel_registerName("openURL:") var responder: UIResponder? = self