In my canvas app I am running the example code given in the docs to get a signed request from a javascript file:
Sfdc.canvas.client.refreshSignedRequest(function(data) {
if (data.status === 200) {
var signedRequest = data.payload.response;
var part = signedRequest.split('.')[1];
var obj = JSON.parse(Sfdc.canvas.decode(part));
}
});
however, the callback in this example never runs. I followed the code in the SDK and noticed a couple of things: 1st, the callback is referenced, but never called; 2nd, there is a function called callback which appears to be there to handle the callback passed in, but is not called (this is from the postit() function).
I'm still new to callbacks, but in all of the examples I've seen explaining them, the callback is called inside the function it's passed to. It is also my understanding the even if they are not called, they should still run once the parent function is finished.
I know that the refreshedSignedRequest() function is running because I can see that the signed request come across the network, just the callback getting the signed request never runs.