how cordova trigger objective-c native method. example- when user taps on submit button (html button), app needs invoke native objective c function called 'datasubmitted'.
- does cordova monitor webview navigation , based on url tags call method internally?
- is there way javascript can interact obj-c native methods except monitoring webview navigations?
there 2 ways communicate native language js. 1. go mainviewcontroller.m -> find function named webviewdidfinishload , add follwing code snippet..
- (void)webviewdidfinishload:(uiwebview*)thewebview { nsstring *pageurl = [thewebview.request.url absolutestring]; if ([pageurl containsstring:@"xyz"]) { // xyz xyz.html }else if ([pageurl containsstring:@"abc"]) { // abc abc.html } self.webview = thewebview; return [super webviewdidfinishload:thewebview]; }
- develop own native plugin cordova.exec ;