Start a new topic

TestDrive doens't work on Phonegap/Android

Hi,

I downloaded Kinvey's TestDrive and made the required modifications like Appkey Appsecret. But on my android emulator when I click the "Ping Kinvey" button, nothing happens.. No alert, No error whatsoever. Wondering what I am missing.....

------------------------------index.html---------------------------------------------------------------------------------------------------------

























MyName



Ping Kinvey





















--------------------------------------------------------index.js-----------------------------------------------------------------------------------

/**

* Common app functionality will be attached to the `app` namespace.

*/

var app = {

/**

* Application constructor.

*/

initialize: function() {

this.bindEvents();

},



/**

* Bind event listeners.

*/

bindEvents: function() {

// Bind any events that are required on startup. Common events are: `load`,

// `deviceready`, `offline`, and `online`.

document.addEventListener('deviceready', this.onDeviceReady, false);

},



/**

* The deviceready event handler.

*/

onDeviceReady: function() {

// Initialize Kinvey. Paste your app key and secret below.

var promise = Kinvey.init({

appKey : 'xxxxxxxxxxx',

appSecret : 'yyyyyyyyyyyyyyyyy'

});

promise.then(function(activeUser) {

// The `Kinvey.init` function returns a promise which resolves to the

// active user data (or `null` if there is no active user).



// Your app is now connected to Kinvey.

});

}

};

-------------------------------------------------ping.js--------------------------------------------------------------------------------------------

/**

* Copyright 2013 Kinvey, Inc.

*

* Licensed under the Apache License, Version 2.0 (the "License");

* you may not use this file except in compliance with the License.

* You may obtain a copy of the License at

*

* http://www.apache.org/licenses/LICENSE-2.0

*

* Unless required by applicable law or agreed to in writing, software

* distributed under the License is distributed on an "AS IS" BASIS,

* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

* See the License for the specific language governing permissions and

* limitations under the License.

*/

// Wrap in an [IIFE](http://benalman.com/news/2010/11/immediately-invoked-function-expression/).

(function() {

// Ping the Kinvey service when the button is clicked.

var button = document.getElementById('ping');

button.addEventListener('click', function() {

var promise = Kinvey.ping();

promise.then(function(response) {

alert('Kinvey Ping Success. Kinvey Service is alive, version: ' + response.version + ', response: ' + response.kinvey);

}, function(error) {

alert('Kinvey Ping Failed. Response: ' + error.description);

});

}, false);

}());

-------------------------------------------------------------------------------------------------------------------------------------------------------

Attaching files...
Files are here... Please take a look at these files and let me know ...
Now I got this working on a different box on a different OS. So, I believe my issue is to do with the Env than the code.



Thanks to everyone who read my comments here :smile:
Login or Signup to post a comment