ios - 如何在 UIViewcontroller 中访问已安装的 pod 库宏字符串?

标签 ios swift voip sinch callkit

我安装了 sinch(在 swift 中工作)

在 pod 文件夹“SINAPSEnvironment.h”中

#ifndef SINAPSEnvironmentAutomatic
#ifdef NDEBUG
#define SINAPSEnvironmentAutomatic SINAPSEnvironmentProduction
#else
#ifdef DEBUG
#define SINAPSEnvironmentAutomatic SINAPSEnvironmentDevelopment
#else
#define SINAPSEnvironmentAutomatic SINAPSEnvironmentProduction
#endif  // ifdef DEBUG
#endif  // ifdef NDEBUG
#endif  // ifndef SINAPSEnvironmentAutomatic

在我使用的 UIViewcontroller.swift 中

push = Sinch.managedPush(with: SINAPSEnvironmentAutomatic)
push?.delegate = self
push?.registerUserNotificationSettings()
push?.setDesiredPushType(SINPushTypeVoIP)

在这里“SINAPSEnvironmentAutomatic”出现错误。 (使用未解析的标识符“SINAPSEnvironmentAutomatic”)

我该如何解决这个问题。

最佳答案

在顶部的 ViewController 中, 确保你添加了模块

import //Module name 

在 UIKit 下, 在你的情况下,我认为它是这个 pod,

SinchRTC

只要确保它是导入的,以及如何使用它阅读文档 here

关于ios - 如何在 UIViewcontroller 中访问已安装的 pod 库宏字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52384335/

相关文章:

ios - iOS 中的 UITextField 允许单个数字

ios - 如何获得准确的电池电量?

iphone - iPhone 5s 扬声器模式下的 iOS 7 机器人/乱码

ios - 来自 native 调用 UI 的 VOIP 去电

javascript - WebRTC 如何处理多对多连接?

ios - 在Xcode 7.3.1 Playgrounds中正确绘制数组

iOS:谷歌地图 API - markerInfoWindow 与 markerInfoContents

objective-c - 使用 UITabBarController 设计从 AppDelegate 呈现 viewController

ios - Fairplay SDK 和 IOS9

iphone - 是否可以从 XCode 4.1 或 4.0.2 构建到 iOS 5 设备?