Android notification is not showing

The code won’t work without an icon. So, add the setSmallIcon call to the builder chain like this for it to work: .setSmallIcon(R.drawable.icon) Android Oreo (8.0) and above Android 8 introduced a new requirement of setting the channelId property by using a NotificationChannel. NotificationManager mNotificationManager; NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mContext.getApplicationContext(), “notify_001”); Intent ii = new … Read more

Actionbar notification count icon (badge) like Google has

I am not sure if this is the best solution or not, but it is what I need. Please tell me if you know what is need to be changed for better performance or quality. In my case, I have a button. Custom item on my menu – main.xml <item android:id=”@+id/badge” android:actionLayout=”@layout/feed_update_count” android:icon=”@drawable/shape_notification” android:showAsAction=”always”> </item> … Read more

How to fix “no valid ‘aps-environment’ entitlement string found for application” in Xcode 4.3?

If you created your provisioning profile before configuring the app ID for push, try to regenerate the provisioning profile. iOS Provisioning Portal -> Provisioning -> Your cert -> EDIT -> Make an edit -> Download new provisioning Worked for me. Now i’m able to use push.

How do I update the notification text for a foreground service in Android?

When you want to update a Notification set by startForeground(), simply build a new notication and then use NotificationManager to notify it. The key point is to use the same notification id. I didn’t test the scenario of repeatedly calling startForeground() to update the Notification, but I think that using NotificationManager.notify would be better. Updating … Read more

Building a notification system [closed]

A notification is about something (object = event, friendship..) being changed (verb = added, requested..) by someone (actor) and reported to the user (subject). Here is a normalized data structure (though I’ve used MongoDB). You need to notify certain users about changes. So it’s per-user notifications.. meaning that if there were 100 users involved, you … Read more

Notification click: activity already open

You need to set the launchMode attribute of the Activity you are starting to singleTop. This will cause incoming Intents to be delivered to the existing instance rather than starting a new instance when that Activity is already at the top of the task’s stack. This is done in the manifest by adding android:launchMode=”singleTop” to … Read more

NotificationCompat.Builder deprecated in Android O

It is mentioned in the documentation that the builder method NotificationCompat.Builder(Context context) has been deprecated. And we have to use the constructor which has the channelId parameter: NotificationCompat.Builder(Context context, String channelId) NotificationCompat.Builder Documentation: This constructor was deprecated in API level 26.0.0-beta1. use NotificationCompat.Builder(Context, String) instead. All posted Notifications must specify a NotificationChannel Id. Notification.Builder Documentation: … Read more

How to play an android notification sound

If anyone’s still looking for a solution to this, I found an answer at How to play ringtone/alarm sound in Android try { Uri notification = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), notification); r.play(); } catch (Exception e) { e.printStackTrace(); } You can change TYPE_NOTIFICATION to TYPE_ALARM, but you’ll want to keep track of your Ringtone … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)