deltachat-android icon indicating copy to clipboard operation
deltachat-android copied to clipboard

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

Open link2xt opened this issue 1 year ago • 1 comments

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 avatar Jun 26 '24 07:06 link2xt

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.

link2xt avatar Jun 26 '24 09:06 link2xt

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

adbenitez avatar Jul 26 '24 15:07 adbenitez

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

link2xt avatar Jul 26 '24 16:07 link2xt

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 :)

r10s avatar Jul 26 '24 20:07 r10s