Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feedback]: Strange bool optIn Value Onesignal 5.0.0 stable #720

Closed
1 task done
xunreal75 opened this issue Aug 28, 2023 · 3 comments
Closed
1 task done

[Feedback]: Strange bool optIn Value Onesignal 5.0.0 stable #720

xunreal75 opened this issue Aug 28, 2023 · 3 comments

Comments

@xunreal75
Copy link

xunreal75 commented Aug 28, 2023

What's on your mind?

Hi your optIn bool isn't helpful and hard to understand - please

I don't understand the sense of the value - it's not logical.

my understand is bool optIn is true if I'm optedOut - why this inverted logic?

 /// Gets a boolean value indicating whether the current user is opted in to push notifications.
  /// This returns true when the app has notifications permission and optedOut is called.
  /// Note: Does not take into account the existence of the subscription ID and push token.
  /// This boolean may return true but push notifications may still not be received by the user.
  bool? get optedIn {
    return _optedIn;
  }

Code of Conduct

  • I agree to follow this project's Code of Conduct
@nan-li
Copy link
Contributor

nan-li commented Aug 28, 2023

Hi @xunreal75,

I apologize, there is a mistake in the explanation. It should be:

This returns true when the app has notifications permission and optOut() is not called.

We will fix this description.

These scenarios can help understand what the optedIn property returns.

  • If the device does not have push permission, optedIn is false.
  • If the device has push permission, but no push token or subscription ID yet, optedIn is true.
  • If the device has push permission and optOut() was not called, optedIn is true.
  • If the device has push permission and optOut() was called, optedIn is false.

emawby added a commit that referenced this issue Sep 15, 2023
@emawby
Copy link
Contributor

emawby commented Sep 15, 2023

Fixed in #744

emawby added a commit that referenced this issue Sep 15, 2023
emawby added a commit that referenced this issue Sep 15, 2023
@nan-li
Copy link
Contributor

nan-li commented Nov 2, 2023

We have updated the documentation, so closing

@nan-li nan-li closed this as completed Nov 2, 2023
nan-li pushed a commit that referenced this issue Jan 31, 2024
nan-li pushed a commit that referenced this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants