title: Firebase push notifications not working properly in some devices
body: <p>For push notification am using FCM. Iam facing some problem in VIVO V3 phones. <strong>Same code works in other devices (Blackberry,Huawei,Samsung) with all below scenarios</strong>
  I have tested with 3 Scenarios;</p>
  
  <ol>
  <li>When app is in foreground.</li>
  <li>When app is in background.</li>
  <li>When app is in completely kills.</li>
  </ol>
  
  <p>The first 2 condition is working well.Only the problem with 3rd one.When app kills am not getting any notification.</p>
  
  <p>The below code using at server side to send Data Notification message,</p>
  
  <pre><code> {
     "to" : "bk3RNwTe3H0:CI2k_HHwgIpoDKCIZvvDMExUdFQ3P1...",
     "data" : {
       "title" : "Notification Title",
       "body" : "Notification Message",
     },
   }
  </code></pre>
  
  <p>The following code am using in my app,</p>
  
  <pre><code>    import android.app.NotificationManager;
  import android.app.PendingIntent;
  import android.content.Context;
  import android.content.Intent;
  import android.content.SharedPreferences;
  import android.graphics.Bitmap;
  import android.graphics.BitmapFactory;
  import android.media.RingtoneManager;
  import android.net.Uri;
  import android.support.v4.app.NotificationCompat;
  import android.util.Log;
  
  import com.google.firebase.messaging.FirebaseMessagingService;
  import com.google.firebase.messaging.RemoteMessage;
  
  import org.json.JSONException;
  import org.json.JSONObject;
  
  import java.io.InputStream;
  import java.net.HttpURLConnection;
  import java.net.URL;
  
  import me.leolin.shortcutbadger.ShortcutBadger;
  
  
  public class MyFirebaseMessagingService extends FirebaseMessagingService {
  
      private static final String TAG = "debug";
  
      /**
       * Called when message is received.
       *
       * @param remoteMessage Object representing the message received from Firebase Cloud Messaging.
       */
      @Override
      public void onMessageReceived(RemoteMessage remoteMessage) {
          // There are two types of messages data messages and notification messages. Data messages are handled
          // here in onMessageReceived whether the app is in the foreground or background. Data messages are the type
          // traditionally used with GCM. Notification messages are only received here in onMessageReceived when the app
          // is in the foreground. When the app is in the background an automatically generated notification is displayed.
          // When the user taps on the notification they are returned to the app. Messages containing both notification
          // and data payloads are treated as notification messages. The Firebase console always sends notification
          // messages. For more see: https://firebase.google.com/docs/cloud-messaging/concept-options
          //
          Log.d(TAG, "From: " + remoteMessage.getFrom());
          if (remoteMessage.getData()!=null)
              Log.d(TAG, "Notification Message get data: " + remoteMessage.getData().toString());
          if (remoteMessage.getNotification()!=null)
              Log.d(TAG, "Notification Message Body: " + remoteMessage.getNotification().getBody());
  
          try {
              JSONObject jsonObject = new JSONObject(remoteMessage.getData());
  
              //            Map&lt;String, String&gt; map = remoteMessage.getData();
              Log.d(TAG , "Json DATA Notification::" + jsonObject.toString());
  
              //message will contain the Push Message
              String message = jsonObject.getString("title");
  
              String messageContent = jsonObject.getString("body");
  
              sendNotification(message, messageContent);
  
  
          }catch (JSONException e) {
              e.printStackTrace();
              Log.d("debug" , "Exception");
          }
      }
  
  
      /**
       * Create and show a simple notification containing the received FCM message.
       */
  
      private void sendNotification(String messageTitle, String messageBody) {
  
          Intent intent = new Intent(this, MainActivity.class);
          intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
          PendingIntent pendingIntent = PendingIntent.getActivity(this, 0 /* Request code */, intent,
                  PendingIntent.FLAG_ONE_SHOT);
  
          Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
          NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
                  .setSmallIcon(R.mipmap.ic_launcher)
                  .setContentTitle(messageTitle)
                  .setContentText(messageBody)
                  .setAutoCancel(true)
                  .setSound(defaultSoundUri)
                  .setContentIntent(pendingIntent);
  
          NotificationManager notificationManager =
                  (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
  
          notificationManager.notify(0 /* ID of notification */, notificationBuilder.build());
      }
  
  
      @Override
      public void onCreate() {
          super.onCreate();
  
      }
  
  }
  </code></pre>
  
  <p>I have tested with Blackberry,Huawei,Samsung devices.Its working perfectly.Kindly help me.Thanks in advance.</p>