Class InitParams

  • All Implemented Interfaces:

    
    public final class InitParams
    
                        

    SDK initialization parameters.

    Contains required and optional configuration for SDK initialization. Required parameters are passed via the constructor; optional parameters are set via properties using the builder-style apply block.

    // Basic usage (required parameters only)
    val params = InitParams(context, "your-app-key")
    
    // With optional configuration
    val params = InitParams(context, "your-app-key").apply {
        logLevel = LogLevel.DEBUG
        naviServer = "nav.custom-server.com"
        areaCode = AreaCode.SG
    }
    
    NCEngine.initialize(params)
    • Constructor Detail

      • InitParams

        InitParams(<Error class: unknown class> context, String appKey)
    • Method Detail

      • getAreaCode

         final AreaCode getAreaCode()

        Area code. Default is AreaCode.SG.

        Select the appropriate area code based on the actual data center location.

      • getNaviServer

         final String getNaviServer()

        Custom navigation server URL (for private cloud).

        Default is null, which uses the SDK's built-in navigation server. Must be a valid URL if set:

        • HTTPS: https://host:port or https://host (default port 443)

        • HTTP: host:port or host (default port 80)

      • setNaviServer

         final Unit setNaviServer(String naviServer)

        Custom navigation server URL (for private cloud).

        Default is null, which uses the SDK's built-in navigation server. Must be a valid URL if set:

        • HTTPS: https://host:port or https://host (default port 443)

        • HTTP: host:port or host (default port 80)

      • getEnablePush

         final Boolean getEnablePush()

        Whether to enable push notifications. Default is true.

        When set to false, the SDK will not register or handle push-related logic.

      • setEnablePush

         final Unit setEnablePush(Boolean enablePush)

        Whether to enable push notifications. Default is true.

        When set to false, the SDK will not register or handle push-related logic.

      • getEnableSyncEmptyTopConversation

         final Boolean getEnableSyncEmptyTopConversation()

        Whether to sync empty pinned channels. Default is false.

        When set to true, the SDK will sync pinned channels even if they have no messages.

      • setEnableSyncEmptyTopConversation

         final Unit setEnableSyncEmptyTopConversation(Boolean enableSyncEmptyTopConversation)

        Whether to sync empty pinned channels. Default is false.

        When set to true, the SDK will sync pinned channels even if they have no messages.

      • getCompressOptions

         final CompressOptions getCompressOptions()

        Media compression options for images and short videos.

        Controls how images and short videos are compressed before sending. Default is null, which uses built-in SDK defaults.

        val params = InitParams(context, "your-app-key").apply {
            compressOptions = CompressOptions().apply {
                imageWidth = 1280
                imageHeight = 1280
                imageQuality = 0.82f
                maxOriginalImageSize = 300
            }
        }
      • setCompressOptions

         final Unit setCompressOptions(CompressOptions compressOptions)

        Media compression options for images and short videos.

        Controls how images and short videos are compressed before sending. Default is null, which uses built-in SDK defaults.

        val params = InitParams(context, "your-app-key").apply {
            compressOptions = CompressOptions().apply {
                imageWidth = 1280
                imageHeight = 1280
                imageQuality = 0.82f
                maxOriginalImageSize = 300
            }
        }
      • getContext

         final <Error class: unknown class> getContext()