cordova - PhoneGap setKeepCallback - What does it? -



cordova - PhoneGap setKeepCallback - What does it? -

i made project, established successfull communication bluetooth plugin javascript. javascript register callback plugin way in java:

if (action.equals(action_register_callback)) { if(mjscallback != null) { pluginresult = new pluginresult(pluginresult.status.error, "an event callback has been registered."); } else { mjscallback = callbackid; pluginresult = new pluginresult(pluginresult.status.no_result); pluginresult.setkeepcallback(true); } }

this of course of study done in exec function. because of fact, bluetooth events come not @ points of time, registered broadcast receiver, sends messages javascript, when theres found device example.

if(bluetoothadapter.action_discovery_finished.equals(action)) { sendmessagetojscallback(new pluginresult(pluginresult.status.ok, "discovery finished.")); }

the belonging function sending:

public void sendmessagetojscallback(pluginresult res) { res.setkeepcallback(true); success(res, mjscallback); }

what did not understand in context is, setkeepcallback in different functions. thought there documentation, there isnt.

can tell me? orientated development on https://github.com/phonegap/phonegap-plugins/tree/master/android/phonelistener

this means callback on js side kept farther calls native (java) side js side. somewhere managed in cordova.js code.

if illustration network-information plugin: https://github.com/apache/cordova-plugin-network-information/blob/master/src/android/networkmanager.java#l221 see on every network state (wifi,3g,4g,offline,...) plugin send result js , keeping callback every phone call received in same success callback in js site.

cordova phonegap-plugins

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -