React-native-onesignal: Notification on click doesn't work when device is inactive for a long time

Created on 28 May 2020  ·  35Comments  ·  Source: OneSignal/react-native-onesignal

Description:

Note: notification is received in all cases and on click works in all cases when the device is active.

This issue is critical and occurs when the device is in standby mode for a long time or if the notification is received when the device is shutdown & you restart:

The notification when clicked doesn't open the app, in fact, nothing happens.

Environment
react-native: 0.62.0
Device: Oneplus 3
Android version: 9

Steps to Reproduce Issue:

This issue usually won't occur when the device is active. To reproduce you need to change the device settings & also make sure the app is killed.

  1. Settings > system > developer options > background process limit > no background processes
  2. Send a notification from the dashboard
  3. Notification is received on the device
  4. Click on the notification, the app doesn't open

Anything else:
Note: I am using notification extender service to change the layout of the notification.

Also, I tried pending Intent with reference to this comment

Here's the code:

import android.util.Log;
import androidx.core.app.NotificationCompat;
import com.onesignal.OSNotificationDisplayedResult;
import com.onesignal.NotificationExtenderService;
import com.onesignal.OSNotificationReceivedResult;
import java.math.BigInteger;
import android.widget.RemoteViews;
import android.app.PendingIntent;
import android.content.Intent;
import org.json.JSONObject;
import org.json.JSONArray;
import org.json.JSONException;

public class NotificationBigStyle extends NotificationExtenderService {
   String channelId = "";
   @Override
   protected boolean onNotificationProcessing(OSNotificationReceivedResult receivedResult) {
      OverrideSettings overrideSettings = new OverrideSettings();
      RemoteViews notificationBig = new RemoteViews(getPackageName(), R.layout.notification_big);

   notificationBig.setTextViewText(R.id.notification_title,receivedResult.payload.body);
   notificationBig.setImageViewResource(R.id.image,R.drawable.notification);

   int requestID = (int) System.currentTimeMillis();

   Intent intent = new Intent(getApplicationContext(), MainActivity.class);
   intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); 
   PendingIntent pendingIntent = PendingIntent.getActivity(this,requestID,intent, PendingIntent.FLAG_UPDATE_CURRENT);

   try {
      JSONObject payload = new JSONObject(receivedResult.payload.rawPayload);
      String channelPayload = payload.getString("chnl");
      JSONObject channel = new JSONObject(channelPayload);
      channelId = channel.getString("id");
   }
   catch (JSONException e) {
       e.printStackTrace();
   }


    overrideSettings.extender = new NotificationCompat.Extender() {
         @Override
         public NotificationCompat.Builder extend(NotificationCompat.Builder builder) {
                   builder
                    .setCustomHeadsUpContentView(notificationBig)
                    .setCustomContentView(notificationBig)
                    .setContent(notificationBig)
                    .setCustomBigContentView(notificationBig)
                    .setContentIntent(pendingIntent)
                    .setChannelId(channelId)
                    .setAutoCancel(true);
                   return builder;
         }
      };

      OSNotificationDisplayedResult displayedResult = displayNotification(overrideSettings);
      return true;
   }
}
Android Possible Bug

Most helpful comment

Hey @jkasten2

Thanks for your time. I checked with 4.0.4 and tried all the cases possible. For now, everything seems to be working!

I will confirm in the next 3 days once it is tested thoroughly in Beta with our users.

All 35 comments

Howdy,

Settings > system > developer options > background process limit > no background processes

Why are you killing background processes here? We can't guarantee the behavior if you are changing the default Android settings. The notification click is handled by starting an intent from a background process, so it won't work as expected. Hope this clarifies the issue.

Hi @rgomezp, thank you for the response. That was to reproduce the issue, since normally during active state the notification on click works properly.

I will explain the issue more over here:

  1. Say if my device is inactive for a long time like for 3-4 hours
  2. notification is received during that time
  3. later on I unlock the device and click on the notification, it doesn't open the app.

This issue also happens when the device is shutdown, I turn on the device and I receive
previous notifications, when I click on them it doesn't open the app.

