Android SDK
Genuin Android SDK comprises features such as brand feed, communities, and groups.
Requirements
Platform | Minimum SDK Version | Language | Supported Orientations | Supported Destinations |
---|---|---|---|---|
Android | 24 | Java/Kotlin | Portrait | Mobile |
Installation
1. Add repo details in project level gradle
2. Add dependency in app level gradle
3. Add permissions to AndroidManifest.xml
Mandatory Permissions
Following permissions are optional and can be added in AndroidManifest.xml
file as per feature requirements:
- To allow user to Create Video Content, Camera and Mic permissions are needed:
- To allow user to Upload Content from their gallery
- To allow user to add their Contacts as Members in Communities and Groups:
- To allow user to receive Push Notifications:
- To allow creation of AI Powered Communities based on the User Location:
- To enhance the Ad experience of the user:
4. Initialize SDK
5. Load SDK in seperate activity
6. Load SDK in your custom activity
Put below code in activity_custom.xml
file
Put below code in CustomActivity.kt
file
adjustPan
for better performance 7. Load SDK with bottom navigation and fragment
Add below code in res/navigation/mobile_navigation.xml
Add below code in your activity
8. 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 res/raw
folder. Make sure you use the same name as provided.
<application>
tag, set android:allowBackup="false"
Embed
Carousel Embed
1. Load Carousel Embed with XML
2. Load Carousel Embed Programmatically
(setActivity(activityContext))
in which you want the embed. To auto login in the SDK, you shall pass “YOUR_SSO_TOKEN”(setSSOToken("YOUR_SSO_TOKEN"))
in order to implement Embed with SSO in your app. 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.
-
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.
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.
Add user specific params while performing sso login (Optional)
a. name - This is an optional string parameter. Pass this parameter for signup/login
.
b. mobile - This is an optional string parameter. Pass this parameter for signup/login
.
c. email - This is an optional string parameter. Pass this parameter for signup/login
.
d. nickname - This is an optional string parameter. If nickname is available in genuin ecosystem it will be used, else genuin will generate of its own.
e. profile_image: This is an optional string parameter. Pass the profile_image
parameter if you want to show the profile image in the SDK.
3. Manage carousel videos auto-play
Full Screen Embed
Put below code in activity_full_embed.xml
file
Put below code in FullEmbedActivity.kt
file
We need to pass below arguments in order to cofigure FullScreenEmbed
.
-
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.
-
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.
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.
-
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.
-
Add user specific params while performing sso login (Optional)
a.name - This is an optional string parameter. Pass this parameter for signup/login
.
b.mobile - This is an optional string parameter. Pass this parameter for signup/login
.
c.email - This is an optional string parameter. Pass this parameter for signup/login
.
d. nickname - This is an optional string parameter. If nickname is available in genuin ecosystem it will be used, else genuin will generate of its own.
e. profile_image: This is an optional string parameter. Pass the profile_image
parameter if you want to show the profile image in the SDK.
Standard Wall Embed
Put below code in activity_standard_wall_embed.xml
file
Put below code in StandardWallEmbedActivity.kt
file
We need to pass below arguments in order to cofigure StandardWallEmbed
.
-
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.
-
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.
-
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.
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.
-
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.
-
Add user specific params while performing sso login (Optional)
a.name - This is an optional string parameter. Pass this parameter for signup/login
.
b.mobile - This is an optional string parameter. Pass this parameter for signup/login
.
c.email - This is an optional string parameter. Pass this parameter for signup/login
.
d. nickname - This is an optional string parameter. If nickname is available in genuin ecosystem it will be used, else genuin will generate of its own.
e. profile_image: This is an optional string parameter. Pass the profile_image
parameter if you want to show the profile image in the SDK.
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.
Optional Parameters
Below are the optional parameters you can add with the function:
Add user specific params while performing sso login (Optional)
- name - This is an optional string parameter. Pass this parameter for ‘
signup/login
’. - mobile - This is an optional string parameter. Pass this parameter for
signup/login
. - email - This is an optional string parameter. Pass this parameter for
signup/login
. - nickname - This is an optional string parameter. If nickname is available in genuin ecosystem it will be used, else genuin will generate of its own.
- profile_image: This is an optional string parameter. Pass the
profile_image
parameter if you want to show the profile image in the SDK.
Custom Login
If you want to handle login process as per your requirement then follow the below steps:
Handle SSO Logout in SDK
Whenever user logs out from your application call the below method.
Handling Deep Link
Prerequisite:
-
Make sure you have white labelled your community by following these steps.
-
Follow the steps given in the below URL to integrate deeplink in your app https://developer.android.com/studio/write/app-link-indexing
- After completing deeplink setup, your
assetlinks.json
file should look like below
- Host
assetlinks.json
file on the white labeled domain athttps://YOUR_WHITE-LABELLED_DOMAIN/.well-known/assetlinks.json
To Handle Our Deep Link In Your App
You can call the below method immediately after receiving deeplink or you can wait until your app’s home screen is loaded.
Handling Push Notifications
Prerequisite:
-
Create an app in your firebase using these steps
-
Download the
google-services.json
file and add it into your app. -
Integrate firebase into your app by following these steps
Get firebase token and register it with Genuin SDK
Handle foreground notifications (When your app is in foreground)
GenuinSDK.willHandleForegroundNotification(data: Map<String, String>)
function will check whether GenuinSDK will handle the given notification or not when app is in foreground. Handle notifications while app is running in background or closed
- Whenever user clicks on notifications, you will get the notification payload in your launcher activity.
GenuinSDK.willHandleNotification(intent: Intent)
function will check whether GenuinSDK will handle the given notification or not. What’s next?
iOS SDK
Integrate iOS SDK in Your ecosystem.
Web SDK
Integrate Web SDK in your ecosystem.
React Native SDK
Integrate React Native SDK in your ecosystem.
Support
If you need any assistance or have any questions, feel free to email us at support@begenuin.com.
Was this page helpful?