ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
124 stars 111 forks source link

I can't send message if add emoji #32

Closed iKronyck closed 4 years ago

iKronyck commented 4 years ago

I have a problem when send emoji in chat, this problem present if the user send iOS icon or if use the library node-emoji

i received this error: The string to be encoded contains characters outside of the Latin1 range

Any solutions for this?

i'm use: Device: Iphone 11 Simulator react-native 0.60.5 connectycube-reactnative: 1.8.1 node-emoji: 1.10.0

Eramirez06 commented 4 years ago

same issue here, please provide a solution for this

ccvlad commented 4 years ago

The screenshot from iPhone Simulator (emoji from iOS keyboard works well): Screenshot 2020-01-28 at 12 06 28

Is it error of the 'node-emoji' or from the 'connectycube-reactnative'? It isn't clear where the issue is. Could you provide detailed log?

iKronyck commented 4 years ago

Sorry, the problem stay when send the push notification to other user and this ocurred for to conver base64Encode.

This is the response obtained in catch

Captura de Pantalla 2020-01-28 a la(s) 09 36 19

This is my code for send message and push notification:

carbon

DaveLomber commented 4 years ago

@iKronyck btw there are automatic push notifications to offline users when you send a message

it can be enabled at Admin panel, Chat module, Offline Notifications -> ENABLE AUTOMATIC NOTIFICATIONS FOR OFFLINE USERS IN CHAT

so you do not need to initiate them by yourself

can it work for you?

Eramirez06 commented 4 years ago

Any way to send the emoji from my app? without activate that fuction?

ccvlad commented 4 years ago

The problem with ConnectyCube.pushnotifications.base64Encode(emoji). Try to use custom method to encode emojies to base64 until we will check it.

Eramirez06 commented 4 years ago

but how to send the push without ConnectyCube.pushnotifications.base64Encode(emoji) is there any way to send the message if a dont add base64Encode or i just delete the parse from function base64Encode in lib?

DaveLomber commented 4 years ago

Hi @Eramirez06 what @ccvlad is proposing is to try a diff lib/method to get base64 data in ReactNative

there are many libs in RN to do so, so please just try any other e.g. this one or similar

https://github.com/eranbo/react-native-base64

ConnectyCube.pushnotifications.base64Encode(emoji) is just a wrapper around base64 logic, nothing more. So we are going to check its implementation and provide an update soon. Meanwhile just try another base64 method

Eramirez06 commented 4 years ago

ok understood thanks i'll be checking this for update and absolutely thanks for the support guys

DaveLomber commented 4 years ago

Hi @Eramirez06 @iKronyck

Please find React Native SDK 2.1.7 with the mentioned issue addressed

https://www.npmjs.com/package/react-native-connectycube/v/2.1.7

Please let us know if there is something else is required in our attention

Thank you!