- SDK Version: 35
- Platforms(Android/iOS/web/all): Android
if (
this.state.appState.match(/inactive|background/) &&
nextAppState === "active" &&
Platform.OS === "ios"
) {
Notifications.setBadgeNumberAsync(0);
}
if (
this.state.appState.match(/inactive|background/) &&
nextAppState === "active" &&
Platform.OS === "ios"
) {
Notifications.setBadgeNumberAsync(0);
}
Hey @pandeykamal,
If you are using SDK35, can you make sure you are using the legacy notifications module https://docs.expo.io/versions/v38.0.0/sdk/legacy-notifications/ rather than the new expo-notifications
module that is only compatible with SDK38+.
Cheers,
Adam
Sorry I should’ve noticed the method you were calling rather than the import statement. That method is not available on Android which is expected behavior. “This method will reject on Android.” https://docs.expo.io/versions/v38.0.0/sdk/legacy-notifications/#notificationssetbadgenumberasyncnumber
If setting badge count is a necessary function of your app, our new Notifications
module supports both Android and iOS. (as long as the Android launcher supports icon badges)
Thanks @adamjnav does checking the platform will not get rid of the error?
I am still on 35 and want to get rid of this one until i go with 38.
Yes, that should do the trick until you are able to upgrade to SDK38!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.