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

automate lifecycle logging #361

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

KennyHuRadar
Copy link
Contributor

Automate lifecycle logging and remove the need for users to mess with the app delegate.

This should be shipped as part of one line. It should be configured by either/both client side arguments.

RadarSDK/Radar.m Outdated
Comment on lines 53 to 69

[[NSNotificationCenter defaultCenter] addObserver:[self sharedInstance]
selector:@selector(logTermination)
name:UIApplicationWillTerminateNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:[self sharedInstance]
selector:@selector(logBackgrounding)
name:UIApplicationDidEnterBackgroundNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:[self sharedInstance]
selector:@selector(logResigningActive)
name:UIApplicationWillResignActiveNotification
object:nil];
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add some sdk config flag here to gate this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Plan will be to ship this alongside or immediately after #357

Copy link
Contributor

Choose a reason for hiding this comment

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

I can add the server code and help with the sdk flag, we should add the flag to android as well. (android right now automatically logs lifecycle)

Copy link
Contributor

@ShiCheng-Lu ShiCheng-Lu Jul 10, 2024

Choose a reason for hiding this comment

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

I actually think its ok to merge this and add sdk flag later as well, since in android right now it logs lifecycle it by default.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we go that route, we'll need to call out that people need to remove their manual impl of these methods.

Copy link
Contributor

@ShiCheng-Lu ShiCheng-Lu Jul 10, 2024

Choose a reason for hiding this comment

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

this PR actually removes those functions, so it'll be a "breaking change", so we should either keep the functions (make them no-op, and add this lifecycle callback by default so people who didn't set it up get it as a new feature, and people who did set it up are not broken and still get the logs) or pack it with 4.0.0

@lmeier lmeier marked this pull request as ready for review August 22, 2024 19:32
@lmeier lmeier changed the title [WIP] automate lifecycle logging automate lifecycle logging Aug 22, 2024
@lmeier
Copy link
Contributor

lmeier commented Aug 28, 2024

Trying to understand why tests are failing here

@KennyHuRadar
Copy link
Contributor Author

KennyHuRadar commented Aug 28, 2024

Trying to understand why tests are failing here

The deprecation annotation angered the linter....
I think we should leave the methods in the header so as to not change the interface and make it a breaking change.
We can remove them from the header file when we actually bump the minor version.

The github action CI test failing is probably due to its lack of speed at the end of the day. The same failing test passed in circle CI so I would disregard them.

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

Successfully merging this pull request may close these issues.

3 participants