Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Custom Android Chat API & SDK. Android sample app with basic UI integrated with our latest SDK, enabling easy customization to build your own communication app.

NotificationsYou must be signed in to change notification settings

MirrorFly/MF-Android-UIKIT-SDK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 

Repository files navigation

UI-KIT SDKs for Android

With CONTUS MirrorFlyChat SDK for Android, you can efficiently integrate the desired real-time chat features into a client app.

When it comes to the client-side implementation, you can initialize and configure the uikitsdk with minimal efforts. With the server-side, MirrorFly ensures reliable infra-management services for the chat within the app. This page will let you know how to install the UI-KIT SDK in your app.

Note : If you're looking for the fastest way in action with CONTUS MirrorFlyChat SDKs, then you need to build your app on top of our sample version. Simply download the sample app and commence your app development. To download sample appclick here

Requirements

The requirements for UI-KIT SDK for Android are:

  • Android Marshmallow 6.0 (API Level 23) or above
  • Java 8 or higher
  • Gradle 4.1.0 or higher

Integrate the Chat SDK

Step 1: Create a new project or Open an existing project in Android Studio

Step 2: If using Gradle 6.8 or higher, add the following code to your settings.gradle file. If using Gradle 6.7 or lower, add the following code to your root build.gradle file. Seethis release note to learn more about updates to Gradle.

    dependencyResolutionManagement {        repositories {           jcenter()               maven {                 url"https://repo.mirrorfly.com/release"       }    }}

Step 3: Add the following dependencies in the app/build.gradle file.

dependencies {       implementation'com.mirrorfly.uikitsdk:mf-uikitsdk:1.0.37' }

Step 4: Add the below dependencies required by the SDK in the app module/build.gradle file.

 buildscript { dependencies {  classpath'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21'def nav_version="2.3.5"  classpath"androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"}}

Step 5: Add the below line in the gradle.properties file, to avoid imported library conflicts.

android.enableJetifier=true

Step 6: Open the AndroidManifest.xml and add below permissions.

<uses-permissionandroid:name="android.permission.INTERNET" />

Initialization

To integrate and run Mirrorfly UIKit in your app, you need to initialize it first.You can initialize the MirrorFlyUIKit instance by passing the MirrorFlyUIKitAdapter instance as an argument to a parameter in the MirrorFlyUIKit.init() method.The MirrorFlyUIKit.init() must be called once in the onCreate() method of your app’s Application instance.

Note: While registration, the belowregisterUser method will accept theFCM_TOKEN as an optional param and pass it across.

Step 1: Add the below line in the application class file.

packagecom.example.mfuikittestimportandroid.app.Applicationimportcom.mirrorflyuikitsdk.MirrorFlyUIKitimportcom.mirrorflyuikitsdk.adapter.MirrorFlyUIKitAdapterclassBaseApplication :Application() {overridefunonCreate() {super.onCreate()MirrorFlyUIKit.initFlySDK(applicationContext,object:MirrorFlyUIKitAdapter {overridefunsetAppName():String? {return"YOUR_APP_NAME"            }overridefunsetApplicationID():String? {return"YOUR_APPLICATION_ID"            }//Below override methods are optional used for customizationoverridefunisCallEnabled():Boolean? {returntrue            }overridefunisGroupEnable():Boolean? {returntrue            }overridefunisContactEnable():Boolean? {returntrue            }overridefunisLogoutEnable():Boolean? {returntrue            }overridefunisOtherProfileEnable():Boolean? {returntrue            }overridefunisOwnProfileEnable():Boolean? {returntrue            }overridefunsetGoogleTranslationKey():String? {return getString(R.string.google_key)            }overridefunonlyOnetoOneChat():Boolean? {returnfalse            }        })MirrorFlyUIKit.defaultThemeMode=MirrorFlyUIKit.ThemeMode.LightMirrorFlyUIKit.loginActivity="LoginActivity"::class.java    }}

Step 2: Add the below line in the Launcher class file.

classSplashTestActivity :AppCompatActivity() {overridefunonCreate(savedInstanceState:Bundle?) {super.onCreate(savedInstanceState)        setContentView(R.layout.activity_splash)MirrorFlyUIKit.initializeSDK(this@SplashTestActivity,SplashTestActivity::class.java,"YOUR_LICENCE_KEY",object:FlyInitializeSDKCallback{overridefunflyError(isSuccess:Boolean,throwable:Throwable?,data:HashMap<String,Any>            ) {//TODO Error Handling            }overridefunredirectToDashBoard(isSuccess:Boolean) {                startActivity(Intent(this@SplashTestActivity,MFUIDemoActivity::class.java))                finish()            }overridefunredirectToLogin(isSuccess:Boolean) {                startActivity(Intent(this@SplashTestActivity,MainActivity::class.java))                finish()            }        })            }}

Registration

MirrorFlyUIKit.initUser("USER_IDENTIFIER","FIREBASE TOKEN",object:InitResultHandler {overridefunonInitResponse(isSuccess:Boolean,e:String) {if (isSuccess) {Log.d("TAG","onInitResponse called with: isSuccess =$isSuccess")            }else {Log.e("TAG","onInitResponse called with: Failure, e =$e")            }        }    })

Display Recent Chat and Call list#

DashBoardActivity is the starting point for launching UIKit in your application. By implementing the code below, you will see a complete list of recent chats that you're made with single and group conversation.

importandroidx.appcompat.app.AppCompatActivityimportandroid.os.Bundleimportcom.mirrorflyuikitsdk.activities.DashBoardActivityclassMainActivity :DashBoardActivity() {// Add this line.overridefunonCreate(savedInstanceState:Bundle?) {super.onCreate(savedInstanceState)// If you’re going to inherit `DashBoardActivity`, don’t implement `setContentView()`    }}

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp