OneSignal-Flutter-SDK icon indicating copy to clipboard operation
OneSignal-Flutter-SDK copied to clipboard

[Bug]: Android, if change orientation, not working setNotificationWillShowInForegroundHandler

Open VisualMafia opened this issue 3 years ago • 1 comments
trafficstars

What happened?

When you change the screen orientation, pushes start coming as if the application is hidden or unloaded. The setNotificationWillShowInForegroundHandler method is not called.

Options: onesignal_flutter: 3.4.2 flutter version: Flutter 2.10.5 • channel stable compileSdkVersion 31

logs: D/OneSignal( 4808): Configuration Orientation Change: PORTRAIT (1) on activity: app... D/OneSignal( 4808): ActivityLifecycleHandler Handling lost focus D/OneSignal( 4808): Application stopped focus time: 1196909 timeElapsed: 109 D/OneSignal( 4808): FocusTimeProcessorUnattributed:saveUnsentActiveData with lastFocusTimeInfluences: [SessionInfluence{influenceChannel=iam, influenceType=DISABLED, ids=null}, SessionInfluence{influenceChannel=notification, influenceType=DISABLED, ids=null}] D/OneSignal( 4808): FocusTimeProcessorUnattributed:getUnsentActiveTime: 0 D/OneSignal( 4808): FocusTimeProcessorUnattributed:saveUnsentActiveTime: 109 D/OneSignal( 4808): ActivityLifecycleHandler handleFocus, nextResumeIsFirstActivity: true D/OneSignal( 4808): ActivityLifecycleHandler reset background state, call app focus D/OneSignal( 4808): OSFocusHandler running onAppFocus D/OneSignal( 4808): Application on focus D/OneSignal( 4808): Application foregrounded focus time: 1306137 D/OneSignal( 4808): isPastOnSessionTime currentTimeMillis: 1668458588911 lastSessionTime: 1668458479693 difference: 109218 D/OneSignal( 4808): Starting new session with appEntryState: APP_OPEN D/OneSignal( 4808): OneSignal cleanOutcomes for session D/OneSignal( 4808): OneSignal save unattributedUniqueOutcomeEvents: [] D/OneSignal( 4808): OneSignal SessionManager restartSessionIfNeeded with entryAction: APP_OPEN

Steps to reproduce?

1. Launch;
2. Rotate android device

What did you expect to happen?

The screen orientation should not affect the behavior of push notifications.

OneSignal Flutter SDK version

3.4.2

Which platform(s) are affected?

  • [ ] iOS
  • [X] Android

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

VisualMafia avatar Nov 14 '22 20:11 VisualMafia

In version 3.5.1 the problem remained.

VisualMafia avatar Mar 22 '23 11:03 VisualMafia