0

Azure でスケジューラを実行すると、トースト通知のプッシュ通知コードが実行されません。私のコードは

     function EWSReminder() {    
          push.wns.sendToastText01("https://sin.notify.windows.com/?          token=Ysdfdhjkdjksj%2fAScjFHiwrUbS6y%2bvumj9sKUqhklsdfjgfdslcvl;dklslkskdlsdl;9XD58CMJebd04EknQY0Hgaxed6%uirutiuritubW%2fRcpdvapAYlMcnWLE360%3d", {
               text1: "Sample toast from sample insert"
            }, {
            success: function(pushResponse) {
                console.log("Sent push:", pushResponse);
            }
            );
}

このエラーが発生します

Error in script '/scheduler/EWSReminder.js'. Error: The options.client_id and options.client_secret must be specified as strings or the WNS_CLIENT_ID and WNS_CLIENT_ID environment variables must be set.
[external code]
at EWSReminder (</scheduler/EWSReminder.js>:2:16)
at </scheduler/EWSReminder.js>:1:13
[external code]

何が問題なのかわかりません。助けてください。利用可能なすべての Microsoft サンプルのコードを適用しましたが、コードはすべて同じですが、どれも機能していません。

4

2 に答える 2

0

私も同じ問題を抱えており、Windows Store Developer Portal から取得したポータルに値を入れました。

以下のコードは私にとってはうまくいきますが、上記のコードはYeshが示すようには機能しません。

var pushWNS = require('wns');
pushWNS.sendToastText01(uri, { text1: Name }, { client_id: 'xxx', client_secret: 'xxx' },
    function (error, response)
    {
        if (!error)
        {
            // success code            
        }
        else
        {
            // error handling
        }
    });

また、私とYeshが言及した両方のコードの違いを知りたかった

于 2014-08-07T04:47:15.633 に答える