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

[ios] fix array resolve in request permission #1721

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

goodprofy
Copy link
Contributor

@goodprofy goodprofy commented Jul 5, 2024

Summary

Fixes an issue where the requestNotificationPermission method on iOS incorrectly resolved the promise with an array instead of a boolean value.

Details

Motivation

The TypeScript type definition for the requestPermission function specifies that it should return a Promise<boolean>, indicating a promise that resolves to a boolean value. However, on iOS, the method was actually resolving the promise with an array containing the boolean value. This mismatch between the type definition and the actual return value caused issues in applications that relied on the requestPermission function returning a simple boolean value.

Scope

This change only affects the requestNotificationPermission method in the iOS SDK. It does not change the behavior of any other methods or functionalities.

Testing

Manual testing

Manually tested the requestNotificationPermission method on a real iOS device and verified that the promise now correctly resolves with a boolean value.

Affected code checklist

  • Notifications
  • Push Processing

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have personally tested this on my device
  • All automated tests pass

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

This change is Reviewable

@jennantilla
Copy link
Contributor

Thanks for submitting this, @goodprofy! Along with the PR from @aharonphytech any issues associated with requestPermission should be resolved.

@jennantilla jennantilla self-requested a review August 15, 2024 21:43
@jennantilla jennantilla merged commit c7638f3 into OneSignal:main Aug 15, 2024
@jennantilla jennantilla mentioned this pull request Aug 15, 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

Successfully merging this pull request may close these issues.

2 participants