feat: finalize notification system (android manifest, token revocation, backend logs)
This commit is contained in:
parent
87523428a7
commit
98637c6d9c
|
|
@ -43,6 +43,8 @@ func NewPushService(userRepo *repository.UserRepository, credentialsFile string)
|
|||
return nil, fmt.Errorf("error getting Messaging client: %v", err)
|
||||
}
|
||||
|
||||
log.Info().Msg("[INFO] PushService initialized successfully")
|
||||
|
||||
return &PushService{
|
||||
client: client,
|
||||
userRepo: userRepo,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.gosojorn.app">
|
||||
<!-- Location permissions for Beacon Network -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
|
|
|
|||
|
|
@ -88,8 +88,21 @@ class NotificationService {
|
|||
Future<void> removeToken() async {
|
||||
if (_currentToken == null) return;
|
||||
|
||||
// Migrate this to Go API
|
||||
_currentToken = null;
|
||||
try {
|
||||
debugPrint('[FCM] Revoking token...');
|
||||
await ApiService.instance.callGoApi(
|
||||
'/notifications/device',
|
||||
method: 'DELETE',
|
||||
body: {
|
||||
'fcm_token': _currentToken,
|
||||
},
|
||||
);
|
||||
debugPrint('[FCM] Token revoked successfully');
|
||||
} catch (e) {
|
||||
debugPrint('[FCM] Failed to revoke token: $e');
|
||||
} finally {
|
||||
_currentToken = null;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _upsertToken(String token) async {
|
||||
|
|
|
|||
Loading…
Reference in a new issue