Skip to content

Commit

Permalink
fix: expose CommandBar_Deprecated for use in react native
Browse files Browse the repository at this point in the history
  • Loading branch information
Cavallando committed Jun 11, 2024
1 parent ef7584b commit a525120
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CommandBarIOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'CommandBarIOS'
s.version = '1.1.4'
s.version = '1.1.5'
s.summary = 'HelpHub and Copilot Command Bar for iOS. '

# This description is used to generate tags and improve search results.
Expand Down
2 changes: 1 addition & 1 deletion Example/CommandBarIOS/Views/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import SwiftUI
import CommandBarIOS

struct HomeView: View {
var ORG_ID = ""
var ORG_ID = "foocorp"

var body: some View {
VStack(alignment: .center) {
Expand Down
13 changes: 5 additions & 8 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Sources/CommandBarIOS/CommandBar/CommandBar.swift
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import Foundation
import WebKit

class CommandBar {
public class CommandBar_Deprecated {
private var options: CommandBarOptions_Deprecated;

weak var delegate: HelpHubWebViewDelegate? // Add this property
public weak var delegate: HelpHubWebViewDelegate? // Add this property
private weak var presentedNavigationController: UINavigationController? // Add this property

init(options: CommandBarOptions_Deprecated) {
public init(options: CommandBarOptions_Deprecated) {
self.options = options
}

func openHelpHub() {
public func openHelpHub() {
DispatchQueue.main.async {
let viewController = HelpHubViewController(options: self.options)
viewController.delegate = self
Expand All @@ -32,8 +32,8 @@ class CommandBar {
}
}

extension CommandBar : HelpHubWebViewDelegate {
func didReceiveFallbackAction(_ action: [String : Any]) {
extension CommandBar_Deprecated : HelpHubWebViewDelegate {
public func didReceiveFallbackAction(_ action: [String : Any]) {
self.delegate?.didReceiveFallbackAction(action)
}
}
4 changes: 2 additions & 2 deletions Sources/CommandBarIOS/CommandBar/SDK.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extension CommandBarSDKDelegate {
// MARK: Public SDK
public final class CommandBarSDK {
private static let sharedInternal = CommandBarInternalSDK.shared
private var commandbar: CommandBar? = nil
private var commandbar: CommandBar_Deprecated? = nil
public static let shared = CommandBarSDK()


Expand All @@ -32,7 +32,7 @@ public final class CommandBarSDK {
public func boot(_ orgId: String, with options: CommandBarOptions? = nil) {
self.orgId = orgId
self.options = options
self.commandbar = CommandBar(options: CommandBarOptions_Deprecated(["orgId": orgId, "launchCode": "prod" ]))
self.commandbar = CommandBar_Deprecated(options: CommandBarOptions_Deprecated(["orgId": orgId, "launchCode": "prod" ]))

CommandBarSDK.sharedInternal.boot(orgId: orgId, with: options)
}
Expand Down

0 comments on commit a525120

Please sign in to comment.