Please let me know if you need more info

@rgomezp did you get time to check this? My most users are facing this issue

Howdy @crushy26 ,
Our notification restoration logic should handle this. But you have to make sure to allow background processes to be started. Perhaps this is a limitation of OnePlus devices.

We're having exact same issue with our onesignal setup. But we're not using notification extender.

@crushy26 did you find any workaround or more details? Do you have react-native-screens installed? If yes, try this: https://github.com/software-mansion/react-native-screens/issues/17#issuecomment-424704067

BTW we're using [email protected]

@binchik the issue will happen irrespective of the extender. But I am planning to not restore the notification and just allow notifications to be displayed when device is active ( sadly, have to do this at least to avoid such buggy UX ). I will implement this tomorrow. reference

and no, I am not using react-navigation, I am using react-native-navigation by WIX. Did the above thing with react-native-screens fix the issue?

and also could you let me know, what's the device you are getting this issue on?

@crushy26 My issue was resolved when I applied the fix from react-native-screens issue I mentioned above. The device I was getting this on is Samsung Galaxy S8. It's the only device I have, haven't tested on any other.

@binchik how do you go about testing this? what is the scenario in your case? because for me it's when device is inactive for a long time and during that time a notification is received. Later on unlocking the device the notification on click does nothing.

@crushy26 I had the same scenario, and your reproduction steps crashed the app on launch too. I used "no background processes" option in settings just as you proposed. Before the patch it was crashing, after I applied the patch it stopped crashing.

When I tried to debug with adb logcat, I saw the error messages from the react-native-screens issue I posted.

Okay, so you reproduced and tested, solved using the same "no background processes" option? I will do the same if that's the case because till now I thought that it is an anti-method or not a proper way to reproduce the issue.

Is it okay to close this issue @crushy26 ?

@rgomezp The issue persists on the example app too in the repo. I am not sure how anyone here hasn't reported this issue. OnePlus is used by majority of users all over globe. Rest apps, even from not so known developers works well with the same no background processes settings ( this is just for reproducing ), but in normal scenario on device in-active the notification clicks work for other apps as well. My 2 apps both with onesignal, giving same issues.

If I can help you in anyway possible. Let me know.

Howdy,
The most likely reason is that this is a very specific edge case that a small portion of users will ever encounter.

Settings > system > developer options > background process limit > no background processes

Most people never even turn on their developer options let alone limit their background processes. It is expected that doing this may have residual side effects on certain device environments. If you would like to implement the "patch" as suggested by binchik above, we encourage you to do so. Please let us know if you have further questions.

Hi @rgomezp,
As I have mentioned, developer setting it is just for reproducing the issue.

Without developer settings or anything and just trying an example app from OneSignal, will give the same issue.

This doesn't happen with any other app on my device.

@rgomezp any inputs or help?

Hello,
I don't follow. If you need developer settings in order to reproduce the issue, then how can it give the same issue without the settings?

Perhaps I am missing something.

Edit: The issue still persists
PS: No battery optimization or any settings. I am running on default android settings.

When the device is idle for a long time and notification is received, on unlocking device and clicking notification nothing happens.

I am attaching a screen recording for the same and the error I filtered from ADB logcat.

Recording link:

https://onesignal.intercom-attachments-3.com/i/o/256430949/37d362816e15f5ba6e3932fb/VID-20201016-WA0047.mp4

ADB logcat filtered error:

10-16 19:15:03.341 1619 2958 D NotificationService: onNotificationClick: callingUid=10196 10-16 19:15:03.341 1619 2958 D DeviceIdleController: notification UID:1000 10-16 19:15:03.341 1619 1725 W AlarmManager: Unrecognized alarm listener com.android.server.f@bdf59f1

This issue persists in the example folder as well.

@rgomezp if you need any more info let me know.

Hey @rgomezp can you please look into above comment.

I upgraded to 4.0 beta as well to check, but the issue still exists.

This is an critical issue for my users running on oneplus devices and I really don't want to switch library now.

Please help. Thank you.

@crushy26 and @binchik are you both able to reproduce this on a blank app with only OneSignal active?

