Removing setting of window.data and fixed some indentations
This commit is contained in:
Родитель
be73502c5d
Коммит
5f9dbbc951
|
@ -21,7 +21,6 @@ public class AppFeedback extends CordovaPlugin implements RadFeedback.OnSendFeed
|
|||
|
||||
@Override
|
||||
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
|
||||
|
||||
if (action.equals("GetVariables")) {
|
||||
JSONObject data = new JSONObject();
|
||||
for (int i = 0; i < args.length(); i++) {
|
||||
|
|
|
@ -52,4 +52,5 @@
|
|||
NSString *callbackId = [command callbackId];
|
||||
[self success:result callbackId:callbackId];
|
||||
}
|
||||
|
||||
@end
|
|
@ -45,8 +45,8 @@ var cordova = require('cordova'),
|
|||
|
||||
window.addEventListener('deviceready', function () {
|
||||
cordova.exec(function(data) {
|
||||
if(data.apiKey !== "YourKeyHere"){
|
||||
var shouldEnableShake = data.enableShake === 'true'
|
||||
if (data.apiKey !== 'YourKeyHere') {
|
||||
var shouldEnableShake = (data.enableShake || '').toLowerCase() === 'true';
|
||||
var feedbackOptions = {
|
||||
enableShake: shouldEnableShake,
|
||||
apiUrl: data.apiUrl
|
||||
|
@ -54,10 +54,8 @@ window.addEventListener('deviceready', function () {
|
|||
feedback.initialize(data.apiKey, feedbackOptions);
|
||||
}
|
||||
}, function(err) {
|
||||
window.data = err;
|
||||
console.log('Unable to read required plugin variables: ' + err);
|
||||
}, 'AppFeedback', 'GetVariables', [ 'apiKey', 'apiUrl', 'enableShake' ]);
|
||||
|
||||
}, true);
|
||||
|
||||
module.exports = feedback;
|
Загрузка…
Ссылка в новой задаче