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

Add ServiceCollection extensions for native Android and iOS projects #3292

Open
Cheesebaron opened this issue Apr 12, 2024 · 3 comments
Open
Labels
Android Feature New feature or request iOS

Comments

@Cheesebaron
Copy link

Problem Statement

For projecs not using the MAUI UI framework and not relying on its MauiAppBuilder it would be nice to have extensions to set up in a net?-android and net?-ios App.

Solution Brainstorm

I guess the main issue here would be to have to hook into lifecycle events yourself, instead of relying on the interfaces MAUI framework provides. But it would behave exactly the same as a native Android and iOS App would.

@bitsandfoxes
Copy link
Contributor

Hey @Cheesebaron, thanks for the feature request. That does sound interesting. Do you have an idea/snippet of what that could look like?

@Cheesebaron
Copy link
Author

Cheesebaron commented Apr 16, 2024

So in a couple of my Android and iOS Apps I just create a ServiceCollection like this and add dependencies to it:

var serviceCollection = new ServiceCollection();

So ideally I would just be able to add Sentry there with:

serviceCollection.AddSentry();

I had a look at what you are doing in the MAUI package for adding stuff to the service collection, I see you add:

  • Logging
  • Options
  • Hook into lifecycle events

The last one is very interesting and not sure if that comes out of the box if you just initialize Sentry directly through SentrySdk. Will lifecycle get observed? Perhaps these are mainly to hook into MAUI specific events to know when pages/windows/shell events are triggered?

EDIT:

After digging more into the code it also seems that you have extra handling for:

  • Screenshots
  • Listening to network changes

@bitsandfoxes
Copy link
Contributor

I see. Thanks again for your input!
We've seen an uptick in interest in mobile projects outside of MAUI. We'll have to see how we can prioritize this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Feature New feature or request iOS
Projects
Status: No status
Status: No status
Development

No branches or pull requests

2 participants