What other dependencies are you using within the app besides OneSignal?

Hi @jfishman1

Checked on the example app again, the issue persists for oneplus devices running android 10 ( might persist on other manufacturers as well, but I have tested on oneplus 8, 7T, 3, 3T )

To reproduce:

  1. Send notification through the dashboard
  2. Wait for 10-15 mins before clicking (keep notification as it in the notification tray)
  3. Click on the notification and it won't open the app

Let me know if you need anything else.

Hi @jfishman1 @rgomezp

The problem seems to be with alarm manager not been recognized.

Here is the piece from the system log:

11-26 21:11:29.151 1716 4733 D NotificationService: onNotificationClick: callingUid=10196
11-26 21:11:29.151 1716 4733 D DeviceIdleController: notification UID:1000
11-26 21:11:29.151 1716 1836 W AlarmManager: Unrecognized alarm listener com.android.server.f@b869e3d
11-26 21:11:29.157 4990 4990 D NotificationListener: onNotificationRemoved# hash: 268132846
11-26 21:11:29.157 4990 4990 D NotificationListener: onNotificationRemoved# sbn: 231717922, package = com.hog.debug
11-26 21:11:29.158 4990 4990 D Launcher.Utilities: isNotificationBadging: badge: 1
11-26 21:11:29.158 4990 4990 D BubbleTextView: applyDotState cn = ComponentInfo{com.hog.debug/com.hog.MainActivity}, animated = true, wasDoted = true, isDoted = false, dotScale = 1.0, mDotInfo = null
11-26 21:11:29.158 4990 4990 D PopupDataProvider: onNotificationRemoved dotShouldBeRefreshed = PackageUserKey = com.hog.debug#0, containsDot = false
11-26 21:11:29.161 4990 4990 E neplus.launche: Invalid ID 0x00000090.
11-26 21:11:29.167 2399 2399 D NotificationEntryMgr: remove data, 0|com.hog.debug|719030530|null|10505

Here are some solutions for a similar problem,
https://visdap.blogspot.com/2019/04/android-notifications-triggered-by.html

Howdy,
Thank you for the info. We will investigate.

Hi @rgomezp

I would like to add to the above.
Without any developer settings, on default android settings, the OnePlus devices seem to kill the app after some time after app is swiped from recent apps (after 10mins or so)

Here is the line from logcat:

ActivityManager: Killing 13935:com.hog.debug/u0a570 (adj 905): empty # 31

Howdy @crushy26 ,
Thanks for the info. It seems this might be a OnePlus-specific behavior related to Doze Mode. Unfortunately there are cases where we cannot fix issues due to them being Operating System - level specific. However, we are digging into the link you provided to see if there is anything actionable on our side to provide a working work-around.

Thanks for your patience.
Cheers

@rgomezp Hey, thanks for the support.

It's strange that even though there are OS-level restrictions like battery optimize.., many new android apps are able to execute this flawlessly without any extra steps to be taken by the user like turn off battery optimization, etc. which is what bugs me (Also, Below apps won't be whitelisted by the vendor for sure since it is very recent and small scale apps for now, in comparison to Facebook, etc which might be whitelisted by vendors)

example

example2

not sure if both the apps are available In your country to test out though.

Hi @rgomezp @emawby

I recently implemented Freshchat's react-native SDK and it has the notification functionality to let users know a new message has been received.

Their SDK is working fine and the above issue doesn't persist there. Compared both onesignal and freshchat's notification side by side, by sending notifications to the same device.

Onesignal notification didn't enter the app and freshchat's did under same conditions

Please check the sdk here

@crushy26 Thanks for the details and trying out the beta so far, I have some follow up questions.

Question 1 - Are you only seeing this issue on OnePlus devices?

Question 2 - On OnePlus devices specifically, did this problem only start happening when updating to Android 10 on them?

Question 3 - After tapping on the notification and observing the issue of the app not opening, if you send a new notification is it still shown?
If so does tapping on the new one open the app correctly?

