Welcome
Login
Sign up
Home
Solutions
Forums
How can we help you today?
Enter your search term here...
Search
Login
or
Signup
to submit a new ticket
Check ticket status
Start a new topic
Discussions
Kinvey Forums
General Discussion
TestDrive doens't work on Phonegap/Android
s
substr
started a topic
over 6 years ago
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);
}());
-------------------------------------------------------------------------------------------------------------------------------------------------------
3 Comments
Oldest First
Popular
Newest First
Sorted by
Oldest First
s
substr
said
over 6 years ago
Attaching files...
s
substr
said
over 6 years ago
Files are here... Please take a look at these files and let me know ...
s
substr
said
over 6 years ago
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
More topics in
General Discussion
What is the best way to store and load hierarchies/relationships in the Data Store?
How do I create in-app payments using Kinvey?
Link users to file uploads
question about references and user permissions
Data storage limits?
Relational Data - Files
What defines an Active User?
"The app backend is under lockdown"
query doesn't show files, can't download.
Posting Code to Forum
See all 315 topics
substr
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);
}());
-------------------------------------------------------------------------------------------------------------------------------------------------------