Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android app not launch sometimes when i touch the notification. #462

Closed
GeceGibi opened this issue Aug 11, 2021 · 44 comments
Closed

Android app not launch sometimes when i touch the notification. #462

GeceGibi opened this issue Aug 11, 2021 · 44 comments

Comments

@GeceGibi
Copy link

Description:

Title explains the problem.

Environment

SDK Version: 3.2.0
SDK Added from Pub

Steps to Reproduce Issue:

  1. App open
  2. Press android home button or go home screen. (○ button )
  3. Send Notification to device.
  4. Close app manually from android app control screen ( ▢ button )
  5. Touch the notification

Anything else:

[√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19042.1151], locale en-US)
• Flutter version 2.2.3 at D:\Flutter
• Framework revision f4abaa0735 (6 weeks ago), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\####\AppData\Local\Android\Sdk
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = C:\Users\####\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[√] VS Code (version 1.59.0)
• VS Code at C:\Users\####\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.25.0

• No issues found!

@jkasten2
Copy link
Member

@GeceGibi Thanks for reporting. Could you provide the following details?

  1. Android Version(s)
  2. Device Model(s)
  3. Also any Android version and device models you don't see the issue on are useful too
  4. Does the issue only happen when you "4. Close app manually from android app control screen ( ▢ button )"?
  5. Could you share you logcat as an attached .txt / .log file?
    • Note when you swipe away the app in the log and when you open the notification too so we can find the right spot.

Also there are some upcoming changes that might improve or fix this issue I want to reference here:

@GeceGibi
Copy link
Author

1-2-3 :
This bug happening every time with this device:
Redmi Note 9S (mobile) • 2f755042 • android-arm64 • Android 11 (API 30)

I tried every posibilities wtih this device too and app worked as espected:
JNY LX1 (mobile) • EPHUT20220023166 • android-arm64 • Android 10 (API 29)

4: Nope, it's mean when notification comes up and app was closed for some reason maybe user do that maybe device energy save mode do that.

Yea, this pull request maybe resolve this issue.

@zeucxb
Copy link

zeucxb commented Aug 12, 2021

Same problem here.

@GeceGibi
Copy link
Author

@jkasten2 any changes ?

@emawby
Copy link
Contributor

emawby commented Aug 24, 2021

@GeceGibi The Reverse Activity Trampolining Implementation PR has been released on our Android Native SDK which will be a part of the next Flutter release which should come out shortly. Thank you for your patience!

@GeceGibi
Copy link
Author

I tried with latest(3.2.1) version but this issue not fixed.

@GeceGibi
Copy link
Author

I also tried with v3.2.2 but nothing changed.

@jkasten2
Copy link
Member

jkasten2 commented Aug 30, 2021

@GeceGibi Can you capture a full system logcat (verbose, without any filters) from just before tapping on the notification and 10 seconds after on the devices have issues? Android should hopeful tell us why the app did not launch after the notification was opened in this log.

@zeucxb Can you try the new 3.2.2 version? If you still see an issue please also provide the logcat noted above and the device models and Android versions you are seeing the issue on.

@GeceGibi
Copy link
Author

#464

I just waiting this pr. I think everything will be okey after this pr.

@efraespada
Copy link

@GeceGibi you can test the PR with this:

onesignal_flutter:
    git:
      url: https://github.com/efraespada/OneSignal-Flutter-SDK.git

Follow the PR #464 instructions.

@GeceGibi
Copy link
Author

GeceGibi commented Sep 6, 2021

@GeceGibi you can test the PR with this:

onesignal_flutter:
    git:
      url: https://github.com/efraespada/OneSignal-Flutter-SDK.git

Follow the PR #464 instructions.

Nah it's not working either. Notifications not coming up to device when app closed.

I got roll back one signal version to 2.6.4 it's working fine right now.

@gumilar1995
Copy link

gumilar1995 commented Sep 20, 2021

Hi @jkasten2 ,

I'm facing same issue using version 3.2.3.
Here is my device detail : Redmi Note 7 (mobile) • c4eecc7e • android-arm64 • Android 10 (API 29)
I captured logcat of the system as you said from before tap the notification to 10s after issue occurs, you can see the log here :
https://github.com/gumilar1995/files/blob/main/logcat.txt

@aryany9
Copy link

aryany9 commented Oct 6, 2021

Hi @GeceGibi,
I am testing the Onesignal plugin on older android version (Nougat) and everything is working fine as expected. Looks like this issue is only on Android 10+ based devices. I am using Redmi Note 9 Pro where tapping on notification is not opening the app if the app is "just closed" (Removed from Recent App, Not force stopped).
Most probably reason for app not getting launched could be either Android 10 or It's Redmi device (Higher Chances).

@andrea689
Copy link

I tried with Android 7.0 and I have the same problem!

