Comments (6)
Hey @Noxalus,
Thanks for taking the time to try and write in with your problems. Sorry that WVJB is not working out as easily for you as it should be.
I have little experience working with cpp in objc projects, but let's start tackling this together and see where we get.
Here are some clarifications and some questions.
- Re WVJB_WEBVIEW_TYPE: WebViewJavascriptBridge is built to work both for iOS and for OSX. However, the classname of webviews is different on iOS & OSX (WebView & UIWebView respectively). So we declare a macro variable which will replace "WVJB_WEBVIEW_TYPE" with the correct type at compilation time
- Re typeof and strongDelegate: I need more information to know what's going on here. What are the warnings?
- Are you building with xcode? If no, I would recommend starting by creating an iOS project in xcode and then integrate your cpp code.
Cheers,
Marcus
from webviewjavascriptbridge.
Thank you very much for your answer!
For WVJB_WEBVIEW_TYPE, it's UIWebView for iOS but this type is defined in UIKit.h right ? You import WebKit.h OSX side, why don't you do the same thing for iOS ?
For typeof and strongDelegate, it's not warnings but errors. Xcode says that they are undeclared.
To answer to you, yes, I use Xcode 5 but the C++ project on which I work is a big framework that should compile on a lot of plateforms, including iOS. So I just can't create an Xcode project and import the C++ code into it.
Thanks again.
EDIT: Also, the iOS example available on the repository works pretty well, the problem really seems to be about the C++ integration.
from webviewjavascriptbridge.
I post a new message to notice you that I think I resolved the problem.
Finally, I start reading your code and I find out that all errors that I had were just after this section of the code:
/* Platform specific internals: OSX
**********************************/
#elif defined WVJB_PLATFORM_IOS
I've check if it was the same thing on the main branch, but it's not. It's WVJB_PLATFORM_OSX instead of WVJB_PLATFORM_IOS so I made the change and it compile well.
This error is still into the 4.1.0 release.
Thanks for your help and sorry to ask my question before to read the entire code.
Have a nice day.
from webviewjavascriptbridge.
Ok, sorry again, It seems that I checked a little bit to quick... There is already an #if defined WVJB_PLATFORM_OSX
so in the elif it's really WVJB_PLATFORM_IOS (the mistake was in comment).
So to return to the initial problem here are the errors that I encounter:
Like I said before it's about typeof and strongDelegate but strongDelegate is a variable defined using typeof so I think that the problem is only related to typeof keyword.
EDIT: I confirme that, if I replace all typeof by the type of _webViewDelegate (I put id), I can compile without error. But I don't know if it's the right way...
from webviewjavascriptbridge.
Hey, I finally patched this up in 5f10f81. Please let me know if it didn't fix your problem.
Cheers, and thanks again!
from webviewjavascriptbridge.
hi,
I try to use your code in unity3d Xcode project but i have a strange problem.
i have used unity3d 4.6.2 with Xcode 6.1.1 and she import your code in Xcode i have a error:
webViewDidStartLoad
2015-03-03 10:37:19.195 perceval[1355:1715745] -[__NSCFType countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x18913bf0
2015-03-03 10:37:19.196 perceval[1355:1715745] *** WebKit discarded an uncaught exception in the webView:didFinishLoadForFrame: delegate: -[__NSCFType countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x18913bf0
2015-03-03 10:37:22.363 perceval[1355:1715745] WVJB RCVD: {"data":"Hello from JS button","callbackId":"cb_1_1425375442341"}
2015-03-03 10:37:22.363 perceval[1355:1715745] ObjC received message from JS: Hello from JS button
2015-03-03 10:37:22.363 perceval[1355:1715745] -[__NSCFType addObject:]: unrecognized selector sent to instance 0x18913bf0
you have any idea?
- Thansk a lot.
from webviewjavascriptbridge.
Related Issues (20)
- Web view is blank after creating the bridge object HOT 1
- iOS14.6 WebViewJavascriptBridge not work but iOS14.3 works HOT 1
- Hello
- Why don't work in iPad Air (14.1) ? HOT 2
- nice
- iOS 15.4 js 交互不走decidePolicyFor 这个代理方法了 HOT 2
- Mac OSX app Packages printed in version 10.15 and above crashed in system 10.14 and below, so far the problem has not been located HOT 1
- nice
- nice
- 我已经重构了这个库,10分钟就能完成接入,也许可以帮助你. HOT 2
- 按照README 第四步拷贝的js代码可能不起作用 HOT 1
- failed assertion `Draw Errors Validation
- Mambamessage
- Installed with CocoaPods in Xcode 15 beta 6 can not build module 'WebKit' HOT 9
- I think that if you no longer maintain this library, then it is recommended that you make this warehouse archived, rather than leave it to grow grass!
- JSBridge H5调用原生的方法,频繁调用的性能优化
- iOS17.1.1 收不到回调 HOT 8
- I
- Invalid string representation for a specification: `WebViewJavascriptBridge(WK) (6.1.0)
- Unblock iphone 8 plus
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webviewjavascriptbridge.