Skip to content

Commit

Permalink
ios internal url fixes
Browse files Browse the repository at this point in the history
udaybansal19 committed Nov 4, 2024
1 parent d5c9fc0 commit dc28efa
Showing 8 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ class ActionToBraveViewController: UIViewController {
private func createURL(for schemeType: SchemeType, with value: String) -> URL? {
var queryItem: URLQueryItem
var components = URLComponents()
components.scheme = Bundle.main.infoDictionary?["BRAVE_URL_SCHEME"] as? String ?? "brave"
components.scheme = Bundle.main.infoDictionary?["BRAVE_URL_SCHEME"] as? String ?? "ping"

switch schemeType {
case .query:
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@ class ShareToBraveViewController: SLComposeServiceViewController {
var components = URLComponents()
let queryItem: URLQueryItem

components.scheme = Bundle.main.infoDictionary?["BRAVE_URL_SCHEME"] as? String ?? "brave"
components.scheme = Bundle.main.infoDictionary?["BRAVE_URL_SCHEME"] as? String ?? "ping"

switch type {
case .url:
2 changes: 0 additions & 2 deletions ios/brave-ios/App/iOS/Entitlements/Debug.entitlements
Original file line number Diff line number Diff line change
@@ -28,7 +28,5 @@
<array>
<string>group.com.ping.ios.browser</string>
</array>
<key>com.apple.developer.carplay-audio</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -265,7 +265,7 @@ extension BrowserViewController: TopToolbarDelegate {
isUserDefinedURLNavigation: Bool
) async -> Bool {

if let url = URL(string: text), url.scheme == "brave" || url.scheme == "chrome" {
if let url = URL(string: text), url.scheme == "ping" || url.scheme == "brave" || url.scheme == "chrome" {
topToolbar.leaveOverlayMode()
return handleChromiumWebUIURL(url)
}
@@ -274,7 +274,7 @@ extension BrowserViewController: TopToolbarDelegate {
return false
}

if fixupURL.scheme == "brave" || fixupURL.scheme == "chrome" {
if fixupURL.scheme == "ping" || fixupURL.scheme == "brave" || fixupURL.scheme == "chrome" {
topToolbar.leaveOverlayMode()
return handleChromiumWebUIURL(fixupURL)
}
Original file line number Diff line number Diff line change
@@ -600,7 +600,7 @@ extension BrowserViewController: WKNavigationDelegate {
// Standard schemes are handled in previous if-case.
// This check handles custom app schemes to open external apps.
// Our own 'brave' scheme does not require the switch-app prompt.
if requestURL.scheme?.contains("brave") == false {
if requestURL.scheme?.contains("ping") == false {
// Do not allow opening external URLs from child tabs
let shouldOpen = await handleExternalURL(
requestURL,
Original file line number Diff line number Diff line change
@@ -360,7 +360,7 @@ class SyncSettingsTableViewController: SyncViewController, UITableViewDelegate,

let syncInternalsController = ChromeWebViewController(privateBrowsing: false).then {
$0.title = Strings.Sync.internalsTitle
$0.loadURL("brave://sync-internals")
$0.loadURL("ping://sync-internals")
}

self.navigationController?.pushViewController(syncInternalsController, animated: true)
Original file line number Diff line number Diff line change
@@ -312,7 +312,7 @@ class SyncWelcomeViewController: SyncViewController {

let syncInternalsController = ChromeWebViewController(privateBrowsing: false).then {
$0.title = Strings.Sync.internalsTitle
$0.loadURL("brave://sync-internals")
$0.loadURL("ping://sync-internals")
}

navigationController?.pushViewController(syncInternalsController, animated: true)
2 changes: 1 addition & 1 deletion ios/brave-ios/Sources/BraveShared/BraveURLs.swift
Original file line number Diff line number Diff line change
@@ -86,6 +86,6 @@ extension URL {
public struct AppURLScheme {
/// The apps URL scheme for the current build channel
public static var appURLScheme: String {
Bundle.main.infoDictionary?["BRAVE_URL_SCHEME"] as? String ?? "brave"
Bundle.main.infoDictionary?["BRAVE_URL_SCHEME"] as? String ?? "ping"
}
}

0 comments on commit dc28efa

Please sign in to comment.