2017-05-16 15 views
0

私は私が必要であることを理解し、このdocに従うことによって、アンドロイドプッシュ通知を実行しようとしていイオン3プッシュ通知は、iOS上で受信されません

  1. デバイストークン
  2. APIキー
  3. Sender IDの

デバイストークンを取得しています。私はFCMでプロジェクトを作成しました。送信者IDとAPIキーを取得しました。

しかし、私はプッシュ通知フォームにバックエンドを受信することはできませんよ、彼女は私がapp.component.tsファイル

push.hasPermission() 
     .then((res: any) => { 

     if (res.isEnabled) { 
      console.log('We have permission to send push notifications'); 
     } else { 
      console.log('We do not have permission to send push notifications'); 
     } 
     }); 

     // to initialize push notifications 

     const options: PushOptions = { 
     android: { 
      senderID: '129188921379' 
     }, 
     ios: { 
      alert: 'true', 
      badge: true, 
      sound: 'false' 
     }, 
     windows: {} 
     }; 

     const pushObject: PushObject = push.init(options); 

     pushObject.on('notification').subscribe((notification: any) => console.log('Received a notification', notification)); 

     pushObject.on('registration').subscribe((registration: any) => { 
     console.log('Device registered', registration); 
     self.deviceToken = registration.registrationId; 
     }); 

     pushObject.on('error').subscribe(error => console.error('Error with Push plugin', error)); 

で使用している私のコードで私はどのように任意のエラーを取得しておりません私は問題が何であるかをiphoneのための任意のregistredIdをフロントエンドまたはバックエンド

から間違いを得ていないのですされているが、アンドロイドのために、私は

を取得していますどこをチェックします
+0

「自己」とは何ですか? –

+0

私は.tsファイルにdevicetoken globalyという変数を宣言し、 'this'のinstedを指摘するために' self'を使用しています –

+0

@surajあなたがそこにいると思います –

答えて

0

push.initの前に.hasPermissionを呼び出しています

関連する問題