This is my code in index.js:
$.ajax({
type: 'GET',
data: {registrationdata: registrationDataJson},
async: false,
url: 'https://example.com/push_reg',
success: function(data){
alert("Your device has been successfully registered for push notifications with device id of: " + data);
},
error: function(){
alert('There was an error registering your device');
}
});
I have tried it with both async on and async off. I do not get any alert from either success or error. I put a log line first thing where /push_reg
routes. If I hit it in a desktop browser it logs but not from the app. I have alert(registrationDataJson);
right before this code block (registrationDataJson
is a stringified JSON) so I know the data is good. I have alert('after');
directly after this code block that I never hit so I know that it never gets past this block.
You might want to elaborate and indicate what error messages code / errors you are seeing. Check your config for setting, etc.