I solved it with version 3.0.0

@GeceGibi
Copy link
Author

Crashlytics logs

OSNotificationRestoreWorkManager.java line 48
com.onesignal.OSNotificationRestoreWorkManager.beginEnqueueingWork
Fatal Exception: java.lang.RuntimeException: Unable to resume activity {net.memurlar/net.memurlar.MainActivity}: java.lang.IllegalStateException: WorkManager is not initialized properly.  You have explicitly disabled WorkManagerInitializer in your manifest, have not manually called WorkManager#initialize at this point, and your Application does not implement Configuration.Provider.
       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4891)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4928)
       at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2309)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:246)
       at android.app.ActivityThread.main(ActivityThread.java:8587)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Caused by java.lang.IllegalStateException: WorkManager is not initialized properly.  You have explicitly disabled WorkManagerInitializer in your manifest, have not manually called WorkManager#initialize at this point, and your Application does not implement Configuration.Provider.
       at androidx.work.impl.WorkManagerImpl.getInstance(WorkManagerImpl.java:156)
       at androidx.work.WorkManager.getInstance(WorkManager.java:184)
       at com.onesignal.OSNotificationRestoreWorkManager.beginEnqueueingWork(OSNotificationRestoreWorkManager.java:48)
       at com.onesignal.OneSignal.onAppFocusLogic(OneSignal.java:1390)
       at com.onesignal.OneSignal.onAppFocus(OneSignal.java:1375)
       at com.onesignal.ActivityLifecycleHandler.handleFocus(ActivityLifecycleHandler.java:182)
       at com.onesignal.ActivityLifecycleHandler.onActivityResumed(ActivityLifecycleHandler.java:88)
       at com.onesignal.ActivityLifecycleListener.onActivityResumed(ActivityLifecycleListener.java:91)
       at android.app.Application.dispatchActivityResumed(Application.java:455)
       at android.app.Activity.dispatchActivityResumed(Activity.java:1413)
       at android.app.Activity.onResume(Activity.java:1945)
       at io.flutter.embedding.android.FlutterActivity.onResume(FlutterActivity.java:569)
       at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1456)
       at android.app.Activity.performResume(Activity.java:8353)
       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4881)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4928)
       at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2309)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:246)
       at android.app.ActivityThread.main(ActivityThread.java:8587)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

@GeceGibi
Copy link
Author

@jkasten2 any update for this issue ?

@Makarov96
Copy link

I have the same issue with the version onesignal_flutter: ^3.2.7 any update?

@jkasten2
Copy link
Member

jkasten2 commented Dec 8, 2021

@GeceGibi @aryanyadav9 Can you try again with onesignal_flutter 3.2.5 or newer? There was an Android regression bug mainly with notifications with Launch URL set (could have effect some other notifications).

Also just to confirm your message from before @GeceGibi, notification open is working correctly on your JNY LX1 device but not your Xiaomi Redmi Note 9S?

@GeceGibi @aryanyadav9 If you are only seeing an issue with Xiaomi devices can you post a reply with the information requested in [Needs details from community] Xiaomi - Notification Open - Not foregrounding app?

@j-ixcayau
Copy link

I have the same issue with Xiaomi, Huawei and Sky devices.
This issue start after an migration of Flutter from 1 to 2.5, with the versions of One Signal that support Null safety

What I have noticed is that the package handle the push after on tap, is just that do not open the app

@GeceGibi
Copy link
Author

@jkasten2 I always use the latest version of onesignal and im using with strandart notification payload not with url.

Also device receives a notification, but the application does not open when touched.
The plugin was working fine in v2 but now I am not happy.

@aswinpraja
Copy link

The issue is not reproducible with latest(3.2.7), let me know if anyone else is facing the same.

@Makarov96
Copy link

any update about this issue? or someone has been able to fix ?

@ismailcaakir
Copy link

ismailcaakir commented Jan 7, 2022

I have same error in 3.2.7,

Many users find this annoying. I can't re produce bug.

onesignal_flutter: dependency: "direct main" description: name: onesignal_flutter url: "https://pub.dartlang.org" source: hosted version: "3.2.7"

does this work?
https://stackoverflow.com/a/49586473/5281938

@GHO5TMEDO
Copy link

I have the same issue with Xiaomi using latest onesignal_flutter.

@WaheedHussainHaans
Copy link

Any updates on this facing same issue on redmi note 10 pro TIA

@ItsManikantaGopi
Copy link

Any Updates? facing same issue with Poco M2 Pro!

@tamirrab
Copy link

Same here

@GeceGibi
Copy link
Author

Any Updates? facing same issue with Poco M2 Pro!

Nopeee. They just watching us and do nothing. I'm waiting for six month.

@DavideArena
Copy link

DavideArena commented Jan 23, 2022

