I’m trying to implement the push notifications on iOS following the steps in https://github.com/fusetools/handbook-docs/blob/master/FuseJS/05%20-%20Push%20notifications.md
When I only had a developer certificate installed the onRegistrationSucceeded
function triggered like expected, (in the beginning). However I couldnt send notifications to the token from the log. After some trying I realized the app is always run in Release mode so I generated the correct production certificate. However now the onRegistrationSucceeded
callback in never executed. I did get the token by just adding a NSLog in the AppDelegate.mm, and using that token I can send notifications to my phone. However without the onRegistrationSucceeded
callback I can’t send the tokens to my server… I’m using this code:
<FuseJS.Push ux:Global="Push" />
<JavaScript>
var Push = require("Push");
Push.onRegistrationSucceeded = function(regID) {
console.log ("Reg Succeeded: " + regID); // no logs in debug window
fetch('http://temperary.unsecure.server.com/api/register/' + regID , {
method: 'GET'
}); // no requests in my server's logs
};
Push.onRegistrationFailed = function(reason) {
console.log ("Reg Failed: " + reason);
};
Push.onReceivedMessage = function(payload) {
console.log ("Recieved Push Notification: " + payload); // displays log message
};
</JavaScript>
The onReceivedMessage
is being triggerd when I click the notification.