chat-sdk-android icon indicating copy to clipboard operation
chat-sdk-android copied to clipboard

Notifications look different when app is closed and open.

Open paakjis opened this issue 8 years ago • 7 comments

Notifications look different when app is closed and open. When App is open they come like this: https://i.imgur.com/BwfNRRO.png When App is closed they come like this: https://i.imgur.com/MKUKI5O.png

Is there a service I can activate/make ?

paakjis avatar Dec 14 '17 12:12 paakjis

This is because when the app is closed, the notifications are received as push notifications. When the app is open, they are displayed programatically. This causes some difference in the styling. I can look at making them the same.

bensmiley avatar Dec 14 '17 17:12 bensmiley

Clicking on incoming notification (when in app) , crashes the app.

12-18 14:36:04.867 10135-10135/.app E/UncaughtException: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean .core.dao.Thread.typeIs(int)' on a null object reference

at .ui.chat.ChatActivity.onCreateOptionsMenu(ChatActivity.java:555)
at android.app.Activity.onCreatePanelMenu(Activity.java:2881)
at android.support.v4.app.FragmentActivity.onCreatePanelMenu(FragmentActivity.java:362)
at android.support.v7.view.WindowCallbackWrapper.onCreatePanelMenu(WindowCallbackWrapper.java:98)
at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.onCreatePanelMenu(AppCompatDelegateImplBase.java:335)
at android.support.v7.app.AppCompatDelegateImplV9.preparePanel(AppCompatDelegateImplV9.java:1368)
at android.support.v7.app.AppCompatDelegateImplV9.doInvalidatePanelMenu(AppCompatDelegateImplV9.java:1648)
at android.support.v7.app.AppCompatDelegateImplV9$1.run(AppCompatDelegateImplV9.java:140)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5525)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)

paakjis avatar Dec 18 '17 12:12 paakjis

@dreimanis The above crash has been fixed in build 4.0.8.

bensmiley avatar Dec 18 '17 14:12 bensmiley

This is because when the app is closed, the notifications are received as push notifications. When the app is open, they are displayed programatically. This causes some difference in the styling. I can look at making them the same.

@bensmiley Did you check this?

kaplandroid avatar Apr 06 '18 09:04 kaplandroid

@bensmiley @KAPLANDROID @paakjis adding this you can customize it when app is killed.

<meta-data
            android:name="com.google.firebase.messaging.default_notification_icon"
            android:resource="@drawable/your_icon"
            tools:replace="android:resource"/>

        <meta-data
            android:name="com.google.firebase.messaging.default_notification_color"
            android:resource="@color/your_color"
            tools:replace="android:resource"/>

agustinsivoplas avatar May 28 '18 18:05 agustinsivoplas

This has been resolved in the latest version - all push notifications are handled programatically.

bensmiley avatar May 30 '18 11:05 bensmiley

@bensmiley it's not possible to handle push notification locally if app is killed. What do you mean? I still can see different notifications when I clear the app from history stack and send message to that device

anonym24 avatar Oct 19 '20 13:10 anonym24