Skip to content

Commit

Permalink
change(ios): set host-app bundle identifier in embedded Web debug-report
Browse files Browse the repository at this point in the history
Cherry-pick-of: #13105
  • Loading branch information
Joshua Horton committed Feb 3, 2025
1 parent b464024 commit 5b441e8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,10 @@ extension KeymanWebViewController: KeymanWebDelegate {
os_log("%{public}s", log: KeymanEngineLogger.engine, type: .info, message)
SentryManager.breadcrumb(message, sentryLevel: .debug)

// Overwrites the baseline "embeddingApp" text available before Web engine init with the
// active bundle identifier.
webView!.evaluateJavaScript("setHostAppName(\"\(Bundle.main.infoDictionary!["CFBundleIdentifier"]!)\")")

self.setSentryState()
resizeKeyboard()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ function setKeymanLanguage(stub) {
});
}

function setHostAppName(name) {
// Sentry will capture this in a breadcrumb for Web errors.
keyman.config.embeddingApp = name;
}

var fragmentToggle = 0;
/**
* Inserts the selected string <i>s</i>
Expand Down
4 changes: 4 additions & 0 deletions web/src/app/webview/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export class WebviewConfiguration extends EngineConfiguration {
return this._embeddingApp;
}

set embeddingApp(name: string) {
this._embeddingApp = name;
}

get oninserttext() {
return this._oninserttext;
}
Expand Down

0 comments on commit 5b441e8

Please sign in to comment.