Push notifications create channel doesnt exist

Hello,

I am trying to create a channel for push notifications but the method stated in Expo documentation -
createChannelAndroidAsync - doesnt exist.

I only have available methods on this picture.
14

I tried updating @types/expo but that didnt help.

SDK version : “expo”: “31.0.0”,
@types/expo”: “30.0.5”,

What am i missing here? How to create a push notification channel?

Tnx

Hey @nkaramarko,

Can you share the relevant code when creating the channel? Sounds like you meant to upload a screenshot but I’m not seeing one.

Cheers,
Adam

Hello @adamjnav,

Yes sorry i forgot to upload the picture, there it is now.
I just dont see the create channel method, or any other method except the ones shown on the picture.

Notifications are imported from Expo:
import { Notifications } from ‘expo’;

Something is going wrong here @nkaramarko. There is still no picture :upside_down_face:

Perhaps just paste a code snippet?

The photo is on the first message, you dont see it?
Weird…
Anyway, these are the methods i see offered from Expo.Notifications:
addListener
cancelAllScheduledNotificationsAsync
cancelScheduledNotificationAsync
dismissAllNotificationsAsync
dismissNotificationAsync
getBadgeNumberAsync
getExpoPushTokenAsync
presentLocalNotificationAsync
scheduleLocalNotificationAsync
setBadgeNumberAsync

I see only these methods, no create channel methods.
Any idea what might be wrong and how i could create a notification channel?

Thank you

I do see it now. Odd…not sure why the IDE isn’t showing the createChannelAndroidAsync method. What SDK version are you on?

Here are the docs:
https://docs.expo.io/versions/v32.0.0/guides/notification-channels/#creating-and-using-channels

SDK version : “expo”: “31.0.0”,

Did you try calling Notifications.createChannelAndroidAsync?

well, yes, i try to type it, but it doesnt exist, i get errors that this method doesnt exist on the Notifications

Can you try reproducing this on a Snack? I’d also recommend deleting your node_modules and re-installing them via yarn or npm (whichever you use).

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.