Skip to content

Headless receiver #399

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

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

Conversation

pstromberg98
Copy link

@pstromberg98 pstromberg98 commented Aug 31, 2024

Problem

Currently when a location update intent is received and Radar is not initialized, Radar will initialize with no user provided receiver. This is an issue if the user is interested in handling location updates that occur post-termination.

Solution

The solution implemented in this PR allows SDK user's to register a RadarReceiver as a "headless receiver". The headless receiver must implement a constructor taking in a single parameter of type Context and depend only on that to bootstrap. After Radar initializes post-termination the SDK will attempt to attach any provided headless receiver, giving the client an opportunity to receive events.

@pstromberg98 pstromberg98 changed the title added headless receiver Headless receiver Aug 31, 2024
@pstromberg98 pstromberg98 marked this pull request as ready for review August 31, 2024 18:22
@KennyHuRadar
Copy link
Contributor

@pstromberg98 from my reading of this PR, it feels to me that it would be even cleaner for us to utilize polymorphism to extend the RadarReceiver class itself. This would allow us to essentially treat these headless receiver and receiver in a similar manner. We could also remove the need to introduce a separate method to attach the headless receiver. What do you think?

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.

2 participants