Refresh notification permission on iOS when the app is focused

It may have changed while the app was unfocused
pull/936/head
Michael Zanetti 2022-12-08 16:29:11 +01:00
parent b6065fb8b5
commit 1d2feb444e
1 changed files with 7 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#include "platformpermissionsios.h"
#include <QSettings>
#include <QApplication>
PlatformPermissionsIOS *PlatformPermissionsIOS::s_instance = nullptr;
@ -9,6 +10,12 @@ PlatformPermissionsIOS::PlatformPermissionsIOS(QObject *parent)
{
s_instance = this;
initObjC();
connect(qApp, &QApplication::applicationStateChanged, this, [this](Qt::ApplicationState state){
if (state == Qt::ApplicationActive) {
refreshNotificationsPermission();
}
});
}
PlatformPermissionsIOS *PlatformPermissionsIOS::instance()