2016-04-02 34 views
0

Web üzerinden push göndermeye çalışıyorum (Javascript) push mesajı, quickblox hesabında sıraya başarılı bir şekilde eklendi ve durum gönderildiği gibi gönderildi ancak cihazda bulamıyorum (iPhone). Web konsolundan itme gönderdiğimde başarılı bir şekilde alabiliyorum. Lütfen kodda neyin yanlış olduğunu veya herhangi bir ayarın gerekli olduğunu söyle.QuickBlox kullanarak push bildirimleri alınamıyor

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 


         } 
        }); 
       } 
      }); 

cevap

0

böyle deneyin:

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)) 
}; 

ben bu yardımcı olacağını umuyoruz şöyle

enter image description here

itmek göndermek için koddur.

İlgili konular