Skip to main content

Installation

Run the below code to install the react native

Android

To install the React Native in Android perform the below steps:

Android Configuration

Step 1: In android/app/build.gradle:
Step 2: In android/app/src/main/AndroidManifest.xml:
Step 3: Change theme in android/app/src/main/res/values/styles.xml:
Our SDK is using Material components so in order to use our sdk you need to use material theme as shown in below example
Step 4: Create android/app/proguard-rules.pro, add the following lines:
Want to override our default loader?We are using lottie animation for our loader. You can put your custom lottie animation loader with the name loader_mix.json in the android/app/src/main/res/raw folder. Make sure you use the same name as provided.

Quick Start

1. Initialize SDK
2. Handling Deeplink To handle deep link place the below code in android/app/src/main/AndroidManifest.xml file:
3. Handling Push Notifications To handle the push notification place the below code In android/app/build.gradle file:

iOS

iOS Configuration

1. In ios/Podfile

Quick Start

1. Initialize SDK
If your project has AppDelegate.swift file create the following wrapper classes in Objective-C in order to communicate with genuin’s react-native module,
  1. GenuinModuleObjCWrapper.h
  1. GenuinModuleObjCWrapper.mm
  1. YourApp-Bridging-Header.h
2. Handling Deep Link To handle deeplink place the below in AppDelegate.swift file: Prerequisite step : Link In AppDelegate.swift:
3. Handling Push Notification To handle the push notification place the below code In AppDelegate.swift file:

Web

Web Configuration

To integrate the genuin-react-native SDK into your application, follow these steps:
  1. Import the Feed Component: In your app.jsx file, import the Feed component from the genuin-react-native SDK.
  2. Obtain Your API Key: Contact the Genuin team to obtain your unique API_KEY. This key is essential for authenticating your application with the Genuin service.
  3. Implement the Feed Component: Use the Feed component within your application, passing the API_KEY as a prop. Below is an example of how to implement this:
Carousel
javascript
Example Here’s a complete example of how your app.jsx file might look:
Additonal Information Handling Errors Ensure you handle any potential errors gracefully. The Feed component can throw errors if the API key is invalid or if there are network issues. Implement error handling in your component as needed. Styling the Feed You can style the Feed component using standard React Native styling techniques. Customize it to fit the design and aesthetics of your application. Updating the API Key If you need to update your API key, simply modify the apiKey prop passed to the Feed component. Ensure your application is reloaded to apply the changes.

React Native

