Here you can find simple way of implementing Hengam SDK using React Native for android and iOS(coming soon).
This guide assumes that you've already followed the prerequisites.
Installation on your project¶
Add the Hengam SDK to your project using the command below in the command line.
npm i -P hengam-react-native
If the npm is not a valid command, you should refer to the ReactNative documentation to fix the problem.
If you are using react native 0.59 or older, you need to link SDK, manually
react-native link hengam-react-native
to use the this module you can import Hengam class like bellow.
import Hengam from "hengam-react-native";
Android Specific Instructions¶
Go to Hengam dashboard and get the manifest content and add it to your project
The application manifest file is available at the following address:
The manifest will be a tag like this:
<meta-data android:name="hengam_token" android:value="HENGAM_TOKEN" />
HENGAM_TOKENis a sample. Replace it with your own token which is a unique token, available in Hengam dashboard for your app.
Test & Diagnosis¶
After running the application, you should see the following logs in Android logcat (this may take a few seconds due to the connection to the server):
Hengam initialization complete
Logcat is available on Android Studio. If you are using other tools like VSCode you can use any method to view the log. Android documentation for Logcat
You can apply the Hengam filter to the logs for a better view.
iOS Specific Instructions¶
Check for Registering Device installation¶
- Run and install your app on a test device or emulator that has google-play-service installed.
- Make sure your device is connected to internet.
- Open the app and wait until your installation is received by the hengam. We will send you a notification and an email whenever we receive the first installation.
Too long? check the troubleshooting section. Your problem may be found there.