-
Notifications
You must be signed in to change notification settings - Fork 487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UIWebView JS Binding #1518
base: develop
Are you sure you want to change the base?
Add UIWebView JS Binding #1518
Conversation
Hi, @MohHeader We really appreciate your contribution ! First of all, UIWebView is not bound because it's still experimental in Cocos2d-x, that means its APIs are not stable, and it's not implemented for all platforms. And most of all, we have other priorities. But we do receive other users claim their requirements for WebView. If you are willing to do this, we will discuss whether it's ok to support UIWebView in Cocos2d-JS on Monday. Secondly, about PR of bindings, we do have some rules:
You can refer to this discussion too: http://discuss.cocos2d-x.org/t/how-to-upload-image-within-app-to-server-with-cocos2d-js/19569/11 More specifically, if you are willing to improve your PR, please do the following:
|
Hi @pandamicro , It is nice to hear from you. And for sure I can understand your priorities, 😃 I will update the PR, based on your advice ASAP, Thanks, |
Hi, @MohHeader Sorry, we can't bind WebView yet because of a bindings generator problem. The WebView is only implemented on iOS and Android, but the auto bindings codes are for all platforms, so the bindings of WebView will cause compiling issues on other platforms. |
Hi @pandamicro , Or do you think that we have just to wait that WebView supports all other platforms ? May be we can do both ( Move it to the Manual ) and let it stay as an unmerged PR, so that others can benefit from it ? Thanks 😃 |
Good idea! In this case, you need to wrap all the bindings code of WebView into a if section like this:
|
Hi, @MohHeader, I think I found another solution, we need to create another auto binding configuration file for such features (platform oriented). Then the registration function can be wrapped into a target selector macro. We have decided to merge WebView and VideoPlayer in v3.5 |
Can you help me try this webpage https://www.anyimg.org/ with your WebView and test it on Android device? The webpage can loaded properly but the "Pick an image" button not working on my Android device v4.4.4. But it is working properly on iOS device v.7.1.2 Thanks. |
Hi @pandamicro , That's great news, Hi @Zinitter Yes sure let me test it. |
Hi @Zinitter Note that not some Android versions ( like 4.4.4 ) needs more special handling steps. May be you will need to create an issue on cocos2d-x github repo. :) |
Hi @MohHeader Thanks for your help and the info you given! Currently, i'm learning how to develop with Cocos2d-JS in Cocos Code IDE. However, I tried to open the page in mobile browser of Android device, the button working fine. |
I tested the webpage with Cocos2d-X v3.4 cpp-tests on Android device. |
Here I added the UIWebView api to cocos2d-js
Hope it meets your standard and can merge the PR.
Kind regards,