react-native-onesignal icon indicating copy to clipboard operation
react-native-onesignal copied to clipboard

[Bug]: fallback alert is always shown on iOS

Open vargajacint opened this issue 11 months ago • 3 comments

What happened?

I have observed that even after explicitly setting the parameter to false in the method call OneSignal.Notifications.requestPermission(false);, iOS still presents a fallback alert. Additionally, the function returns an array that contains a boolean value on iOS, instead of returning a boolean value directly.

Everything is working correctly on Android as per the documentation.

Versions: react-native-onesignal: 5.1.0 OneSignalXCFramework: 5.1.3

Steps to reproduce?

1. Request permission in the following way: `const result = await OneSignal.Notifications.requestPermission(false);`
2. Cancel the permission access
3. Observe a fallback alert that points to the Settings app
4. Observe the `result` type is Array on iOS

What did you expect to happen?

Not present the fallback alert if I call the function with false value. Also, the return value should be boolean on iOS as well

React Native OneSignal SDK version

5.1.0

Which platform(s) are affected?

  • [X] iOS
  • [ ] Android

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

vargajacint avatar Mar 13 '24 21:03 vargajacint

Hello @vargajacint thanks for reaching out! We are looking into this.

jennantilla avatar Mar 19 '24 21:03 jennantilla

I'm suffering the same issue here. Pending to be resolved

CFerndp avatar Mar 27 '24 17:03 CFerndp

Until this is fixed I use:

if(Platform.OS==='android'){
    OneSignal.Notifications.requestPermission(false);
  }else{
    OneSignal.Notifications.requestPermission();
  }

since on IOS it works if no arguments are present. And on android it must have argument.

prdjed avatar May 14 '24 11:05 prdjed