Skip to content

Clarify string encoding when sending push notifications #119

@funkyboy

Description

@funkyboy

Customer reported that some fields of push notifications (e.g. values _loc-key_ and _title-loc-key_) where received base64-encoded on iOS. Using our Python SDK (1.0.1) and Python 2.7

The issue was that they were sent like

'alert': {
  'title-loc-key': '{}-{}-NOTIFICATION-TITLE'.format(item_type, event).upper(),
  ...
}

whereas in Python 2 it should be

'alert': {
  'title-loc-key': u'{}-{}-NOTIFICATION-TITLE'.format(item_type, event).upper(),
  ...
}

so that the u makes sure the content is a unicode string.

While this is something that Python devs usually know, I think it's worth a mention in the README and the documentation about push notifications (when we'll write it).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or improved functionality.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions