OneSignal / react-native-onesignal

React Native Library for OneSignal Push Notifications Service
Other
1.56k stars 373 forks source link

[Bug] Can't clear badge count by myself #1266

Closed wuchengyu closed 3 years ago

wuchengyu commented 3 years ago

Description:

I want to clear badge at specific page instead of open App and auto increase badge.

I push notification from website and set iOS badge increase by 1 many times

Steps:

  1. app badge 0
  2. push notification
  3. app badge 1
  4. open App to specific page
  5. call PushNotification.setApplicationIconBadgeNumber(0)
  6. push notification > app badge 2 (expect 1)

Environment

I try to upgrade react-native-onesignal to 4.2.0 but it still occur.

Steps to Reproduce Issue:

  1. Push notification from website and set iOS badge Set to 1 is working
jkasten2 commented 3 years ago

@wuchengyu Thanks for providing steps to reproduce the issue. This is a symptom of something not correct with your App Groups setup in Xcode.

Please double check you have the same App Group setup for both your targets noted in all parts of the steps under 4.4: https://documentation.onesignal.com/docs/react-native-sdk-setup#step-4-install-for-ios-using-cocoapods-for-ios-apps

More details with troubleshooting for App Groups below: https://documentation.onesignal.com/docs/ios-sdk-app-groups-setup

wuchengyu commented 3 years ago

@jkasten2 Thank you so much, it solved.

We forgot to add different environment bundle id to App group.