无法在iOS SDK中将PlivoLoginAppDelegate更改为swift

时间:2017-03-01 21:56:47

标签: plivo

在iOS SDK PlivoLogin中,有PlivoLoginAppDelegate.h和PlivoLoginAppDelegate.m。 我想将其更改为swift文件。 我将其更改为以下内容。



import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

 class var shared: AppDelegate {
 return UIApplication.shared.delegate as! AppDelegate
 }
 
 var providerDelegate: ProviderDelegate?
 
 var window: UIWindow?
 @IBOutlet var viewController: ViewController?
 var phone: Phone?
 
 // MARK: UIApplicationDelegate
 
 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
 print("Finished launching with options: \(launchOptions)")
 
// // Phone
 self.phone = Phone()
 self.viewController = self.window?.rootViewController as? ViewController
 self.viewController?.phone = self.phone
 self.phone?.setDelegate(self.viewController)
 
 
 return true
 }
 ...
}




但是日志只说

  • 创建端点
  • 生成随机密码

并停止,无法获得委托响应 - (void)successWithResponse:。 我们如何获得代表回复?

1 个答案:

答案 0 :(得分:0)

Plivo销售工程师。

Plivo iOS SDK具有Objective C接口,您可以从Swift 3.0访问Objective-C库。 This是使用iOS SDK的Objective-C界面在Swift 3.0中的示例应用程序。这个应用程序进行传出调用,并在Swift 3.0中获取委托回调。