I have an iPad app that contains a webview. The webview’s page has a button on it that, when clicked, needs to somehow tell the native app to close the webview. Is there any way to do this? i.e. a way for the javascript in the webview to pass messages to the native app, and vice-versa?
Thanks!
Maybe have an
NSNotificationfire when anNSStringinstance field is changed. Use the post here to help understand how to communicate between JavaScript and Objective-C.Then, it is just a matter of notification and string logic:
Steps for JavaScript to Objective-C:
Not sure what you want to pass back to the Web view from Objective-C, but the above post should help.