Skip to content

Commit

Permalink
fix: make sdk delegate public
Browse files Browse the repository at this point in the history
  • Loading branch information
Cavallando committed May 23, 2024
1 parent 43f7a3f commit 9c6fa4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/CommandBarIOS/CommandBar/SDK.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class CommandBarSDK {
var orgId: String? = nil
var options: CommandBarOptions? = nil

weak var delegate: CommandBarSDKDelegate?
public weak var delegate: CommandBarSDKDelegate?
weak var privateDelagate: CommandBarInternalSDK?

public init() {
Expand Down
4 changes: 2 additions & 2 deletions Sources/CommandBarIOS/HelpHub/HelpHubWebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public class HelpHubWebView: WKWebView, WKNavigationDelegate, WKScriptMessageHan
(function() {
window._cbIsWebView = true;
var o="\(options.orgId)",n=["Object.assign","Symbol","Symbol.for"].join("%2C"),a=window;function t(o,n){void 0===n&&(n=!1),"complete"!==document.readyState&&window.addEventListener("load",t.bind(null,o,n),{capture:!1,once:!0});var a=document.createElement("script");a.type="text/javascript",a.async=n,a.src=o,document.head.appendChild(a)}function r(){var n;if(void 0===a.CommandBar){delete a.__CommandBarBootstrap__;var r=Symbol.for("CommandBar::configuration"),e=Symbol.for("CommandBar::orgConfig"),c=Symbol.for("CommandBar::disposed"),i=Symbol.for("CommandBar::isProxy"),m=Symbol.for("CommandBar::queue"),l=Symbol.for("CommandBar::unwrap"),d=[],s="api=\(options.launchCode);commandbar=\(options.launchCode)",u=s&&s.includes("local")?"http://localhost:8000":"https://api.commandbar.com",f=Object.assign(((n={})[r]={uuid:o},n[e]={},n[c]=!1,n[i]=!0,n[m]=new Array,n[l]=function(){return f},n),a.CommandBar),p=["addCommand","boot"],y=f;Object.assign(f,{shareCallbacks:function(){return{}},shareContext:function(){return{}}}),a.CommandBar=new Proxy(f,{get:function(o,n){return n in y?f[n]:p.includes(n)?function(){var o=Array.prototype.slice.call(arguments);return new Promise((function(a,t){o.unshift(n,a,t),f[m].push(o)}))}:function(){var o=Array.prototype.slice.call(arguments);o.unshift(n),f[m].push(o)}}}),null!==s&&d.push("lc=".concat(s)),d.push("version=2"),t("".concat(u,"/latest/").concat(o,"?").concat(d.join("&")),!0)}}void 0===Object.assign||"undefined"==typeof Symbol||void 0===Symbol.for?(a.__CommandBarBootstrap__=r,t("https://polyfill.io/v3/polyfill.min.js?version=3.101.0&callback=__CommandBarBootstrap__&features="+n)):r();
window.CommandBar.boot(\(userId), {}, { products: ["help_hub", "nudges"] });
window.CommandBar.boot(\(userId), {}, { products: ["help_hub"] });
window.CommandBar.openHelpHub()
})();
"""
Expand All @@ -142,7 +142,7 @@ public class HelpHubWebView: WKWebView, WKNavigationDelegate, WKScriptMessageHan
frame.isMainFrame {
return nil
}

if let url = navigationAction.request.url, UIApplication.shared.canOpenURL(url) {
CommandBarSDK.shared.closeHelpHub()
UIApplication.shared.open(url)
Expand Down

0 comments on commit 9c6fa4c

Please sign in to comment.