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

[expo-notifications] Fix interpretation of Date and number triggers on iOS #7942

Merged
merged 3 commits into from
Apr 21, 2020

Conversation

sjchmiela
Copy link
Contributor

Why

Fixes #7937.

How

+(NSDate *)dateWithTimeIntervalSince1970: expects time interval to be provided in seconds. From JS we receive a .getTime() value which corresponds to milliseconds since 1970. Dividing by 1000 transforms milliseconds to seconds.

Test Plan

I have added a test case that tests whether a notification scheduled with a Date trigger is triggered.

@sjchmiela sjchmiela marked this pull request as ready for review April 21, 2020 09:51
@sjchmiela sjchmiela requested a review from mczernek as a code owner April 21, 2020 09:51
@sjchmiela sjchmiela requested a review from byCedric April 21, 2020 09:51
@byCedric
Copy link
Member

Lgtm!

@sjchmiela sjchmiela merged commit e9988c1 into master Apr 21, 2020
@sjchmiela sjchmiela deleted the @sjchmiela/fix-ios-schedulenotificationasync-date branch April 21, 2020 11:26
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.

Notifications.scheduleNotificationAsync API trigger passing Date in iOS is not working
2 participants