Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@talkjs/react-native
Advanced tools
Official TalkJS SDK for React Native
TalkJS is a developer friendly chat API with a pre-built UI that is highly customisable. You can build a chat feature in minutes instead of months.
With TalkJS, you can create chat features that boost user engagement, retention, and conversion rate.
Don't hesitate to let us know if you have any questions about TalkJS.
Note: React Native CLI does not autolink libraries with native modules when those libraries are transitive dependencies. So you have to explicitly install the SDK's peer dependencies as shown below for the native modules to be loaded correctly
Npm:
npm install @talkjs/react-native @notifee/react-native @react-native-community/push-notification-ios @react-native-firebase/app @react-native-firebase/messaging react-native-webview
Yarn:
yarn add @talkjs/react-native @notifee/react-native @react-native-community/push-notification-ios @react-native-firebase/app @react-native-firebase/messaging react-native-webview
You can import the library in one of the following ways:
ES6 / TypeScript:
import * as TalkjsRn from '@talkjs/react-native';
CommonJS:
const TalkjsRn = require('@talkjs/react-native');
Then follow our React Native guide to start using TalkJS in your project.
We promise to never break API compatibility. We may at times deprecate methods or fields, but we will never remove them. If something that used to work stops working, then that's a bug. Please report it and we'll fix it asap.
The package is being released in a beta state. The reason for this is that there are things that one can do with the TalkJS JavaScript SDK that aren't possible with the React Native SDK. We will release v1.0.0 of this package once the two SDKs are similar in terms of features. This however does not take away from our commitment to always maintain backward compatibility. So you can be assured that the package is stable for production use.
Note: These are only the changes that have an effect on the React Native package and its interface. TalkJS gets many improvements and fixes all the time. Consider subscribing to our changelog if you want to stay updated.
scrollToMessage
prop to the Chatbox
component.token
and tokenFetcher
props to Session. These props are part of our efforts at impoving identity verification and authentication.See the reference documentation for full details on the technical requirements for the JSON Web Token(JWT).
signature
prop on the Session component.disableZoom
prop to Chatbox
and ConversationList
. This allows you to choose whether the user
can pinch to zoom in and out of the UI. By default its value is false
and the usr can zoom into the UI.MessageField
methods.getNotificationHandler
being undefined.ConversationList
no longer highlights the first conversation by default.onMessage
and onUnreadsChange
props to Session
component.hasValidCredentials
, clearPushRegistration
, setPushRegistation
and unsetPushRegistration
methods to
Session
component.AndroidChannel
and IOSPermissions
interfaces to AndroidSettings
and IOSSettings
respectively.Session
when user synchronization is disabled.MessageField.setText
and MessageField.typeText
that would cause a crash given certain strings.HTMLPanel
not loading.onSelectConversation
prop is not given. Previously, in this scenario, clicking on a conversation
would result in nothing happening. Now, the conversation will be selected and the TalkJS Inbox Mobile view
will be shown.onSelectConversation
in ConversationList
.onLeaveConversation
, onCustomMessageAction
and onCustomConversationAction
props. These are intended to replace
the methods with the same names. The methods have been deprecated. This change was made to ensure that this SDK's interface
matched the React SDK's
.off
method in both Chatbox
and ConversationList
.View
will be used in the empty areas around the TalkJS UI.getCurrentConversation
, onCustomConversationAction
, onLeaveConversation
and sendLocation
methods to Chatbox
.leave
method to ConversationBuilder
.Chatbox
and ConversationList
.conversation
property in SelectConversationEvent
from ConversationBuilder
to ConversationData
.isForegroundEvent
property to NotificationPressedEvent
to indicate if the user pressed the notification while the app was in the foreground or background.
NOTE: In iOS this property is always true since, if the app was in the background, iOS will open the app first before calling the foreground event handler.
The background event handler is never called in iOS in this case.Cannot assign to property '_injectJavaScript' which has only a getter
or
Attempted to assign to readonly property
when using React Native version 0.70 and below.Error: No Firebase App '[DEFAULT]' has been created - call firebase.initializeApp()
in Android when attempting to use the
SDK without enabling push notifications. With this fix, you no longer need to setup Firebase plugins in gradle if you
don't intend to use push notifications@react-native-async-storage/async-storage
as a peer dependency.
If you don't already depend on the package be sure install it by running: npm install @react-native-async-storage/async-storage
or yarn add @react-native-async-storage/async-storage
depending on your package managerChatbox
and ConversationList
and it will be shown when
the respective components are loading the UI. This is mostly useful on first load. Subsequent loads of the
UI components are much faster.onTokenRefresh
and onNotificationPressed
methods to NotificationHandler
.getNotificationHandler
function.registerPushNotificationHandlers
now returns Promise<NotificationHandler>
instead of Promise<void>
.sendMessage
where a message would get sent multiple times in certain scenarios.captureKeyboardEvents
prop in Chatbox
not working.This is a minor update ensuring a great user experience when using voice messages, particularly on iOS.
To enable voice messages, you'll need to first enable it per role in the TalkJS dashboard. Then you'll need to specify the necessary permissions for both Android and iOS.
For Android, add the following to your AndroidManifest.xml
file:
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
For iOS, add the following to your Info.plist
file:
<key>NSMicrophoneUsageDescription</key>
<string>Messages shown to your user when the microphone is accessed for the first time</string>
Fix mark as read. This release ensures that messages are marked as read reliably as long as the chat is visible. If the app is in the background, or the chat is covered by the System UI (example: when receiving a call) then the messages won't be marked as read.
Fix rare crash on Android for SDK 28+ when the @react-navigation/native library is used.
With this release, we have updated the SDK's dependencies and peer dependencies to keep them up to date and also fix bugs in some of them.
As of npm v7, peer dependencies are installed by default so upgrading the TalkJS SDK should also upgrade the peer dependencies accordingly. For yarn users, you may have to update the packages individually as shown:
yarn upgrade @notifee/react-native@^5.3.0 @react-native-community/push-notification-ios@^1.10.1 @react-native-firebase/app@^14.11.0 @react-native-firebase/messaging@^14.11.0 react-native-webview@^11.21.2
These libraries are defined as peer dependencies rather than dependencies since they contain native code and currently, React Native does not auto link transitive dependencies.
The new version of the notifee library also eliminates the need to add the local maven repository manually to your project. You can remove the section below. (Your app will still build and run if you don't remove it)
maven {
url "$rootDir/../node_modules/@notifee/react-native/android/libs"
}
To ensure the SDK's peer dependencies' native modules are loaded correctly, you have to explicitly install them as direct dependencies for your app/project. This is to ensure React Native CLI can autolink them. Below is how you'd accomplish that:
NPM:
npm install @notifee/react-native @react-native-community/push-notification-ios @react-native-firebase/app @react-native-firebase/messaging react-native-webview
Yarn:
yarn add @notifee/react-native @react-native-community/push-notification-ios @react-native-firebase/app @react-native-firebase/messaging react-native-webview
When upgrading to this version, you'll need to update your android/build.gradle
file by adding the
following block to the repositories section of allprojects:
allprojects {
// ... you may have other items before the "repositories" section.
repositories {
// ... you will already have some local repositories defined ...
// ADD THIS BLOCK
maven {
url "$rootDir/../node_modules/@notifee/react-native/android/libs"
}
}
}
asGuest
prop in Chatbox.captureKeyboardEvents
and onKeyup
props.getText
and
typeText
to MessageField.oneOnOneId
to also accept User
Objects.registerPushNotificationHandlers
to add support for iOS Permissions.showFeedHeader
default to false
.feedConversationTitleMode
, thirdParties
, onBlur
and onFocus
.chatSubtitleMode
, chatTitleMode
, thirdParties
, translateConversations
, onBlur
and onFocus
.FAQs
Official TalkJS SDK for React Native
The npm package @talkjs/react-native receives a total of 221 weekly downloads. As such, @talkjs/react-native popularity was classified as not popular.
We found that @talkjs/react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.