Skip to content

[Bugfix] Ensure notification payload is passed to completion handler#10860

Closed
npomfret wants to merge 1 commit intofacebook:masterfrom
npomfret:master
Closed

[Bugfix] Ensure notification payload is passed to completion handler#10860
npomfret wants to merge 1 commit intofacebook:masterfrom
npomfret:master

Conversation

@npomfret
Copy link
Copy Markdown
Contributor

@npomfret npomfret commented Nov 10, 2016

Fixes #10863

@facebook-github-bot
Copy link
Copy Markdown
Contributor

By analyzing the blame information on this pull request, we identified @JAStanton and @corbt to be potential reviewers.

@facebook-github-bot
Copy link
Copy Markdown
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at cla@fb.com. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact cla@fb.com if you have any questions.

}

[self sendEventWithName:@"remoteNotificationReceived" body:notification.userInfo];
[self sendEventWithName:@"remoteNotificationReceived" body:remoteNotification];
Copy link
Copy Markdown
Contributor

@JAStanton JAStanton Nov 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 this bug is result of a 9 month long PR with subtle refactors over long periods of time and not testing after each refactor. Thank you for catching this, I believe what you have here is correct

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. will it go into 38?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

¯_(ツ)_/¯ I'm a contributor not an owner, I don't have merge control :)

@hramos
Copy link
Copy Markdown
Contributor

hramos commented Nov 10, 2016

Can you describe what problem this PR is addressing?

@npomfret
Copy link
Copy Markdown
Contributor Author

Sure,

RN0.38 introduces a new feature that allows the user to call an iOS completion handler after processing a remote push notification. It's a great feature, without it there's no way to tell the OS that you've done the work to process a push notification. The OS will penalise your app and will eventually stop delivering push notifications.

I think some refactor wasn't quite tested and the push notification object that gets delivered to the RN app is of the wrong type. In dev mode you get a red error screen and the notification object doesn't have the expected data in it. Basically, all iOS remote push notifications are broken in 0.38-rc.

This fix results in the correct push notification object getting delivered to the app. Its just a one-liner - should be easy for someone to test.

@JAStanton
Copy link
Copy Markdown
Contributor

- should be easy for someone to test.
@npomfret have you tested this change to make sure it works after your change?

@hramos hramos changed the title fix body of remote push notifications [Bugfix] Ensure notification payload is passed to completion handler Nov 10, 2016
@npomfret
Copy link
Copy Markdown
Contributor Author

Yes i tested (of course!). Before the change, when an app receives a remote push notification you get a red error screen and the notification object delivered to the JS code doesn't contain the notification data. After the change it works as expected.

I just meant it would be easy someone else to check... my first rn PR you see.

@hramos
Copy link
Copy Markdown
Contributor

hramos commented Nov 10, 2016

No worries @npomfret, thanks for submitting the fix! We're just getting some more additional information to help us understand the scope and impact of the PR.

@hramos
Copy link
Copy Markdown
Contributor

hramos commented Nov 10, 2016

@facebook-github-bot shipit

@facebook-github-bot
Copy link
Copy Markdown
Contributor

I cannot do that @hramos, because @npomfret does not have an active CLA on file.

@hramos
Copy link
Copy Markdown
Contributor

hramos commented Nov 10, 2016

Ah - @npomfret - just one more thing to do before we can import this.

@JAStanton
Copy link
Copy Markdown
Contributor

@npomfret Thanks again, I feel foolish for letting this slip by, thanks for testing it and fixing it :)

@hramos
Copy link
Copy Markdown
Contributor

hramos commented Nov 10, 2016

Waiting on CLA to be signed before we can import this.

@npomfret
Copy link
Copy Markdown
Contributor Author

npomfret commented Nov 12, 2016

What's a CLA? Is there anything I need to do?

@ide
Copy link
Copy Markdown
Contributor

ide commented Nov 13, 2016

See the second reply: https://code.facebook.com/cla

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 13, 2016
@facebook-github-bot
Copy link
Copy Markdown
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@npomfret
Copy link
Copy Markdown
Contributor Author

Hi, I just checked the 38 branch and this PR still isn't present. Was wondering if there's a hold-up. Is there anything else I need to do to get it in there?

(Sorry, not familiar with the workflow here yet)

@grabbou
Copy link
Copy Markdown
Contributor

grabbou commented Nov 23, 2016

Nope @npomfret, cherry-picking it now and releasing stable :)

grabbou pushed a commit that referenced this pull request Nov 23, 2016
Summary:
Fixes #10863
Closes #10860

Differential Revision: D4175834

Pulled By: hramos

fbshipit-source-id: 5cf317eb675528c647425c70eff939a9db9728fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants