-
Notifications
You must be signed in to change notification settings - Fork 22
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
Seems that JsBridge not working with Xamarin.iOS Version: 6.2.7.1 #3
Comments
Yes I am experiencing the same issue, none of my jsbridge events are firing with latest xamarin release, any help much appreciated as my app is now broken :-( |
Issue gone with today's stable release (Xamarin v.6.4.0.2). Sample now works as expected. |
Thanks for the update @volaticus. Let me know if it stops working again. I'll leave this open for a day or two in case others run into it. I'm glad Xamarin fixed it because I kind of expected I wouldn't be able to. ;) Also, good to see some people using this library. I'm open to ideas on how to make it better. |
Hi crdeutch, I am still experiencing the same issue (Xamarin v.6.4.0.2), all my cdeutsch.JsBridge.AddEventListener simply never fire, I updated JSBridge and xamarin and although my app compiles ok the events simply wont fire. was all working fine up until the updates. Any more info welcome, and yes a great library :-) EDIT - Apologies I had not update the mt.js file, normal service has resumed. |
Hey @welshrat, I just updated mine to 6.4.0.2 and I'm not having the issue. Double check you have 6.4.0.2. In Xamarin Studio go to the menu: Does the example app work for you? Another thing to try would be to right click the project and do "Clean " |
Hi crdeutch, all fixed, sorry I had updated JSBridge but not replaced the mt.js file. Many thanks and keep up the great work |
Thanks! I was having the same issue with 6.4.0.2, but updating JSBridge and mt.js fixed the problem. Great library. |
Hello, great work :-) viewController.WebView.AddEventListener( "promptUser", delegate(FireEventData arg) { How i can wait in Javascript for the clicked button result? Best regards |
@svenessar this isn't really related to the issue, which I will be closing after this, but here's an answer. You need to fire an event after the sheet is Clicked. So wire up the sheet "Clicked" event and in it call FireEvent.
You then need to handle this event in your javascript:
Shoot me an email at cd@cdeutsch.com if you have more questions. |
Hello Christopher, sorry for my post, you are right. It is not an issue. :- ) The point is, that the JS will not wait for the answer. Is there a way to wait in JS for the answer with Native call? My JS should be work syncron with the Native world. Thank you so much. Sven Von: Christopher Deutsch [mailto:notifications@github.com] @svenessarhttps://github.com/svenessar this isn't really related to the issue, which I will be closing after this, but here's an answer. You need to fire an event after the sheet is Clicked. So wire up the sheet "Clicked" event and in it call FireEvent. sheet.Clicked += delegate(object s, UIButtonEventArgs e) {
}; sheet.ShowInView ( viewController.View ); You then need to handle this event in your javascript: Mt.App.addEventListener('sheetActionClicked', function(data) {
}); Shoot me an email at cd@cdeutsch.commailto:cd@cdeutsch.com if you have more questions. — |
It's more "event driven" then Async. When you "wire up" the Clicked event that code doesn't execute until the Action Sheet is clicked so that is where the "waiting" is done. So it should work. Give it a try. |
Sorry it is async, maybe i am to stupid :- ( i used your example index.html: window.onload = function(e) {
è console.log('finish'); is executed before the 'sheetActionClicked' has an answer :- ( could you help me please? Thank you so much Von: Christopher Deutsch [mailto:notifications@github.com] It's more "event driven" then Async. When you "wire up" the Clicked event that code doesn't execute until the Action Sheet is clicked so that is where the "waiting" is done. So it should work. Give it a try. — |
If you zip up your code and email it to cd@cdeutsch.com I can take a look |
I modifyed your index.html For your backround: I use JavaScript like native code. So I call a function syncron wait for the result, take the result from the first function and call the next function with this result. Like native Thank you Von: Christopher Deutsch [mailto:notifications@github.com] If you zip up and code and email it to cd@cdeutsch.commailto:cd@cdeutsch.com I can take a look — |
You can't do synchronous programming between native and js. It has to be event driven. If you send the code I can modify it to do what you want. It makes sense that "finish" is called first because it's not inside the function that handles the event. |
This is a running JS Code in Android: var anvintscr_srcTbl = new recTbl(RTObj.CurrSSRecTblId); in Android I use WebChromeClient with OnJsPrompt (delegated to Native), the webview wait for the prompt result and execute the next code. Do you have any idea how I can develop this with ios? Von: Christopher Deutsch [mailto:notifications@github.com] You can't do synchronous programming between native and js. It has to be event driven. If you send the code I can modify it to do what you want. It makes sense that "finish" is called first because it's not inside the function that handles the event. — |
Everything you want to do after the prompt results just needs to go inside the event handler function. Just like you were using jQuery and handling a button click it's the same thing.
Please use my email if you have more questions. There are other people subscribed to this thread on GitHub they don't need to keep getting notified. |
After loading example i see only white screen on IPhone simulator 6.1. Something bad happens after registering custom NSUrlHandler. canInitWithRequest method called but GetCanonicalRequest and StartLoading never called.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: