zetakit_reactnative
v0.1.0
Published
Zeta Global React Native SDK
Maintainers
Readme
zeta-reactnative-sdk
The Zeta React Native plugin enables developers to integrate Zeta's services seamlessly into your React Native applications.
It provides a simple, reliable, and efficient way to access Zeta APIs and build robust cross-platform apps for iOS and Android.
##What's Inside/ Key Offerings
- Easy integration with Zeta APIs
- Cross-platform support (iOS & Android)
- React Native package over iOS SDK 0.1.7 & Android SDK 0.1.7
- Install and initialise the Zeta SDK
- User identification
- Event tracking
- Location tracking
- Push notification Handling
- In-App messaging
- Opt-in/out for tracking
SDK Support and Compatibility
React Native version: 0.76 and above.
iOS
- Minimum deployment target: iOS 15.1+
Android
- Minimum supported version: Android 7.0 (API level 24)
- Set
minSdkVersionto 24 or higher in yourandroid/app/build.gradlefile - Make sure your Android project has Google Play Services and Firebase Messaging set up if you are using push notifications with React Native SDK
Installation
Install the plugin using yarn or npm:
yarn add 'zetakit_reactnative'
Installation
npm install zetakit_reactnative
or
yarn add zetakit_reactnativeHow to install the Zeta Core React Native module.
Requirements
React Native >= 0.76.0 Create React Native Library >= 0.48.3
iOS
minimum deployment target iOS 15.1+
Android
minimum deployment target Android 7 (24+)
Standard React Native Setup
Install the plugin using yarn or npm:
yarn add 'zetakit_reactnative'
Installation
npm install zetakit_reactnative
or
yarn add zetakit_reactnativeUsage
import ZetaCore from 'zetakit_reactnative';
// ...
const config = { "isLoggingEnabled": true, "clientSiteId": "your_client_site_id", "clientSecret": "your_client_secret", "region": "US", "appGroupId": "app_group_id", "optIn": true, "appEnvironment": "PRODUCTION" }
ZetaCore.initialize(config, () => { })Setting User Details with Additional Properties
const userObject = {
"firstName": "John",
"lastName": "Doe",
"uid": "123",
"email": {
"email": "[email protected]"
},
"additionalProperties": {
"custom_field1": "custom value"
}
}
ZetaCore.build(userObject)Push Notification Management
Device token update
```js
ZetaCore.updateDeviceToken("my Device Token")
```
Note:
ios: Native iOS SDK methods are required to set up push notifications in the React Native app’s
More info: https://docs.zetaglobal.com/docs/ios-mobile-sdk-017-documentation#push-notification
android: If the application is not using a custom service, the SDK will automatically capture the device token. If the application wants to override the default behavior of the push notification channel, native SDK setup is required at the Android app level. In that case, the push notification channel should be configured in the Application.onCreate method
More info: https://docs.zetaglobal.com/docs/ios-mobile-sdk-017-documentation#push-notification