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

Add support for ios background events #55

Open
howieweiner opened this issue Mar 1, 2023 · 0 comments
Open

Add support for ios background events #55

howieweiner opened this issue Mar 1, 2023 · 0 comments

Comments

@howieweiner
Copy link

According to the expo.dev docs, in order to handle notifications in the background on iOS, it is necessary to send the following addtional data in the payload:

"content-available": 1

I am currently achieving this by extending the PushMessage class as described in the code:

class ExpoPushMessage(PushMessage):
    def get_payload(self):
        """
        Override the get_payload method to add the content-available flag
        :return:
        """
        payload = super().get_payload()
        payload["content-available"] = 1
        return payload

I imagine that many expo-notification users would like to process background events, so the addition of another attribute would be beneficial.

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

1 participant