Skip to content

Commit

Permalink
add new script changes
Browse files Browse the repository at this point in the history
  • Loading branch information
QSD_faris committed Mar 14, 2024
1 parent eb23f2f commit fba94d1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Sources/WebView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ private enum InjectionScripts {
userInfo: window.DESKPRO_MESSENGER_OPTIONS?.userInfo,
launcherButtonConfig: DESKPRO_MESSENGER_OPTIONS.launcherButtonConfig,
messengerAppConfig: DESKPRO_MESSENGER_OPTIONS.messengerAppConfig,
parentViewHeight: "fullscreen",
parentViewDimensions: "fullscreen",
open: DESKPRO_MESSENGER_OPTIONS.openOnInit,
});
Expand All @@ -339,7 +339,7 @@ private enum InjectionScripts {
token: deviceToken
});
},
getViewHeight: async (messengerId) => {
getViewDimensions: async (messengerId) => {
return "fullscreen";
},
getSignedUserInfo: async (messengerId) => {
Expand All @@ -352,7 +352,7 @@ private enum InjectionScripts {
const { width, height } = data;
},
close: async (messengerId, data) => {
window.webkit.messageHandlers.iosListener.postMessage("\(PostMessageFunctions.closeWebView)")
const result = await window.webkit.messageHandlers.iosListener.postMessage("\(PostMessageFunctions.closeWebView)")
},
appEvent: async (messengerId, event) => {
//alert(event.id)
Expand All @@ -363,4 +363,8 @@ private enum InjectionScripts {
childMethods: undefined,
};
"""

static let logoutScript = """
window.DESKPRO_MESSENGER_CONNECTION.childMethods.logout("1");
"""
}

0 comments on commit fba94d1

Please sign in to comment.