3

Я буду очень благодарен, кто может мне помочь с этим Мне нужно получить регистрацию каждого телефонного разговора по каждому устройству и серверу и обслуживать меня правильно, но когда я подражаю на устройстве Android, больше не отображается идентификаторPhoneGap PushPlugin ID регистрации не работает в movil

в index.js

var app = { 
    initialize: function() { 
     this.bindEvents(); 
    }, 
    bindEvents: function() { 
     document.addEventListener('deviceready', this.onDeviceReady, false); 
     document.getElementById("toggleBtn").addEventListener('click', this.toggle, false); 
    }, 
    onDeviceReady: function() { 
     console.log('deviceready event'); 
     app.push = PushNotification.init({ 
      "android": { 
       "senderID": "143828535864" 
      }, 
      "ios": {}, 
      "windows": {} 
     }); 

     app.push.on('registration', function(data) { 
      console.log("registration event: " + data.registrationId); 
      document.getElementById("regId").innerHTML = data.registrationId; 
      alert(data.registrationId); 
      var oldRegId = localStorage.getItem('registrationId'); 
      var idReg=jQuery("#idReg").val(data.registrationId); 


      if (oldRegId !== data.registrationId) { 
       // Save new registration ID 
       localStorage.setItem('registrationId', data.registrationId); 
      } 
     }); 
    }, 
}; 
app.initialize(); 

и config.xml

<content src="index.html" /> 
    <plugin name="cordova-plugin-whitelist" spec="1" /> 
    <access origin="*" /> 
    <allow-navigation href="*" /> 
    <allow-navigation href="http://*/*" /> 
    <allow-navigation href="https://*/*" /> 
    <allow-navigation href="data:*" /> 
    <allow-intent href="*" /> 
    <allow-intent href="http://*/*" /> 
    <allow-intent href="https://*/*" /> 
    <allow-intent href="tel:*" /> 
    <allow-intent href="sms:*" /> 
    <allow-intent href="mailto:*" /> 
    <allow-intent href="geo:*" /> 
    <platform name="android"> 
     <allow-intent href="market:*" /> 
    </platform> 
    <platform name="ios"> 
     <allow-intent href="itms:*" /> 
     <allow-intent href="itms-apps:*" /> 
    </platform> 
    <!--<plugin name="PushPlugin" value="com.plugin.gcm.PushPlugin" />--> 
    <plugin name="phonegap-plugin-push" spec="~1.7.2" /> 
    <plugin name="cordova-plugin-whitelist" spec="1" /> 
    <plugin name="cordova-plugin-device" spec="0.2.3" /> 

ответ

0

Сначала проверьте идентификатор отправителя в разработчиков Google против единственный проект и попробуйте следующее изменение.

app.push = PushNotification.init({ 
      "android": { 
       "senderID": "143828535864" 
      } 
     }); 
+0

привет спасибо за ваш ответ и проверьте мою учетную запись, и это идентификатор отправителя, у вас есть другие рекомендации, которые могут помочь мне в решении –

Смежные вопросы