renosyah / WebViewPopUpPlugin

Web View Pop Up android Plugin for Godot
3 stars 1 forks source link

initialize is not a function in godot 4.3? #1

Open Thundros opened 1 month ago

Thundros commented 1 month ago

I opened all 3 of your demos and when i tried to run them in Godot 4.3, it gave me that above error... How do I fix this? PLEASE! I NEED this!!!

renosyah commented 1 month ago

oh, i make this plugin for old 4.1 godot, i never testing it on newer version of godot 4.x version, but here some godot code how to use this plugin :

var android_webview_popup_plugin

func _ready():
    android_webview_popup_plugin = Engine.get_singleton("WebViewPopUp")
    android_webview_popup_plugin.on_dialog_dismiss.connect(_webview_popup_on_dialog_dismiss)
    android_webview_popup_plugin.on_error.connect(_webview_popup_on_error)

func close_popup():
    android_webview_popup_plugin.close_dialog()

func open_url(url :String):
    android_webview_popup_plugin.open_url(url)

func _webview_popup_on_dialog_dismiss():
    pass

func _webview_popup_on_error():
    var _error_messages :PackedStringArray = android_webview_popup_plugin.get_error_messages()
    var message :String = ", ".join(_error_messages)