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

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?