deltachat / deltachat-android

Email-based instant messaging for Android.
GNU General Public License v3.0
1.11k stars 144 forks source link

Make it possible to opt out of obtaining FCM token before creating a profile #3142

Closed link2xt closed 2 months ago

link2xt commented 3 months ago

Currently application checks if push notification preference is enabled at the application start: https://github.com/deltachat/deltachat-android/blob/7e7257bf4180060495c86cb10cd09121f9e69d77/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java#L230-L239

If preference is enabled, FCM token is requested and once it is obtained it is uploaded to the server.

User has no chance to change the setting before creating a profile and even then FCM token is already obtained.

link2xt commented 3 months ago

First of all, FcmReceiveService.register should only be called when there is at least one configured account. It is enough to check on application start if there are configured account and at the end of successful configuration.

As for the setting, as it is global, it just has to be accessible somewhere before creating an account. We already have the same problem of accessing the logs, so at first the setting can be added next to the "view log" in the classic email setup. If we move the view log option somewhere else, we can move this setting there too.

adbenitez commented 2 months ago

to be honest an user visible option to enable/disable push notifications is already unheard of, most apps don't expose this, if it is really important using fdroid version without any push notifications should be the way to go, otherwise there shouldn't even be any option to disable push notifications if you install from google play

link2xt commented 2 months ago

Let's remove the option instead then and the inner if.

r10s commented 2 months ago

ftr, the option was added initially not for gplay to disable FCM but to have it disabled by default for fdroid, which turned out to be not sufficient for fdroid. and when we then added a different build flavour for fdroid, making the option useless for fdroid, it was left as is somehow for gplay :)