2016-04-02 2 views
0

Я пытаюсь отправить push из веб-страницы (Javascript), push-сообщение успешно добавлено в очередь на учетной записи quickblox, и статус отправлен, но я не получаю его на устройстве (iPhone). Когда я отправляю push с веб-консоли, я могу получить ее успешно. Скажите, пожалуйста, что не так с кодом или какие-либо настройки.Невозможно получать push-уведомления с помощью 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)) 
}; 

Я надеюсь, что это поможет.