![]() ![]() For example, you can capture the pause, resume, app The CDVPlugin class features other methods that your plugin can Success callback is called, it passes in the echo parameter. Method's success or failure callbacks on the JavaScript side. The result to mandDelegate, which executes the exec OK status, passing in the original echo string. The parameter passes the check, it returns a PluginResult with an String, returning a PluginResult with an ERROR status if so. It checks the parameter to make sure it is not nil or an empty Method get the first parameter of the arguments array, whichĬorresponds to the arguments passed in by the JavaScript exec() It obtains the echo string by calling the objectAtIndex In this case, the plugin only supports a single echoĪction. ![]() #import Echo - ( void ) echo :( CDVInvokedUrlCommand * ) command necessary imports at the top of the file extends the class fromĬDVPlugin. ********* Echo.h Cordova Plugin Header *******/ #import Echo : CDVPlugin - ( void ) echo :( CDVInvokedUrlCommand * ) command /********* Echo.m Cordova Plugin Implementation *******/ #import "Echo.h" Specification to the local platform's config.xml file: To match the JavaScript interface's echo feature described inĪpplication Plugins, use the plugin.xml to inject a feature NSData* as multipart, but not as Array/ Dictionary. Serialized or deserialized as necessary, so it is safe to return Other supported types, and sends the entire array as the arguments MessageAsMultipart expects an NSArray* containing any of the Likewise, anyĪrrayBuffer the JavaScript sends to a plugin are converted to MessageAsArrayBuffer expects NSData* and converts to anĪrrayBuffer in the JavaScript callback. Note the following for complex return values: ![]() Not to send any plugin result, in which case neither callback fires. Out any arguments to send a status, or return an error, or even choose You can create String, Int, Double, Bool, Array,ĭictionary, ArrayBuffer, and Multipart types. + ( CDVPluginResult * ) resultWithStatus :( CDVCommandStatus ) statusOrdinal messageAs. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |