目前我正與Azure的通知的問題 - 我已經配置好了一切生產,並證實了這一點,通過發送測試通知工作。然而,在應用程序中的第一個「registerForPushNotifications」之後,下一次我打開它,我得到記錄以下錯誤:Azure的通知中心400註冊推送
PID[11096] Information Sending response: 400.0 <Error><Code>400</Code><Detail>Installation validation failed with following error(s):
 An invalid tag(s) '_UserId:facebook|10211219930003961,NewVenue' was supplied. Valid tag characters are alphanumeric, _, @, -, ., : and #..TrackingId:9315e728-8777-4cad-a475-956c38dcde36_G6,TimeStamp:4/23/2017 9:09:06 AM</Detail></Error>
我使用的樣板代碼(離子)申請註冊爲推動從科爾多瓦提供。我不明白我出錯的地方。我想解決這個問題,因爲這是生產中的一個問題。
訂閱代碼:
function registerForPushNotifications() {
pushRegistration = PushNotification.init({
android: {
senderID: '<id>'
},
ios: {
alert: 'true',
badge: 'true',
sound: 'true'
},
wns: {}
});
// Handle the registration event.
pushRegistration.on('registration', function(data) {
// Get the native platform of the device.
if (device) {
debugger
var platform = device.platform;
// Get the handle returned during registration.
var handle = data.registrationId;
// Set the device-specific message template.
if (platform == 'android' || platform == 'Android') {
// Register for GCM notifications.
window.azureClient.push.register('gcm', handle.replace("|",""), {
mytemplate: {
body: {
data: {
message: "{$(messageParam)}"
}
}
}
});
} else if (device.platform === 'iOS') {
// Register for notifications.
window.azureClient.push.register('apns', handle.replace("|",""), {
mytemplate: {
body: {
aps: {
alert: "{$(messageParam)}"
}
}
}
});
} else if (device.platform === 'windows') {
// Register for WNS notifications.
window.azureClient.push.register('wns', handle.replace("|",""), {
myTemplate: {
body: '<toast><visual><binding template="ToastText01"><text id="1">$(messageParam)</text></binding></visual></toast>',
headers: {
'X-WNS-Type': 'wns/toast'
}
}
});
}
}
});
pushRegistration.on('notification', function(data, d2) {
alert('Push Received: ' + data.message);
});
pushRegistration.on('error', function(err) {
console.warn("error", err)
});
}
將是很好的告訴我們你是如何註冊?它是通過Azure應用服務還是直接通知到通知中心?你的安裝對象是什麼樣的?你已經明顯改變了鍋爐板,因爲你添加了「NewVenue」,這在鍋爐板中不是標準的。 –
我已經啓用了Azure移動應用程序下的刀片服務器。我使用我在編輯中添加的代碼從應用程序註冊。我不知道'newVenue'來自哪裏 - 我確實將它創建爲推刀片中的一個標籤,並選擇了「自動添加」。 –