react-native-android-badge
react-native-android-badge copied to clipboard
TypeError: undefined is not an object (evaluating '_reactNativeAndroidBadge2.default.setBadge')
I tried to use react-native-android-badge but It was error
[Unhandled Promise rejection: TypeError: undefined is not an object (evaluating '_reactNativeAndroidBadge2.default.setBadge')]
My code is
- import BadgeAndroid from 'react-native-android-badge'
- BadgeAndroid.setBadge(10)
version
- "react": "16.0.0-alpha.12
- "react-native": "^0.48.0"
Add compile project(':react-native-android-badge') as dependency to your \android\app\build.gradle file
- you can also execute gradlew clean in your android directory
Not working
as I can see you have not link the package please do react-native link react-native-android-badge
and then try to restart the app hope it works
@Annihil @pajaploy
Seem react-native link react-native-android-badge
not work perfectly
Please add compile project(':react-native-android-badge')
on android/app/build.gradle manually