Different messages be specified for each user#634
Closed
Phishion wants to merge 2 commits into
Closed
Conversation
…rder to set different message per user
Member
|
@Phishion This looks good, but it appears that the indentation is off. And can you update the readme with an example like the badge? |
jamaalscarlett
requested changes
Feb 24, 2022
jamaalscarlett
left a comment
Member
There was a problem hiding this comment.
I think this needs to be indented
The original code will prompt an indentation warning in my IDE (PyCharm), so I modified it, but both indentation can be run correctly, Readme I have written Well, after you pass, you can insert by yourself after line 413 of the current file (before "Firebase vs Google Cloud Messaging") ============================================================================================================ Similar to the above, It's also possible to pass message parameter as a function which accepts token parameter in order to set different message value per user. Assuming User model has a method get_message returning message for a user: .. code-block:: python devices.send_message( message=lambda token: APNSDevice.objects.get(registration_id=token).user.get_message() badge=5 )
Author
Hello, I have updated the indentation and added the description for readme, just contact me if you have any questions |
Member
|
@Phishion Can you add the description to the README.rst file? |
Author
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pass alert parameter as a function which accepts token parameter in order to set different message per user