Comment 1 - OneSignal's Notification open process does not use an AlarmManager
The notification opened in the OneSignal 3.x.x SDK used a Broadcast to open the app. However in the OneSignal 4.x.x SDK this was switched to starting an Activity instead which is more direct and should have less device restrictions. An AlarmManager is not used as part of the notification open process so the log entries about this seem unrelated.

Please responded to the questions you can above and we can look into this more in-depth after this.

@jkasten2

Answering your above questions,

  1. Not sure if this issue persists on other vendors but I have tested this on OnePlus 3, 3T, 6, 8, and Nord specifically.. all of them have issues.
  2. The problem persisted since Android 9 on OnePlus 3
  3. Yes

Tested the latest beta SDK today, the issue persists there too.

Thanks for the details. Only notification taps not opening the app is very odd since new notifications are still received, which means the app hasn't been force killed by the device.

Let us know if you see this issue on any other devices, emulator, or Android versions so we can narrow down the issue.
From our end we can look into adding additional logging and trying to reproduce the issue on one of the devices listed.

Hi @jkasten2, I am pasting ADB logs before and after notification click for both freshchat's notification which I have integrated and normal notification from onesignal (it takes 10 minutes or so for the activity to be killed, before that everything works fine)

FreshChat's notification click I have highlighted bold. Just above it is onesignal's notification click.

Also, below you can see the activity is being killed, which is the cause for onesignal's issue. Before that everything works fine.

The logs will also help you figure out what exactly happened after the activity was killed and steps taken by freshchat to make it work.

PS: Freshchat is a customer support service, which sends a notification to the user once our staff replies to them via dashboard

