This is a simple React Native demo application that showcases how to use the Dixa Messenger SDK. For detailed documentation, visit Dixa Messenger Docs in Dixa Developer Hub.
To run this demo locally, you will need:
-
Admin access to a Dixa organization. If you don't have access, contact Dixa to get it.
-
A Dixa Messenger Token. Obtain it from your Dixa organization by navigating to Settings -> Messenger -> Edit the Appearance & Setup -> Setup -> Mobile -> Copy Messenger Token. For more details, see the documentation.
💡Note: Java 17 is required to build and run on Android and Android API level 23 (Android 6.0 - Marshmallow)
-
Ensure React Native is set up. Refer to the React Native documentation for environment setup for details.
-
Clone this project and run
npm install
to install dependencies. -
Configure the Dixa SDK in the
OnCreate
method of your Application class. See MainApplication.kt for more details.DixaMessenger.Configuration config = new DixaMessenger.Configuration.Builder() .setApiKey("<YOUR_DIXA_MESSENGER_TOKEN>") .setLogLevel(LogLevel.ALL) .build();
-
To build and launch the Android demo app, run
npx react-native run-android
.
-
Ensure React Native is set up. Refer to the React Native documentation for environment setup for details.
-
Clone this project and run
npm install
to install dependencies. -
Run
bundle install
to install gems, includingcocoapods
. -
Navigate to the
ios
directory and runpod install
to install the required CocoaPods for this SDK. -
Open the
.xcworkspace
file located in thedixa-messenger-react-native-demo/ios
directory with Xcode. -
In Xcode, add a package dependency to your project using the URL https://github.com/dixahq/ios-messenger with the Swift Package Manager. For guidance, refer to Managing Package Dependencies with Swift Package Manager in Xcode.
-
Configure the Dixa SDK in the
didFinishLaunchingWithOptions
method of your AppDelegate class. See AppDelegate.mm for more details.[Messenger configureWithMessengerToken: @"<YOUR_DIXA_MESSENGER_TOKEN>" logLevel:3 ];
-
To build and launch the iOS demo app, run
npx react-native run-ios
.