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

[BUG] Crash in scheduleNotification func #185

Closed
3 tasks done
seth35us opened this issue Nov 17, 2023 · 6 comments
Closed
3 tasks done

[BUG] Crash in scheduleNotification func #185

seth35us opened this issue Nov 17, 2023 · 6 comments

Comments

@seth35us
Copy link

seth35us commented Nov 17, 2023

New issue checklist

  • I have reviewed the README and documentation
  • I have searched existing issues and this is not a duplicate
  • I have attempted to reproduce the issue and include an example project.

General information

  • Superwall version:
  • iOS version(s):
  • CocoaPods/Carthage version (if applicable):
  • Xcode version:
  • Devices/Simulators affected:
  • Reproducible in the demo project? (Yes/No):
  • Related issues:

Describe the bug

A clear and concise description of what the bug is. The more detail you can provide the faster our team will be able to triage and resolve the issue.

Crash on these lines of code in the NotificationScheduler:

let trigger = UNTimeIntervalNotificationTrigger(
timeInterval: delay,
repeats: false
)

Steps to reproduce

Please also include a description of expected vs. actual behaviour

  1. Add paywall with FreeTrialReminder Notification set to default, which is none.
  2. Make a purchase on that paywall.
  3. Delay is set to an invalid value.

Other Information

e.g. stacktraces, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.

@anglinb
Copy link
Collaborator

anglinb commented Nov 17, 2023

Thanks for reporting this issue, we'll add a check there to make sure we don't pass invalid data. I imagine this happened in development, right? We speed up the time intervals when in dev so you can easily test

@seth35us
Copy link
Author

seth35us commented Nov 18, 2023 via email

@yusuftor
Copy link
Collaborator

Hey @seth35us, when you say this:

Add paywall with FreeTrialReminder Notification set to default, which is none.

Do you mean it's set like this, with no free trial reminder?

Screenshot 2023-11-20 at 19 28 47

Or do you mean like this, where it defaults to Day 1:

Screenshot 2023-11-20 at 19 31 50

Please can you provide a link to your paywall that you have issues with and a stack trace of the error so I can try and reproduce? Thanks!

@seth35us
Copy link
Author

seth35us commented Nov 21, 2023 via email

@seth35us
Copy link
Author

seth35us commented Nov 21, 2023 via email

@yusuftor
Copy link
Collaborator

Thank you! I couldn't reproduce the crash using your paywall but it does look like there may have been a notification delay <= 0 passed down in the Superwall configuration which could cause that crash. We'll look into what caused this bug but I'm adding a guard against that for the next release of the SDK. Thank you for reporting!

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