Notification Channels Error: Could not create channel


#1

I try to migrate to new api notification channels for android, but I got this error in standalone app “Error: Could not create channel”

uncaught at x at x
at H
at A
c@/data/user/0/MY_PROJECT_NAME/files/28.0.0/cached-bundle-experience-%40veha%2FMY_PROJECT_NAME956012762-28.0.0:18:1622
[native code]


#2

Hey @veha,

Can you share the relevant code to the issue? It would really help us debug what could be happening here.

Cheers,

Adam


#3

Hi @adamjnav I using redux-saga

export function* createNotificationsAndroidChannels() {
  if (Platform.OS === 'android') {
    yield call(Notifications.createChannelAndroidAsync, 'main', {
      name: 'Main',
      priority: 'max',
      sound: 'default',
      vibrate: [0, 250, 250, 250]
    });
  }
}

In documentation sound (boolean) but I put text, can there be a reason in? But not all devices throw error…


#4

hey @veha, were all the devices you ran on with Android Oreo or later? Notification channels are not supported pre-Oreo https://docs.expo.io/versions/latest/guides/notification-channels


#5

Hi @quinlanj, I took this from docs:

On devices with Android 7 and below, which don’t support notification channels, Expo will remember the relevant settings you created the channel with (in this case, sound: true) and apply them directly to the individual notification before presenting it to the user.


closed #6

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