ServicePattern / MobileAPI_Android

Messaging API library and example for Android mobile platform
1 stars 1 forks source link

Messages are not properly escaped #38

Closed bramley-stride closed 3 years ago

bramley-stride commented 3 years ago

When a support agent types:

firstline
soft break to second line

The text received in the app is: firstline<br>soft break to second line

When a support agent types: hello & world The text received in the app is: hello &amp; world

In both cases, the text received in the push notification text is correct.

When a support agent types: leading space (github isn't showing it, but there is a space before the letter l) The text received in the app is: &nbsp;leading space

When a user types

firstline
soft break to second line

The text shown to the agent is firstlinesoft break to second line

When a user types: hello & world The text shown to the agent is correct

ALobastov commented 3 years ago

Please, indicate the severity of the issue for WebJet and escalate to product management, if fix is required ASAP.

Technically, the server carries two versions of the message content - HTML version and text version. However the library only passes the HTML version ("First
Second") to the app and ignores the text version ("First\nSecond").

Same issue is present in the backward direction - the library only accepts one version and treats it as HTML version while the app actually sends text version.

The proposed solution is to extent the libraries (both iOS ad Android) to allow both text and HTML versions in both directions. Then the application will decide which version it will use (that depends on the UI capabilities - wether app can render HTML messages).

lachlan-mck-webjet commented 3 years ago

The severity of this is low. It can be fixed after launch

bramley-stride commented 3 years ago

@lachlan-mck-webjet has now requested that Android must render html marked-up messages from support agents (ie bold formatting). Therefore, this issue is now a blocker before we can go to store.

In android, it is simple for me to use textView.setText(Html.fromHtml(message)), if the message content can be changed to be html-formatted.

lachlan-mck-webjet commented 3 years ago

After subsiquent discussions the rendeing of bold text etc is NOT required, however the original issue of soft breaks remains to be resolved. On iOS soft breaks are supported, but Android they appear not to be supported. Thi is evidenced by the view a customer is displayed in the attached screen grab for iOS, but for Android this text is displayed as a continuous line of text. iOS_softbreak

ALobastov commented 3 years ago

Fixed in SDK 2.0.0.

Kagorius commented 3 years ago

Tested on BPcore version 5.6.0.60561 (stable) - fixed Checked (! "#;%:? * () _ + @ # $% ^ & <> / [] {} '~ -) displayed correctly Checked soft break - displayed correctly