Java Code Examples for org.apache.cordova.CordovaPlugin#onMessage()

The following examples show how to use org.apache.cordova.CordovaPlugin#onMessage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PluginManager.java    From L.TileLayer.Cordova with MIT License 6 votes vote down vote up
/**
 * Send a message to all plugins.
 *
 * @param id                The message id
 * @param data              The message data
 * @return                  Object to stop propagation or null
 */
public Object postMessage(String id, Object data) {
    Object obj = this.ctx.onMessage(id, data);
    if (obj != null) {
        return obj;
    }
    for (CordovaPlugin plugin : this.pluginMap.values()) {
        if (plugin != null) {
            obj = plugin.onMessage(id, data);
            if (obj != null) {
                return obj;
            }
        }
    }
    return null;
}
 
Example 2
Source File: PluginManager.java    From bluemix-parking-meter with MIT License 6 votes vote down vote up
/**
 * Send a message to all plugins.
 *
 * @param id                The message id
 * @param data              The message data
 * @return                  Object to stop propagation or null
 */
public Object postMessage(String id, Object data) {
    Object obj = this.ctx.onMessage(id, data);
    if (obj != null) {
        return obj;
    }
    for (CordovaPlugin plugin : this.pluginMap.values()) {
        if (plugin != null) {
            obj = plugin.onMessage(id, data);
            if (obj != null) {
                return obj;
            }
        }
    }
    return null;
}
 
Example 3
Source File: PluginManager.java    From cordova-amazon-fireos with Apache License 2.0 6 votes vote down vote up
/**
 * Send a message to all plugins.
 *
 * @param id                The message id
 * @param data              The message data
 * @return                  Object to stop propagation or null
 */
public Object postMessage(String id, Object data) {
    Object obj = this.ctx.onMessage(id, data);
    if (obj != null) {
        return obj;
    }

    for (CordovaPlugin plugin : this.pluginMap.values()) {
        if (plugin != null) {
            obj = plugin.onMessage(id, data);
            if (obj != null) {
                return obj;
            }
        }
    }
    return null;
}
 
Example 4
Source File: PluginManager.java    From IoTgo_Android_App with MIT License 5 votes vote down vote up
/**
 * Send a message to all plugins.
 *
 * @param id                The message id
 * @param data              The message data
 * @return                  Object to stop propagation or null
 */
public Object postMessage(String id, Object data) {
    Object obj = this.ctx.onMessage(id, data);
    if (obj != null) {
        return obj;
    }
    for (CordovaPlugin plugin : this.pluginMap.values()) {
        obj = plugin.onMessage(id, data);
        if (obj != null) {
            return obj;
        }
    }
    return null;
}
 
Example 5
Source File: PluginManager.java    From reader with MIT License 5 votes vote down vote up
/**
 * Send a message to all plugins.
 *
 * @param id                The message id
 * @param data              The message data
 * @return                  Object to stop propagation or null
 */
public Object postMessage(String id, Object data) {
    Object obj = this.ctx.onMessage(id, data);
    if (obj != null) {
        return obj;
    }
    for (CordovaPlugin plugin : this.pluginMap.values()) {
        obj = plugin.onMessage(id, data);
        if (obj != null) {
            return obj;
        }
    }
    return null;
}
 
Example 6
Source File: PluginManager.java    From reader with MIT License 5 votes vote down vote up
/**
 * Send a message to all plugins.
 *
 * @param id                The message id
 * @param data              The message data
 * @return                  Object to stop propagation or null
 */
public Object postMessage(String id, Object data) {
    Object obj = this.ctx.onMessage(id, data);
    if (obj != null) {
        return obj;
    }
    for (CordovaPlugin plugin : this.pluginMap.values()) {
        obj = plugin.onMessage(id, data);
        if (obj != null) {
            return obj;
        }
    }
    return null;
}
 
Example 7
Source File: PluginManager.java    From crosswalk-cordova-android with Apache License 2.0 5 votes vote down vote up
/**
 * Send a message to all plugins.
 *
 * @param id                The message id
 * @param data              The message data
 * @return                  Object to stop propagation or null
 */
public Object postMessage(String id, Object data) {
    Object obj = this.ctx.onMessage(id, data);
    if (obj != null) {
        return obj;
    }
    for (CordovaPlugin plugin : this.pluginMap.values()) {
        obj = plugin.onMessage(id, data);
        if (obj != null) {
            return obj;
        }
    }
    return null;
}