Botter 1.1.8

Botter 1.1.8

NoraSayed135 维护。



Botter 1.1.8

  • Nora 和 Nora2

Botter 移动 SDK!

您好!以下是如何与 Botter 移动 SDK 集成的简要指南

示例

要运行示例项目,首先克隆仓库,然后在 Example 目录中运行 pod install

安装

步骤 1- Botter 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod 'Botter' , :git = 'https://github.com/NoraSayed135/Botter.git'

2- 如果您想要在应用程序中显示浮动按钮,请根据以下步骤自定义应用程序以允许多个窗口(如果不进行此操作,请跳过此步骤)

1 - 从 info.plist 文件中删除 Scene Manifest 2- 注释在 App Delegate 中的 scene 配置函数 3- 在 App Delegate 类中添加此行

var  window: UIWindow?

实现

Botter SDK 提供了在应用程序中展示启动按钮的选项

 import Botter

 @UIApplicationMain
 class AppDelegate: UIResponder, UIApplicationDelegate {
     var window: UIWindow?

     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) - Bool {
         Botter.show(APIKey: "nKmovPCdWNZ")

         return true
     }

您可以在自定义按钮上触发打开聊天动作

@IBAction func openChat(){
  
       Botter.openChatScreen(APIKey: "nKmovPCdWNZ")
   }

要隐藏启动按钮,我们有以下两种方法

将想要隐藏按钮的控制器从 BotterControllerWithHiddenLauncher 继承

import Botter

class HiddenLauncherViewController: BotterControllerWithHiddenLauncher {

}

或者

在每次需要显示/隐藏启动按钮时调用这两个函数

Botter.hideLauncherButton()

Botter.showLauncherButton()

open override func viewWillAppear(_ animated: Bool) {
      super.viewWillAppear(animated)
      Botter.hideLauncherButton()
  }
 open override func viewDidDisappear(_ animated: Bool) {
       super.viewDidDisappear(animated)
       Botter.showLauncherButton()
   }

自定义

更改启动器位置

要更改启动器位置,您可以调用此方法设置底部边距

BotterSettingsManager.bottomMargin = 40

更改标题文本

要更改标题文本,您可以调用此方法来设置它

BotterSettingsManager.ChatTitleText = "Botter"