在 AppDelegate.m 中使用未声明的标识符 'Intercom' - react-native-intercom
Use of undeclared identifier 'Intercom' in AppDelegate.m - react-native-intercom
我正在使用 react-native-intercom
在我的应用程序中管理对讲机。我已经使用 CocoaPods 安装了 Intercom iOS SDK,并链接了 react-native-intercom
。但是构建失败并出现错误 Use of undeclared identifier 'Intercom' in AppDelegate.m - react-native-intercom
steps 1 (Install and Link Intercom)
npm install react-native-intercom
react-native link react-native-intercom
step 2 (Import Intercom in AppDelegate.m)
#import "Intercom/intercom.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[Intercom setApiKey:@"myApiKey" forAppId:@"myAppId"];
[Intercom registerUnidentifiedUser];
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
[Intercom setDeviceToken:deviceToken];
}
我正在使用 react-native 并通过将 intercom
更改为 Intercom
.
解决了这个问题
#import "Intercom/Intercom.h"
在 AppDelegate.m
文件中使用 #import "Intercom/Intercom.h"
而不是 #import "Intercom/intercom.h"
如果您进入工作区中框架的 Headers 文件夹 (Workspace -> Intercom.framework -> Headers)
,您将看到 Intercom.h
文件。
我正在使用 react-native-intercom
在我的应用程序中管理对讲机。我已经使用 CocoaPods 安装了 Intercom iOS SDK,并链接了 react-native-intercom
。但是构建失败并出现错误 Use of undeclared identifier 'Intercom' in AppDelegate.m - react-native-intercom
steps 1 (Install and Link Intercom)
npm install react-native-intercom
react-native link react-native-intercom
step 2 (Import Intercom in AppDelegate.m)
#import "Intercom/intercom.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[Intercom setApiKey:@"myApiKey" forAppId:@"myAppId"];
[Intercom registerUnidentifiedUser];
}
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
[Intercom setDeviceToken:deviceToken];
}
我正在使用 react-native 并通过将 intercom
更改为 Intercom
.
#import "Intercom/Intercom.h"
在 AppDelegate.m
文件中使用 #import "Intercom/Intercom.h"
而不是 #import "Intercom/intercom.h"
如果您进入工作区中框架的 Headers 文件夹 (Workspace -> Intercom.framework -> Headers)
,您将看到 Intercom.h
文件。