Android

FCM 푸시토큰 가져오기

Machine_웅 2021. 4. 26. 15:16
728x90
반응형
    public void pushToken() {
        FirebaseMessaging.getInstance().getToken()
                .addOnCompleteListener(task -> {
                    if (!task.isSuccessful()) {
                        Logger.warning("Fetching FCM registration token failed " + task.getException());
                        return;
                    }

                    String token = task.getResult();
                    Logger.verbose("token : " + token);
                });
    }

 

728x90
반응형