2017-03-01 38 views
0

在您的iOS SDK PlivoLogin中,有PlivoLoginAppDelegate.h和PlivoLoginAppDelegate.m。 我想将其更改为swift文件。 我将其更改为以下内容。无法将iOS中的PlivoLoginAppDelegate更改为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 
 
} 
 
... 
 
}

但日志只是说

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

和停止,未能获得代表回应 - (无效)successWithResponse :. 我们如何获得委托回应?

回答

0

Plivo销售工程师在这里。

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

相关问题