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

Ensure that a PushProvider is available on a device before using it. #2248

Merged
merged 2 commits into from
Jan 18, 2024

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Jan 17, 2024

Type of change

  • Feature
  • Bugfix
  • Technical
  • Other :

Content

Ensure that a PushProvider is available on a device before using it.
It help to fallback to UnifiedPush (if available) if the PlayServices are not installed on the device.

Motivation and context

Let the device fallback to UnifiedPush if the PlayServices is not available on the device, even if installed from the PlayStore.

Screenshots / GIFs

Tests

  • Step 1
  • Step 2
  • Step ...

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

@bmarty bmarty requested a review from a team as a code owner January 17, 2024 15:55
@bmarty bmarty requested review from jmartinesp and removed request for a team January 17, 2024 15:55
Copy link

codecov bot commented Jan 17, 2024

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (4bbaced) 70.00% compared to head (54f3f8d) 69.95%.
Report is 11 commits behind head on develop.

Files Patch % Lines
...ies/pushproviders/firebase/FirebasePushProvider.kt 0.00% 8 Missing ⚠️
...s/pushproviders/unifiedpush/UnifiedPushProvider.kt 0.00% 7 Missing ⚠️
.../android/libraries/push/impl/DefaultPushService.kt 0.00% 3 Missing ⚠️
...c/main/kotlin/io/element/android/x/di/AppModule.kt 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2248      +/-   ##
===========================================
- Coverage    70.00%   69.95%   -0.05%     
===========================================
  Files         1335     1335              
  Lines        32632    32656      +24     
  Branches      6788     6791       +3     
===========================================
+ Hits         22843    22844       +1     
- Misses        6512     6535      +23     
  Partials      3277     3277              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

It help to fallback to UnifiedPush (if available) if the PlayServices are not installed on the device.
@bmarty bmarty force-pushed the feature/bma/pushProviderSelection branch from dc0111b to 54f3f8d Compare January 17, 2024 16:11
Copy link

sonarcloud bot commented Jan 17, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/d1cTzp

Copy link
Member

@jmartinesp jmartinesp left a comment

Choose a reason for hiding this comment

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

The PR LGTM, thanks.

Let the device fallback to UnifiedPush if the PlayServices is not available on the device, even if installed from the PlayStore.

Just curious, is that even possible?

@spaetz
Copy link

spaetz commented Jan 18, 2024

Just curious, is that even possible?

Absolutely. For one thing, there are alternative store applications (eg Aurora store) which install apks from the play store without having any Google Framework installed.
Alternatively, one can enable all Play stuff, install whatever one needs and deactivate all play stuff subsequently.

...or so I have heard from a friend 😜

@bmarty bmarty merged commit e00d1ab into develop Jan 18, 2024
13 of 15 checks passed
@bmarty bmarty deleted the feature/bma/pushProviderSelection branch January 18, 2024 13:46
@K4LCIFER
Copy link

Let the device fallback to UnifiedPush if the PlayServices is not available on the device, even if installed from the PlayStore.

Does this mean that one cannot choose to use UnifiedPush from within the app? One can only use UnifiedPush if, somehow, PlayServices is made unavailable?

@bmarty
Copy link
Member Author

bmarty commented Jan 31, 2024

Does this mean that one cannot choose to use UnifiedPush from within the app? One can only use UnifiedPush if, somehow, PlayServices is made unavailable?

Yes. There is no in app selector if both providers are available.
I you want to ensure that UnifiedPush is used, a solution could be to install the application from F-Droid when it will be available.

@K4LCIFER
Copy link

K4LCIFER commented Feb 1, 2024

Yes. There is no in app selector if both providers are available.

Is there a plan to add one in the future?

This was referenced Feb 1, 2024
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.

4 participants