You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A TypeError occurs when load page on iOS devices using Mobile Safari UI/WKWebView via InlineKeyboard. The error message indicates that undefined is not an object (evaluating 'window.TelegramGameProxy.receiveEvent'). TypeError undefined is not an object (evaluating 'window.TelegramGameProxy.receiveEvent')
Solutions from #418 and #342 are not available in version 3, as method subscribe is no longer available.
Environment
Browser: Mobile Safari UI/WKWebView
Device: iPhone
OS: iOS 18.2.1
telegram-apps version "@telegram-apps/sdk-react": "^3.0.7",
To Reproduce
Steps to reproduce the behavior:
Open Mobile Safari on an iPhone with iOS 18.2.1.
Observe the error message in the console.
Expected Behavior
The page should load without errors and the window.TelegramGameProxy.receiveEvent should be defined.
The text was updated successfully, but these errors were encountered:
Unfortunately, the problem solution is out of bounds of the current library. It seems, that the problem is the Telegram client for iOS focuses on the Telegram SDK, not the current package, and expects this field (window.TelegramGameProxy.receiveEvent) to defined initially.
To solve the problem, it is required to do the following:
Create an issue in this client to prevent such kind of behavior. They should check if window.TelegramGameProxy.receiveEvent is even defined, before calling it.
Define a <script/> tag in the <head/> with the following content:
Note that this script must be specified before the main bundle, where the SDK's init function is called. Otherwise, you may break Mini Apps event's handling.
Your solution does not work as long as your bundle is loaded asynchronously and the code inside your bundle will most likely be called after the code, inserted by the client.
Telegram Application
Telegram for iOS
Describe the Bug
A TypeError occurs when load page on iOS devices using Mobile Safari UI/WKWebView via InlineKeyboard. The error message indicates that undefined is not an object (evaluating 'window.TelegramGameProxy.receiveEvent').
TypeError undefined is not an object (evaluating 'window.TelegramGameProxy.receiveEvent')
Solutions from #418 and #342 are not available in version 3, as method
subscribe
is no longer available.Environment
telegram-apps version
"@telegram-apps/sdk-react": "^3.0.7",
To Reproduce
Steps to reproduce the behavior:
Expected Behavior
The page should load without errors and the
window.TelegramGameProxy.receiveEvent
should be defined.The text was updated successfully, but these errors were encountered: