1.4.13 • Published 9 months ago

react-native-trueconf-sdk v1.4.13

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

react-native-trueconf-sdk

Preview

iOS preview

TODO

Android preview

Android Preview

Getting started

$ npm install react-native-trueconf-sdk --save

or

$ yarn add react-native-trueconf-sdk

Then

$ cd ios && pod install

iOS

  1. Add the following code to Info.plist:
<dict>
  ...
  <key>NSCameraUsageDescription</key>
	<string>Need camera access to make calls</string>
	<key>NSMicrophoneUsageDescription</key>
	<string>Need microphone access to make calls</string>
  ...
</dict>

Android

  1. In MainApplication.kt add the following code:
import com.trueconf.sdk.TrueConfSDK

...

  override fun onCreate() {
    ...

    TrueConfSDK.getInstance().registerApp(this)
    TrueConfSDK.getInstance().setFallbackActivity(MainActivity::class.java)
  }
  1. In build.gradle add the following code with your TrueConf credentials:
buildscript {
    ext {
        ...
        trueConfSDKRepositoryUsername = "trueconfUsername"
        trueConfSDKRepositoryPassword = "trueconfPassword"
        ...
    }
    ...
}

apply from: file("../node_modules/react-native-trueconf-sdk/android/shared.gradle")

Usage

See example folder for usage example.

Methods

showCallWindow (Android only)

Brings up the TrueConf call screen.

trueConfRef.current?.showCallWindow()

Props

isFadeTransitionEnabled (Android only)

Enables or disables fade transition when call window hides.

To use fade out animation add this code to MainActivity.kt:

...
import android.content.Intent
...

class MainActivity : ReactActivity() {

  ...

  override fun onNewIntent(intent: Intent) {
    super.onNewIntent(intent)

    val isTrueConfSdkHideCallWindow:Boolean = intent.getBooleanExtra("isTrueConfSdkHideCallWindow", false)
    if (isTrueConfSdkHideCallWindow)
      overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out)
  }
}

Customization

Android

Colors

To customize colors of buttons etc add the following code to colors.xml:

<resources>
    ...
    <color name="tcsdk_button_background">#99FFFFFF</color>
    <color name="tcsdk_button_background_inactive">#26ffffff</color>
    <color name="tcsdk_button_background_hangup">#F57069</color>

    <color name="tcsdk_button_icon">#FFFFFF</color>
    <color name="tcsdk_button_icon_inactive">#99ffffff</color>

    <color name="tcsdk_call_background">#000000</color>
    <color name="tcsdk_self_view_background">#00FFFFFF</color>
    ...

TODO

Use this PR to dispatch events https://github.com/react-native-menu/menu/pull/749/files#diff-c1d10ac556f96ccfb6b02c68c77af8d0e24c0f45a40dcadc9e742fb3ab191af9

General

  • (planned: v3) Add react-navigation to example and more examples from TrueConf SDK Docs

Android

Notes

1.4.13

9 months ago