0

目前我正与Azure的通知的问题 - 我已经配置好了一切生产,并证实了这一点,通过发送测试通知工作。然而,在应用程序中的第一个“registerForPushNotifications”之后,下一次我打开它,我得到记录以下错误:Azure的通知中心400注册推送

PID[11096] Information Sending response: 400.0 <Error><Code>400</Code><Detail>Installation validation failed with following error(s):&#xD; 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) 
     }); 
    } 
+0

将是很好的告诉我们你是如何注册?它是通过Azure应用服务还是直接通知到通知中心?你的安装对象是什么样的?你已经明显改变了锅炉板,因为你添加了“NewVenue”,这在锅炉板中不是标准的。 –

+0

我已经启用了Azure移动应用程序下的刀片服务器。我使用我在编辑中添加的代码从应用程序注册。我不知道'newVenue'来自哪里 - 我确实将它创建为推刀片中的一个标签,并选择了“自动添加”。 –

回答

0

Azure的移动应用SDK为Apache科尔多瓦不安装工作,并能。你需要做一个HTTP POST请求/push/installations/{applicationId}端点(这就是推动叶片为您配置端点)。正文必须是通知中心的有效安装对象。

我整个过程谈了这一点使用C#在我的书(http://aka.ms/zumobook)的语言。由于您发送的是与推送对象直接相关的配置对象,因此您可以对发送的推送参数进行微调。

+0

太好了,谢谢你会给我一个机会。尽管我发誓此事在我的其他应用程序之前工作过,但是有些事情发生了变化?还是我疯了? –

+0

另外,我在哪里获得{applicationId}值? –

+0

代码进行分析后,我发现与Facebook权威性和Azure的应用服务推动叶片的错误。我正在努力为您解决问题。您可以通过[email protected]与我联系,我们会获得更多信息排序。 applicationID在SDK中可用于client.getApplicationInstallationId() –

相关问题