01-04 13:14:41.712 1625 1684 I ActivityManager: Killing 14104:com.hog.debug/u0a681 (adj 915): remove task
01-04 13:14:47.515 1625 5669 I ActivityTaskManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.hog.debug/com.hog.MainActivity bnds=[235,356][438,710]} from uid 10135 pid 5427
01-04 13:14:47.558 1625 1684 D OpRestartProcessManager: updateSelf : com.hog.debug, size : 30
01-04 13:14:47.597 1625 1702 I ActivityManager: Start proc 14106:com.hog.debug/u0a681 for activity {com.hog.debug/com.hog.MainActivity}
01-04 13:14:47.629 1625 2774 D OnePlusSmartBoostManager: writeHotCount com.hog.debug, pid=14106
01-04 13:14:47.633 1625 2774 D OpColorDisplayService: frontPackageChanged: com.hog.debug
01-04 13:14:47.634 1625 2774 D OpProximityController: noteFrontPackageChanged pkg:com.hog.debug uid:10681 lpkg:net.oneplus.launcher luid:10135
01-04 13:14:47.634 1625 2774 E ScreenModeService: getAppToken AppWindowToken{1d1d0ab token=Token{45ef2fa ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131}}}
01-04 13:14:47.634 1625 2774 E ScreenModeService: setRefreshRate token AppWindowToken{1d1d0ab token=Token{45ef2fa ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131}}} rate 0 tmpRate 0
01-04 13:14:47.635 1625 2774 D OpQuickReply: setQuickReplyResumed focusedApp AppWindowToken{1d1d0ab token=Token{45ef2fa ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131}}} pkgName com.hog.debug
01-04 13:14:47.646 1625 5669 D Foreground_io: TOP_APP is ProcessRecord{7a9e577 14106:com.hog.debug/u0a681} uid is 10681
01-04 13:14:53.362 1625 2266 D ActivityTaskManager: setRequestedOrientation() to 1 for ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131} from pid=14106, uid=10681
01-04 13:14:53.733 1625 2266 D ActivityTaskManager: setRequestedOrientation() to 1 for ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131} from pid=14106, uid=10681
01-04 13:15:20.771 1625 2975 W NotificationService: Toast already killed. pkg=com.hog.debug callback=android.app.ITransientNotification$Stub$Proxy@e3ceec1
01-04 13:15:23.833 1625 2772 D ActivityTaskManager: setRequestedOrientation() to 1 for ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131} from pid=14106, uid=10681
01-04 13:15:23.835 1625 2772 D ActivityTaskManager: setRequestedOrientation() to 1 for ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131} from pid=14106, uid=10681
01-04 13:15:24.015 1625 5025 D ActivityTaskManager: setRequestedOrientation() to 1 for ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131} from pid=14106, uid=10681
01-04 13:15:24.018 1625 5025 D ActivityTaskManager: setRequestedOrientation() to 1 for ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131} from pid=14106, uid=10681
01-04 13:15:26.510 1625 6049 D ActivityTaskManager: setRequestedOrientation() to 1 for ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131} from pid=14106, uid=10681
01-04 13:15:26.511 1625 2969 D ActivityTaskManager: setRequestedOrientation() to 1 for ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131} from pid=14106, uid=10681
01-04 13:15:28.014 1625 2969 I ActivityTaskManager: START u0 {cmp=com.hog.debug/com.freshchat.consumer.sdk.activity.InterstitialActivity (has extras)} from uid 10681 pid 14106
01-04 13:15:28.033 1625 6049 I ActivityTaskManager: The Process com.hog.debug Already Exists in BG. So sending its PID: 14106
01-04 13:15:28.035 1625 6049 E ScreenModeService: getAppToken AppWindowToken{762c1bb token=Token{867be4a ActivityRecord{88da7b5 u0 com.hog.debug/com.freshchat.consumer.sdk.activity.InterstitialActivity t131}}}
01-04 13:15:28.035 1625 6049 E ScreenModeService: setRefreshRate token AppWindowToken{762c1bb token=Token{867be4a ActivityRecord{88da7b5 u0 com.hog.debug/com.freshchat.consumer.sdk.activity.InterstitialActivity t131}}} rate 0 tmpRate 0
01-04 13:15:28.035 1625 6049 D OpQuickReply: setQuickReplyResumed focusedApp AppWindowToken{762c1bb token=Token{867be4a ActivityRecord{88da7b5 u0 com.hog.debug/com.freshchat.consumer.sdk.activity.InterstitialActivity t131}}} pkgName com.hog.debug
01-04 13:15:28.053 1625 1684 D OpRestartProcessManager: updateSelf : com.hog.debug, size : 30
01-04 13:15:28.060 1625 2238 I ActivityTaskManager: START u0 {cmp=com.hog.debug/com.freshchat.consumer.sdk.activity.ChannelListActivity (has extras)} from uid 10681 pid 14106
01-04 13:15:28.081 1625 1684 D OpRestartProcessManager: Duration is too short, ignore : 18 in com.hog.debug
01-04 13:15:28.092 1625 1684 D OpRestartProcessManager: updateSelf : com.hog.debug, size : 30
01-04 13:15:28.092 1625 6049 I ActivityTaskManager: The Process com.hog.debug Already Exists in BG. So sending its PID: 14106
01-04 13:15:28.094 1625 6049 E ScreenModeService: getAppToken AppWindowToken{534e1a1 token=Token{cc7608 ActivityRecord{5944dfa u0 com.hog.debug/com.freshchat.consumer.sdk.activity.ChannelListActivity t131}}}
01-04 13:15:28.094 1625 6049 E ScreenModeService: setRefreshRate token AppWindowToken{534e1a1 token=Token{cc7608 ActivityRecord{5944dfa u0 com.hog.debug/com.freshchat.consumer.sdk.activity.ChannelListActivity t131}}} rate 0 tmpRate 0
01-04 13:15:28.094 1625 6049 D OpQuickReply: setQuickReplyResumed focusedApp AppWindowToken{534e1a1 token=Token{cc7608 ActivityRecord{5944dfa u0 com.hog.debug/com.freshchat.consumer.sdk.activity.ChannelListActivity t131}}} pkgName com.hog.debug
01-04 13:15:28.237 1625 2975 I ActivityTaskManager: START u0 {cmp=com.hog.debug/com.freshchat.consumer.sdk.activity.ConversationDetailActivity (has extras)} from uid 10681 pid 14106
01-04 13:15:28.239 1625 1684 D OpRestartProcessManager: Duration is too short, ignore : 147 in com.hog.debug
01-04 13:15:28.254 1625 6049 I ActivityTaskManager: The Process com.hog.debug Already Exists in BG. So sending its PID: 14106
01-04 13:15:28.255 1625 6049 E ScreenModeService: getAppToken AppWindowToken{e5dfe5f token=Token{4b536fe ActivityRecord{2ff82b9 u0 com.hog.debug/com.freshchat.consumer.sdk.activity.ConversationDetailActivity t131}}}
01-04 13:15:28.256 1625 6049 E ScreenModeService: setRefreshRate token AppWindowToken{e5dfe5f token=Token{4b536fe ActivityRecord{2ff82b9 u0 com.hog.debug/com.freshchat.consumer.sdk.activity.ConversationDetailActivity t131}}} rate 0 tmpRate 0
01-04 13:15:28.256 1625 6049 D OpQuickReply: setQuickReplyResumed focusedApp AppWindowToken{e5dfe5f token=Token{4b536fe ActivityRecord{2ff82b9 u0 com.hog.debug/com.freshchat.consumer.sdk.activity.ConversationDetailActivity t131}}} pkgName com.hog.debug
01-04 13:15:28.265 1625 1684 D OpRestartProcessManager: updateSelf : com.hog.debug, size : 30
01-04 13:15:28.999 1625 2238 V InputMethodManagerService: showSoftInput: package= com.hog.debug
01-04 13:15:31.720 1625 1684 D OpRestartProcessManager: updateSelf : com.hog.debug, size : 30
01-04 13:15:31.720 1625 5874 E ScreenModeService: getAppToken AppWindowToken{1d1d0ab token=Token{45ef2fa ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131}}}
01-04 13:15:31.720 1625 5874 E ScreenModeService: setRefreshRate token AppWindowToken{1d1d0ab token=Token{45ef2fa ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131}}} rate 0 tmpRate 0
01-04 13:15:31.720 1625 5874 D OpQuickReply: setQuickReplyResumed focusedApp AppWindowToken{1d1d0ab token=Token{45ef2fa ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131}}} pkgName com.hog.debug
01-04 13:15:33.171 1625 5874 D ActivityTaskManager: setRequestedOrientation() to 1 for ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131} from pid=14106, uid=10681
01-04 13:15:33.172 1625 5874 D ActivityTaskManager: setRequestedOrientation() to 1 for ActivityRecord{1a30125 u0 com.hog.debug/com.hog.MainActivity t131} from pid=14106, uid=10681
01-04 13:15:34.459 1625 4923 D OpColorDisplayService: lpackageName: com.hog.debug
01-04 13:15:34.460 1625 4923 D OpProximityController: noteFrontPackageChanged pkg:net.oneplus.launcher uid:10135 lpkg:com.hog.debug luid:10681
01-04 13:15:34.598 1625 1684 I ActivityManager: Killing 14106:com.hog.debug/u0a681 (adj 915): remove task
01-04 13:15:34.717 1625 4923 I WindowManager: WIN DEATH: Window{ddd423b u0 com.hog.debug/com.hog.MainActivity}
01-04 13:16:16.230 1625 1702 I ActivityManager: Start proc 15317:com.hog.debug/u0a681 for broadcast {com.hog.debug/com.onesignal.GcmBroadcastReceiver}
01-04 13:16:16.270 1625 2774 D OnePlusSmartBoostManager: writeHotCount com.hog.debug, pid=15317
01-04 13:16:19.002 1625 16475 D VibratorService: vibrate from 'com.hog.debug', usageHint = 5, token = android.os.Binder@2a59887
01-04 13:16:48.536 1625 2909 D OPBF : setCGroupState():tofreeze=true, uid:10681 pkg:com.hog.debug --->>> ok reason:publish service as client add connection = AppBindRecord{bf96007 com.google.android.gms/.ads.identifier.service.AdvertisingIdService:com.hog.debug}
01-04 13:17:22.778 1625 2909 D OPBF : setCGroupState():tofreeze=false, uid:10681 pkg:com.hog.debug --->>> ok reason:uid active tActive:true
01-04 13:17:38.657 1625 16546 D VibratorService: vibrate from 'com.hog.debug', usageHint = 6, token = android.os.Binder@2a59887
01-04 13:17:38.867 1625 1625 E NotificationService: Muting recently noisy 0|com.hog.debug|-1049021932|null|10681
01-04 13:19:27.475 1625 2909 D OPBF : setCGroupState():tofreeze=true, uid:10681 pkg:com.hog.debug --->>> ok reason:sensor event tHold:false
01-04 13:22:29.956 1625 5665 I ActivityManager: Killing 15317:com.hog.debug/u0a681 (adj 999): empty #31
01-04 13:22:29.997 1625 2909 D OPBF : setCGroupState():tofreeze=false, uid:10681 pkg:com.hog.debug --->>> ok reason:app died cause by pid 15317
01-04 13:33:30.982 5427 5427 D Stats : Intent.getPackage() is null. therefore try to get package name from componentName.getPackageName(): com.hog.debug
01-04 13:34:56.588 5427 5427 D NotificationListener: onNotificationRemoved# sbn: 35673602, package = com.hog.debug
01-04 13:34:56.599 2412 2412 D NotificationEntryMgr: remove data, 0|com.hog.debug|-1049021932|null|10681
01-04 13:34:59.802 5427 5427 D NotificationListener: onNotificationRemoved# sbn: 159738643, package = com.hog.debug
01-04 13:34:59.810 2412 2412 D NotificationEntryMgr: remove data, 0|com.hog.debug|250143270|null|10681
01-04 13:35:00.319 1625 2223 I ActivityTaskManager: START u0 {flg=0x4000000 cmp=com.hog.debug/com.freshchat.consumer.sdk.activity.ConversationDetailActivity (has extras)} from uid 10681 pid -1
01-04 13:35:00.324 1625 2223 W ActivityTaskManager: startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent { flg=0x4000000 cmp=com.hog.debug/com.freshchat.consumer.sdk.activity.ConversationDetailActivity (has extras) }
01-04 13:35:00.347 1625 1685 D OPFD_CTRL_SVC: [2]handle Starting Window for { com.hog.debug }, Dark? false
01-04 13:35:00.353 1625 1684 D OpRestartProcessManager: updateSelf : com.hog.debug, size : 30
01-04 13:35:00.374 1625 1702 I ActivityManager: Start proc 20400:com.hog.debug/u0a681 for activity {com.hog.debug/com.freshchat.consumer.sdk.activity.ConversationDetailActivity}

