Skip to main content

How to call any objective c plugin method on click event of html button



I am new in phonegap development. I have one html page which contains one textfield and one button. I want to call my plugin method -(void)nameOfMethod:( NSMutableArray*)paramArray withDict: (NSMutableDictionary*) options which is inside the my plugin class and it getting text from my html text field and displaying alertview.I don't have have idea how to call this method via a javascript .I did a small part of coding in javascript







<head><script type="text/javascript" src="encryptdata.js"></script></head>

<body>

<input type="password" name="confirmPassword" id="confirmPassword" value="" />

<input type="button" value="FetchR" onclick="fetchRelation()"/> </body>

encryptdata.js

function fetchRelation() { var getvalue=document.getElementById('confirmPassword').value; //what is next step....... to send the data to the plugin class }







but i don't have idea how to install that plugin in javascript and call its method in javascript . Is there anyone have idea about phonegap then plese help me.


Comments

  1. The workaround is to set the UIWebView delegate to a class and watch for the -webView:shouldStartLoadWithRequest:navigationType: method. Just pass a URL to it by using window.location or and parse the URL to call the Objective-C method you want.

    ReplyDelete

Post a Comment

Popular posts from this blog

Wildcards in a hosts file

I want to setup my local development machine so that any requests for *.local are redirected to localhost . The idea is that as I develop multiple sites, I can just add vhosts to Apache called site1.local , site2.local etc, and have them all resolve to localhost , while Apache serves a different site accordingly.