title: double push notification created with React Native + Expo + FCM
body: <p>I'm trying to create an app that can receive push notification. The push notifications are sent using <code>AWS SNS</code> and using <code>FCM</code> token rather than <code>Expo's Token</code>. The notifications were received, however, every notification was received twice by the system tray. I tried using a phone without expo installed, but it still received 2 notifications.</p>
  
  <p>this is my payload request when sending to <code>SNS</code></p>
  
  <pre><code>{
  "GCM": "{ \"notification\": { \"text\": \"test message\" } }"
  }
  </code></pre>
  
  <p>Any idea why this is happening? I'm willing to provide the code, however I have no idea which part should I put. Here's one example. The app name is the same, but the first notification has expo's logo in it. <strong>update</strong>: after sending through firebase console I realized that the notification with expo icon is the correct one.</p>
  
  <p><strong>EDIT</strong>: After trying to send a notification from firebase console, I managed to get 1 notification only. Is the problem lies in SNS?</p>
  
  <p><strong>EDIT[2]</strong> I took a look at my Cloudwatch Log for the SNS Platform Application. And the <code>NumberOfMessagesPublished</code> metrics suggest that only 1 message published. So I guess it eliminates the possibility that the SNS api was called twice.</p>
  
  <p><strong>EDIT[3]</strong> I tried to use <code>go-fcm</code> package to send notification to fcm directly. I got 2 notifications even without using SNS. But why sending notification to fcm directly has a different output than using Firebase console?</p>
  
  <p><a href="https://i.stack.imgur.com/NLVKa.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NLVKa.jpg" alt="enter image description here"></a></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Finally, I managed to get it to work by setting a <code>tag</code> field in the <code>notification</code> field to prevent duplicates.</p>
  
  <p>So the payload is like this:</p>
  
  <pre><code>{
  "GCM": "{ \"notification\": { \"text\": \"test message\", \"tag\": \"testing\" } }"
  }
  </code></pre>
  
  <p>However this still does not answer the question on why I got the duplicates :(</p>