Skip to content

Conversation

@aerych
Copy link
Contributor

@aerych aerych commented Nov 27, 2018

This PR addresses an issue with the applicationOpenedTime property being reset with a new date due to UIApplicationDidBecomeActiveNotification notifications received while multitasking or viewing a system overlay.

For more background see p9OQAC-90-p2.

To test:

  • Use an iPad to test all uses cases.
  • Set breakpoints in trackApplicationOpened and trackApplicationClosed.

Scenario 1:
Launch the app and confirm that trackApplicationOpened is called and the date is correctly set.
Background the app and confirm that trackApplicationClosed is called and the date is unset.

Scenario 2:
With the app in the foreground, swipe down from the top left or right corners to view Mission Control or Notification Center. Note that UIApplicationDidEnterBackgroundNotification is not dispatched and trackApplicationClosed is not called (interestingly UIApplicationDidBecomeActiveNotification is for some reason 🤔). Dismiss the system overlay and confirm that while trackApplicationOpened is called the date is not nil and is therefore not reset.

Scenario 3
Swipe up to view the launch bar. Tap and hold on another app to multitask.
Observe that UIApplicationDidBecomeActiveNotification is dispatched when multitasking starts. Adjust the split screen and observe that UIApplicationDidBecomeActiveNotification is again dispatched.
In both cases confirm that confirm that while trackApplicationOpened is called the date is not nil and is therefore not reset.

@jklausa could I trouble you for a review?

@aerych aerych added this to the 11.4 milestone Nov 27, 2018
@aerych aerych self-assigned this Nov 27, 2018
@aerych aerych requested a review from jklausa November 27, 2018 17:08
@jklausa
Copy link
Contributor

jklausa commented Nov 28, 2018

Wow that's a nasty edge case!

Copy link
Contributor

@jklausa jklausa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✨ I tried mutliple split-view situations, including Slide Over (or whatever that mode is called) and it held up :) Great catch on this and a beautiful comment explaining why it's needed.

Maybe worth pinging Platform folks about getting this back-ported to 11.3 so we get more reliable data sooner?

@aerych
Copy link
Contributor Author

aerych commented Nov 28, 2018

Thanks @jklausa !!!

Maybe worth pinging Platform folks about getting this back-ported to 11.3

Not a bad idea :)

@aerych aerych merged commit 6fc523e into develop Nov 28, 2018
@aerych aerych deleted the issues/tweak-time-in-app-tracking branch November 28, 2018 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants