2016-04-02 13 views
0

Webからプッシュを送信しようとしています(Javascript)プッシュ・メッセージがquickbloxアカウントのキューに正常に追加され、ステータスは送信されていますが、 )。 Webコンソールからプッシュを送信すると、正常に受信できます。コードが間違っているか、設定が必要なのか教えてください。次のようにQuickBloxを使用してプッシュ通知を受け取ることができません

enter image description here

プッシュを送信するためのコードは次のとおりです。

var params = { 
       login: ....., 
       password: ..... 
      } 
QB.createSession(params, function(err, result) { 
       if(!err){ 

        var pushCustomParams = { 
         message: 'Message sent successfully', 
         ios_badge: 1, 
         ios_sound: 'ringtone.wav', 
         user_id: app.caller.id 

        } 

        var params1 = { 
         notification_type: 'push', 

         user: {ids: [recp_id]}, // recipients. 
         environment: 'development', // environment, can be 'production' as well. 
         message: QB.pushnotifications.base64Encode(JSON.stringify(pushCustomParams)) // See how to form iOS or Android spesific push notifications 
        }; 

        QB.pushnotifications.events.create(params1, function(err, response) { 
         if (err) { 
          console.log(err); 

         } else { 
          // success 


         } 
        }); 
       } 
      }); 

答えて

0

は次のように試してみてください:

var params1 = { 
    notification_type: 'push', 
    push_type: 'apns', // http://quickblox.com/developers/Messages#Create_event 
    user: {ids: [recp_id]}, 
    environment: 'development', 
    message: QB.pushnotifications.base64Encode(JSON.stringify(pushCustomParams)) 
}; 

私はこれが役立つことを願っています。

関連する問題