Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9254821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:34:08+00:00 2026-06-18T11:34:08+00:00

I am creating phoneGap plugin for iOS, which draws signature using NativeCode and Pass

  • 0

I am creating phoneGap plugin for iOS, which draws signature using NativeCode and Pass call back value to JavaScript.

I’m able to draw the signature succesfully using natice code but I’m not able to do pass return value of saved signature, to JavaScript.

JavaScript code is as follow

var MyPlugin = {
 nativeFunction: function(types, success, fail) {
      return Cordova.exec(success, fail, "MyPlugin", "print", types);
 }
};

In “print” function I am calling a UIViewContoller class which draws signature, and on SAVE button I want to pass return value to JavaScript.

Code on SAVE button click

// The first argument in the arguments parameter is the callbackID.
// We use this to send data back to the successCallback or failureCallback
// through PluginResult
self.callbackID = [arguments pop];

// Get the string that javascript sent us
NSString *stringObtainedFromJavascript = [arguments objectAtIndex:0];                 

// Create the Message that we wish to send to javascript   
NSMutableString *stringToReturn = [NSMutableString stringWithString: @"StringReceived:"];

// Append the received string to the string we plan to send out        
[stringToReturn appendString: stringObtainedFromJavascript];

// Create Plugin Result 
CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
                                                  messageAsString: [stringToReturn stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];

// Checking if the string received is HelloWorld or not    
 if ([stringObtainedFromJavascript isEqualToString:@"SAVED"] == YES)    
 {   
 // Call the javascript success function
 [self writeJavascript: [pluginResult toSuccessCallbackString:self.callbackID]];
 }else    
 {    
 // Call the javascript error function
 [self writeJavascript: [pluginResult toErrorCallbackString:self.callbackID]];
 }

I am not getting any error or any exception.

Can anyone please help me out. Any suggetion will be appreciated.

Thanks in Advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T11:34:10+00:00Added an answer on June 18, 2026 at 11:34 am

    Take a look at this GitHub project: https://github.com/rohdef/PGPlugins

    There are some good examples of writing plugins for phonegap.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a game for the iPad using Phonegap, which means I'm using JavaScript/
I am creating a quiz style app for iOS using phonegap. The app allows
We're in the process of creating an iOS app using Phonegap, and are having
I'm creating an iOS / Droid app using AJAX, jQuery, and Phonegap. The backend
I am creating an app using PhoneGap 1.5 (Cordova) and the ChildBrowser Plugin (newest
I am creating a new app using phonegap (html and javascript) and am using
I'm creating a phonegap application which involves backbone.js, underscore.js, and require.js I want to
When creating a jquery mobile / phonegap app, is it ok to pass variables
I am creating an app using jQuery Mobile and PhoneGap. I delegate a button
I am creating a simple phonegap based application using jQuery mobile. Here is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.