01-04 13:35:00.400 1625 5025 D OnePlusSmartBoostManager: writeHotCount com.hog.debug, pid=20400

Hi @jkasten2 @rgomezp any updates on this? Please let me know if we are close to anything.

Howdy,
Unfortunately nothing yet. We will have to get a OnePlus device to try to reproduce. Thank you for your patience.

@crushy26 We fixed a 4.x.x regression issue with notification opens not starting the app if it tried to cold it in react-native-onesignal 4.0.4. We also made an improvement to resume the app just like an Android Launcher does if the app is already running in the background. It involved changing how the Intent is created which could result in indirectly fixing cold start issues too.

So in summary I suspect the following:

  • react-native-onesignal 3.x.x may have not worked due to it using a background Broadcast which Settings > system > developer options > background process limit > no background processes was blocking
  • react-native-onesignal versions 4.0.0 - 4.0.3 didn't work due to the regression bug above.

I did test OneSignal-Android-SDK 4.2.0 on a OnePlus 6T (Model A6013) with OxygenOS 10.3.8 (Android 10) (Build number A6013_34_210114) and was not able to reproduce any open issues.

  • However I did not test with background process limit as you noted though.

@crushy26 Could you try the new version and let us know if you are still seeing the issue?

Hey @jkasten2

Thanks for your time. I checked with 4.0.4 and tried all the cases possible. For now, everything seems to be working!

I will confirm in the next 3 days once it is tested thoroughly in Beta with our users.

That's great to hear @crushy26

Let us know if you would like to reopen the issue

Was this page helpful?
0 / 5 - 0 ratings