Same issue here with version 3.2.7 (i tried to update the version from 3.0.0 to 3.2.7, hoping for a fix, but problem is here yet), with android 10 and xiaomi device, click on every notification doesn't open the app (with simple notification with launch url either)

@FeifanChang
Copy link

same issue.

@mmustafaget
Copy link

Caused by java.lang.IllegalStateException
WorkManager is not initialized properly. You have explicitly disabled WorkManagerInitializer in your manifest, have not manually called WorkManager#initialize at this point, and your Application does not implement Configuration.Provider.

androidx.work.impl.WorkManagerImpl.a (WorkManagerImpl.java:36)
androidx.work.WorkManager.enqueue (WorkManager.java)
com.onesignal.OSNotificationRestoreWorkManager.a (OSNotificationRestoreWorkManager.java:27)
com.onesignal.OneSignal.onAppFocusLogic (OneSignal.java:29)
com.onesignal.OneSignal.onAppFocus (OneSignal.java:78)
com.onesignal.ActivityLifecycleHandler.d (ActivityLifecycleHandler.java:75)
com.onesignal.ActivityLifecycleHandler.d (ActivityLifecycleHandler.java:28)
com.onesignal.ActivityLifecycleListener.onActivityResumed (ActivityLifecycleListener.java:4)
android.app.Application.dispatchActivityResumed (Application.java:438)

same issue

@rishav130
Copy link

rishav130 commented Feb 10, 2022

@jkasten2 why don't you do something about it instead of waiting for it to get fixed by itself with some magic. we all are facing this problem from a long time now, this is shameful one signal
This functionality used to work very fine in native but in flutter it just doesn't work!!!

@bwrelawan
Copy link

better using 3.0.0 Version. Its okay to open notification on Xiaomi device but sometimes cant open. But better than nothing XD

@nileshsoni97
Copy link

nileshsoni97 commented Feb 18, 2022

photofunny net_

photofunny net_ (1)

@tamirrab
Copy link

This Problem is solved. This issue is not from onesignal side just a MIUI issue (Redmi & Mi Mobiles). Solve this problem by enabling this option in setting of your app.

photofunny net_

photofunny net_ (1)

Sorry but I’m not sure you are right
The previous version is working without it

Also, I can't ask the user to do this

@GeceGibi
Copy link
Author

This Problem is solved. This issue is not from onesignal side just a MIUI issue (Redmi & Mi Mobiles). Solve this problem by enabling this option in setting of your app.

Sorry but I’m not sure you are right The previous version is working without it

Also, I can't ask the user to do this

Yeap absolutely. This is Onesignal problem. Previous versions working fine but 3.* versions has bugged.

@nileshsoni97
Copy link

This Problem is solved. This issue is not from onesignal side just a MIUI issue (Redmi & Mi Mobiles). Solve this problem by enabling this option in setting of your app.

Sorry but I’m not sure you are right The previous version is working without it
Also, I can't ask the user to do this

Yeap absolutely. This is Onesignal problem. Previous versions working fine but 3.* versions has bugged.

#488 (comment)

@GeceGibi
Copy link
Author

it's not the solution btw and issue is not notification dialog show problem. it's when app closed in background and touched to notification dialog app not coming foreground. App not starting with notification touch.

@murilots
Copy link

murilots commented Mar 2, 2022

Same issue with MI 8.

This issue not happen with flutter_local_notifications

@supermnemonic
Copy link

still issue

@jkasten2
Copy link
Member

jkasten2 commented Apr 24, 2022

Update

Huawei - With HMS push

The Huawei notification open not foregrounding the app issue will be part of the next release this week.

  • Only a factor if it was sent a HMS message type notification(default). Data type notifications worked correctly.
  • The fix was part of the 3.3.0 release, which includes OneSignal-Android-SDK 4.7.0 where the fix was made.

Xiaomi

Notification open not foregrounding the app is an issue for FCM pushes is still ongoing. See OneSignal/OneSignal-Android-SDK#1494 for the latest details.

Others

There are no known issues with other devices or push types.

CC @Aksoyhlc

@Samuelbrandani
Copy link

same here

@nan-li
Copy link
Contributor

nan-li commented May 26, 2022

Hi all,

(1) For the Xiaomi issue, thank you for waiting and the fix is now in the latest OneSignal-Flutter-SDK release, version 3.3.1.

(2) For the issue about WorkManager is not initialized properly, it is being tracked at OneSignal/OneSignal-Android-SDK#1561 and investigated. Please see this comment if you have more details to share.

(3) Please open a new issue if you have a different issue than the 2 above.

Since most comments were about the Xiaomi bug, I will close this issue, but please reach out if you are running into any problems.

@nan-li nan-li closed this as completed May 26, 2022
@benjaminhorner
Copy link

I am still facing the issue with version 5.0.3…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests