3

私はこれで私を助けることができる人に非常に感謝します 私は各デバイスとサーバーのphonegapのregidを取得し、私の右に役立つ必要がありますが、私はアンドロイドデバイスでエミュレートするとき、もはやIDPhoneGap 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の開発者に送信者のIDを確認するを示していません以下の変更を試みてください。

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

お返事ありがとうございます。私のアカウントを確認してください。これは送信者IDです。私に解決策を導くその他の推奨事項があります –

関連する問題