1. Load Carousel Embed View
Note: 1. You can set height and width of the Carousel as per your need. 2. You can use carouselRef.current?.pause() and carouselRef.current?.resume() for pause and resume video play in Carousel.
To configure the EmbedParams based on your need you can pass the below values. embedId = The Embed Id that you want to load. uniqueId = This is an optional parameter. This uniqueId is used when we need to display same embed in multiple/same screen. We need to provide uniqueId for the same embedId in multiple/same screen. ssoToken = This is an optional parameter. To auto login in the SDK, you shall pass “YOUR_SSO_TOKEN” in order to implement Embed with SSO in your app. interactionDeepLink = This is an optional parameter. You can pass a deeplink URL in this parameter. If a deeplink URL is given then all the interaction/clicks in the full screen view will redirect to the deeplink URL given. If not passed then the regular flow will work. It should be a correct URL else user will not be redirected. isDirectDeepLinkEnabled = This is an optional boolean parameter. Default value is false. If this parameter is true then all the interaction/clicks in the full screen view will redirect to the specific video in white labelled app associated with video and also value of this parameter “interactionDeepLink” will be ignored. If not passed then the regular flow will work.
Note: For using isDirectDeepLinkEnabled parameter, you must have white labelled your domain first and also integrated the Handling deep link part in your main app in which you want to redirect this video to.
isShowProfileEnabled = This is an optional boolean parameter. Default value is false. If this parameter is true and also if user is logged in than Profile picture will be visible in full screen view (right side top corner). On clicking the profile picture user will see the account settings and logout options. 2. Load Standard Wall Embed View
Note: 1. You can set height and width of the StandardWall as per your need. 2. You can use standardWallRef.current?.pause() and standardWallRef.current?.resume() for pause and resume video play in StandardWall.
To configure the EmbedParams based on your need you can pass the below values. embedId = The Embed Id that you want to load. uniqueId = This is an optional parameter. This uniqueId is used when we need to display same embed in multiple/same screen. We need to provide uniqueId for the same embedId in multiple/same screen. ssoToken = This is an optional parameter. To auto login in the SDK, you shall pass “YOUR_SSO_TOKEN” in order to implement Embed with SSO in your app. interactionDeepLink = This is an optional parameter. You can pass a deeplink URL in this parameter. If a deeplink URL is given then all the interaction/clicks in the full screen view will redirect to the deeplink URL given. If not passed then the regular flow will work. It should be a correct URL else user will not be redirected. isDirectDeepLinkEnabled = This is an optional boolean parameter. Default value is false. If this parameter is true then all the interaction/clicks in the full screen view will redirect to the specific video in white labelled app associated with video and also value of this parameter “interactionDeepLink” will be ignored. If not passed then the regular flow will work. Note: For using isDirectDeepLinkEnabled parameter, you must have white labelled your domain first and also integrated the Handling deep link part in your main app in which you want to redirect this video to. isShowProfileEnabled = This is an optional boolean parameter. Default value is false. If this parameter is true and also if user is logged in than Profile picture will be visible in full screen view (right side top corner). On clicking the profile picture user will see the account settings and logout options. 3. Load FullScreen Embed View
Note: 1. You can set height and width of the Feed as per your need. 2. You can use feedRef.current?.pause() and feedRef.current?.resume() for pause and resume video play in Feed.
To configure the EmbedParams based on your need you can pass the below values. embedId = The Embed Id that you want to load. uniqueId = This is an optional parameter. This uniqueId is used when we need to display same embed in multiple/same screen. We need to provide uniqueId for the same embedId in multiple/same screen. ssoToken = This is an optional parameter. To auto login in the SDK, you shall pass “YOUR_SSO_TOKEN” in order to implement Embed with SSO in your app. interactionDeepLink = This is an optional parameter. You can pass a deeplink URL in this parameter. If a deeplink URL is given then all the interaction/clicks in the full screen view will redirect to the deeplink URL given. If not passed then the regular flow will work. It should be a correct URL else user will not be redirected. isDirectDeepLinkEnabled = This is an optional boolean parameter. Default value is false. If this parameter is true then all the interaction/clicks in the full screen view will redirect to the specific video in white labelled app associated with video and also value of this parameter “interactionDeepLink” will be ignored. If not passed then the regular flow will work. Note: For using isDirectDeepLinkEnabled parameter, you must have white labelled your domain first and also integrated the Handling deep link part in your main app in which you want to redirect this video to. isShowProfileEnabled = This is an optional boolean parameter. Default value is false. If this parameter is true and also if user is logged in than Profile picture will be visible in full screen view (right side top corner). On clicking the profile picture user will see the account settings and logout options. 4. Load HomeFeed View(Android Specific)
Note: 1. You can set height and width of the HomeFeed as per your need. 2. You can use homeFeedRef.current?.pause() and homeFeedRef.current?.resume() for pause and resume video play in HomeFeed.
5. Handling Push Notifications Prerequisite: Create firebase project and integrate into your app by following https://firebase.google.com/docs/flutter/setup Step1: Create firebase_options.dart in lib folder and add below details in that file.
Step 2: Handling background/foreground notifications Note: Here for Android you need to provide small notification icon as “icon” key for foreground notifications. This icon needs to be in your flutter as well as android folder.
5. Handle SSO Login Explicitly in SDK To Auto Login in the SDK, You need to call below method, whenever user is log in to your application.
Note: You don’t need to call the below method if you have implemented the Embed With SSO already.
6. Handle SSO Logout in SDK

Support

For further assistance with integrating the genuin-react-native SDK, please contact the Genuin support team or refer to the official documentation. The Genuin team is available to help you with any issues or questions you might have during the integration process.