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

Different messages be specified for each user #634

Closed
wants to merge 2 commits into from
Closed

Different messages be specified for each user #634

wants to merge 2 commits into from

Conversation

Phishion
Copy link

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

@jamaalscarlett
Copy link
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?

Copy link
Member

@jamaalscarlett jamaalscarlett left a comment

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
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
Member

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

@Phishion
Copy link
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