2
2
3
3
import static com .modutaxi .api .common .constants .ServerConstants .FCM_DEFAULT_TOKEN ;
4
4
5
- import com .google .firebase .FirebaseException ;
6
5
import com .google .firebase .messaging .ApnsConfig ;
7
6
import com .google .firebase .messaging .Aps ;
8
7
import com .google .firebase .messaging .FirebaseMessaging ;
8
+ import com .google .firebase .messaging .FirebaseMessagingException ;
9
9
import com .google .firebase .messaging .Message ;
10
10
import com .google .firebase .messaging .Notification ;
11
11
import com .google .gson .Gson ;
@@ -51,7 +51,7 @@ public void subscribe(Long memberId, Long roomId) {
51
51
.subscribeToTopic (
52
52
Collections .singletonList (fcmToken ), Long .toString (roomId ));
53
53
log .info ("FCM SUBSCRIBE" );
54
- } catch (FirebaseException e ) {
54
+ } catch (FirebaseMessagingException e ) {
55
55
log .error ("FAIL FCM SUBSCRIBE" );
56
56
throw new BaseException (ChatErrorCode .FAIL_FCM_SUBSCRIBE );
57
57
}
@@ -63,7 +63,7 @@ public void unsubscribe(Long memberId, Long roomId) {
63
63
FirebaseMessaging .getInstance ()
64
64
.unsubscribeFromTopic (
65
65
Collections .singletonList (fcmToken ), Long .toString (roomId ));
66
- } catch (FirebaseException e ) {
66
+ } catch (FirebaseMessagingException e ) {
67
67
throw new BaseException (ChatErrorCode .FAIL_FCM_UNSUBSCRIBE );
68
68
}
69
69
}
@@ -74,7 +74,7 @@ public void send(Message message) {
74
74
Gson gson = new Gson ();
75
75
String fcmMessageJson = gson .toJson (message );
76
76
log .info ("FCM 메시지: " + fcmMessageJson );
77
- } catch (FirebaseException e ) {
77
+ } catch (FirebaseMessagingException e ) {
78
78
log .error (ChatErrorCode .FAIL_SEND_MESSAGE .getMessage ());
79
79
log .error ("message: {}" , e .getMessage ());
80
80
log .error ("localizedMessage: {}" , e .getLocalizedMessage ());
0 commit comments