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.
Could you maybe run a test on your site using the new sdk? Cause i can't find any other error :neutral_face: (The other stuff like receiving the device token and so on works like a charm)
Best, Nico
M
Mark
said
almost 9 years ago
I can see in the logs both the *Authorization* and *Content-Type* header are not set. If you tried moving the `xhr.open` call to above `xhr.setRequestHeader`, and that didn’t work - I’d try asking around on the Titanium forums, as this seems a Titanium problem.
For me, moving the open call to the top results in making network requests successfully.
Yes. Either way, the headers somehow aren’t added to the request, therefore Kinvey returns a 401.
N
Nico Barelmann
said
almost 9 years ago
Hey,
sadly i can't get it to work right now ... :(
QUestion: What does the request on the Kinvey-side? Just entering the token into the user-object? (If so, i propably can just save it by my own? )
Best, Nico
N
Nico Barelmann
said
almost 9 years ago
Solution:
As we are using a node.js Service for several other things, i make the registerForPush POST Request on the node.js side with the informations coming from the application.
Nico Barelmann
Using backbone library and titanium - for 2 days (or maybe more) i am getting a http error when i am trying to register a device for Push.
The Script:
var url = (Kinvey.API_ENDPOINT + '/push/kid_PTYXXXXX/register-device').toString();
var xhr = Ti.Network.createHTTPClient({
onload: function(e) {
console.log(this.responseText);
alert('success');
},
onerror: function(e) {
// this function is called when an error occurs, including a timeout
console.log(e);
alert('error');
},
timeout:5000 /* in milliseconds */
});
xhr.setRequestHeader('Authorization', 'Kinvey ' + Kinvey.getActiveUser()._kmd.authtoken);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.open("POST", url);
xhr.send({
'platform' : 'ios',
'deviceId' : token
});
Each time i get this:
{
[INFO] : code = 401;
[INFO] : error = "HTTP error";
[INFO] : source = "[object TiNetworkHTTPClient]";
[INFO] : success = 0;
[INFO] : type = error;
[INFO] : }
Any idea whats causing this?
Best, Nico