As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
I just start using Kinvey in my Titanium app. I follow all the instruction but I always have this error showing up. I don't know why, here is my code :
// Import the Kinvey module.
var Kinvey = require('kinvey-titanium-1.1.9');
// Initialize Kinvey.
Kinvey.init({
appKey : 'xxx',
appSecret : 'xxx'
});
var promise = Kinvey.ping();
promise.then(function(response) {
console.log('Kinvey Ping Success. Kinvey Service is alive, version: ' + response.version + ', response: ' + response.kinvey);
The problem sesms to be from ping when there is no user logged in or never had user before.
I was able to create user (and so to validate the communication between Kinvey and my app), then login then use ping without problem.
Damien Bell
said
almost 9 years ago
Hello there StephaneJ,
The reason that you're running into this issue is because kinvey.init is asynchronous. Essentially you are calling something that takes some time to do. Javascript is single threaded and plows forward in execution regardless of if the item before it has finished or not. In this case you're getting to kinvey.ping before kinvey.init has finished which is causing your issue.
The way to handle this would be to add a callback to the kinvey.init function.
Thanks,
d
daniel_sedlacek
said
almost 9 years ago
Nope, don't do callback, the whole point of Promise is to free us from callbacks. Do something like this:
Kinvey.init({
appKey : 'xxx',
appSecret : 'xxx'
}).then(function() {
var promise = Kinvey.ping();
promise.then(function(response) {
console.log('Kinvey Ping Success. Kinvey Service is alive, version: ' + response.version + ', response: ' + response.kinvey);
StephaneJ
I just start using Kinvey in my Titanium app. I follow all the instruction but I always have this error showing up. I don't know why, here is my code :
// Import the Kinvey module.
var Kinvey = require('kinvey-titanium-1.1.9');
// Initialize Kinvey.
Kinvey.init({
appKey : 'xxx',
appSecret : 'xxx'
});
var promise = Kinvey.ping();
promise.then(function(response) {
console.log('Kinvey Ping Success. Kinvey Service is alive, version: ' + response.version + ', response: ' + response.kinvey);
}, function(error) {
console.log('Kinvey Ping Failed. Response: ' + error.description);
});
For this code I get :
`[ERROR] : V8Exception: Exception occurred at kinvey-titanium-1.1.9.js:267:
Uncaught Kinvey.Error: Kinvey.getActiveUser can only be called after the promise returned by Kinvey.init fulfills or rejects.`
Can you confirm me that appKey = APP ID and appSecret = APP SECRET from the top-right of my app on https://console.kinvey.com ?
Thanks
Ah found it, has changed:
https://devcenter.kinvey.com/html5/guides/migration-to-v3#Promises
Furthermore:
https://devcenter.kinvey.com/html5/guides/users#login -> See chapter "Active User"
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstStephaneJ
I was able to create user (and so to validate the communication between Kinvey and my app), then login then use ping without problem.
Damien Bell
The reason that you're running into this issue is because kinvey.init is asynchronous. Essentially you are calling something that takes some time to do. Javascript is single threaded and plows forward in execution regardless of if the item before it has finished or not. In this case you're getting to kinvey.ping before kinvey.init has finished which is causing your issue.
The way to handle this would be to add a callback to the kinvey.init function.
Thanks,
daniel_sedlacek
Kinvey.init({
appKey : 'xxx',
appSecret : 'xxx'
}).then(function() {
var promise = Kinvey.ping();
promise.then(function(response) {
console.log('Kinvey Ping Success. Kinvey Service is alive, version: ' + response.version + ', response: ' + response.kinvey);
}, function(error) {
console.log('Kinvey Ping Failed. Response: ' + error.description);
});
});
StephaneJ
Tayger
Just ran into same problem (3 years later). The sample of daniel_sedlacek seems not to work:
TypeError: undefined is not a function (near '...}).then(function() {...')
Will try further but it seems a function is not allowed there (today).
Tayger
Ah found it, has changed:
https://devcenter.kinvey.com/html5/guides/migration-to-v3#Promises
Furthermore:
https://devcenter.kinvey.com/html5/guides/users#login -> See chapter "Active User"
-
How do I use Kinvey in my web app?
-
Is it safe to include keys/secrets in my client-side JavaScript app?
-
Why is the activeUser null even though I am logged in?
-
Login does not work even though credentials are valid.
-
Social login doesn’t work.
-
Appending objects to an Array (HTML5 - JS)
-
New to node.js - need bootstrap to downloadfiles from Kinvey
-
Problem with Aggregation/Grouping
-
Internal Server Error using Twitter Sign Up
-
Data Store
See all 315 topics