I tried & searched so many times, but I'm not getting what's wrong here in my code. Some devices play a sound, but some don't. Ex: Samsung Note 3, Samsung on5, lecco le s2. I'm using 9.4 GCM API.
Error:
10-24 21:30:03.396 6813-6813/apk.apk.com E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
10-24 21:30:03.397 6813-6813/apk.apk.com E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found
Code:
Intent intent = new Intent(this,Splash_Activity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
int requestCode = 0;
PendingIntent pendingIntent = PendingIntent.getActivity(this, requestCode, intent, PendingIntent.FLAG_ONE_SHOT);
Uri sound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder noBuilder = new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.n_logo)
.setContentText(message)
.setAutoCancel(true)
.setSound(sound)
.setVibrate(new long[] { 1000, 1000, 1000, 1000, 1000 })
.setContentTitle(getResources().getString(R.string.app_name))
.setContentIntent(pendingIntent);
NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(0, noBuilder.build()); //0 = ID of notification