getting and setting badge counts

I’m assuming I’m doing something wrong, but I can’t get Notifications.getBadgeCountAsync or setBadgeCountAsync to work. Push notifications are showing, but when I run the code below I assume I’ll get a number. However,

useEffect(() => {

        const badges = Notifications.getBadgeCountAsync()
        console.log('badges: ', badges);
}

returns:

badges:  Promise {
  "_U": 0,
  "_V": 0,
  "_W": null,
  "_X": null,

Notifications.dismissAllNotificationsAsync() doesn’t clear the badge from Expo on the home screen either, so I’m guessing that’s related. Any help is greatly appreciated!

@vinniedauer try this solution.

useEffect(() => {

        const badges = Notifications.getBadgeCountAsync().then((badgeCount) => {
            console.log(badgeCount); // it will return the number count
       })
        console.log('badges: ', badges);
}

and to clear the badge number 

 Notifications.setBadgeCountAsync(0);

Thank you for the response. I realized that my problem was not with my code logic. The problem was that I was trying to get an updated badge count in “real time”, but it was only updating when useEffect fired on my app component. Once I started firing it when the app got foregrounded, it worked.