Hi all,
I’m struggling with the Push Notifications on iOS.
I have already created all of my Certificates again and created multiple Security Profiles but nothing seems to work. I keep getting the error APNS_BAD_DEVICE_TOKEN.
I’m building on Windows and created the Certificates also on Windows with OpenSSL (Admin Mode).
Do you know where I maybe missed something? Or did something completly wrong?
I’m testing the App with TestFlight from Apple. Is this maybe the problem?
Thanks!
Ionic.Auth.login('basic',{'remember': true}, {'email' : sEmail, 'password' : 'xxxx'}).then(
// Success
function(oData)
{
oUser = Ionic.User.current();
oUser.migrate();
oUser.save();
// Create push token
oPush.register(function(oToken) {
// Save pushtoken
oPush.saveToken(oToken);
// Save options for device
window.localStorage['order'] = 1;
apiCalls.activate(sCode, oData.id, oToken.token, sEmail).then(function(oResult)
{
if (!oResult.error)
{
window.localStorage['uuid'] = device.uuid;
// Hide login screen
$scope.modal.hide();
$ionicLoading.hide();
}
else
{
$ionicLoading.hide();
}
}, function(oResult)
{
$ionicLoading.hide();
});
}, function(oData){
$ionicLoading.hide();
});
},
// Error
function(oErr)
{
$ionicLoading.hide();
}
);`