Skip to content

Different messages be specified for each user#634

Closed
Phishion wants to merge 2 commits into
jazzband:masterfrom
Phishion:master
Closed

Different messages be specified for each user#634
Phishion wants to merge 2 commits into
jazzband:masterfrom
Phishion:master

Conversation

@Phishion

Copy link
Copy Markdown

pass alert parameter as a function which accepts token parameter in order to set different message per user

@jamaalscarlett

Copy link
Copy Markdown
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 jamaalscarlett left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
	)
@Phishion

Copy link
Copy Markdown
Author

I think this needs to be indented

Hello, I have updated the indentation and added the description for readme, just contact me if you have any questions

@jamaalscarlett

Copy link
Copy Markdown
Member

@Phishion Can you add the description to the README.rst file?

@Phishion

Copy link
Copy Markdown
Author

@Phishion Can you add the description to the README.rst file?

The latest PR is here, this one will be closed.

This pull request was closed.
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