首页 > 解决方案 > 使用未声明的标识符“_AppsFlyerdelegate”

问题描述

我不是 iOS 开发人员,而是了解一点 iOS,我被困在 iOS 的原生端

所以我在iOS上遇到了这个问题

我正在尝试这个建议的答案

在这里他说要添加这个,所以我做了

  // AppsFlyer init here...
  if(_AppsFlyerdelegate == nil){
    _AppsFlyerdelegate = [[RNAppsFlyer alloc] init];
  }
  [[AppsFlyerLib shared] setDelegate:_AppsFlyerdelegate];
  [AppsFlyerLib shared].appsFlyerDevKey = @"YOUR_APPSFLYER_DEV_KEY"; // HACK: iOS SDK is faster than RN plugin

但我开始收到这些错误

Use of undeclared identifier '_AppsFlyerdelegate'

所以我去了我的 pod 文件并添加了这个(不确定这个 sis 是否正确)

 pod 'GoogleMaps'
  pod 'Google-Maps-iOS-Utils'
  config = use_native_modules!

  use_react_native!(:path => config["reactNativePath"])
  pod 'AppsFlyerFramework'

是否安装了 pod,再次运行命令但错误没有消失?知道我做错了什么吗?

也(不重要)但有人可以简要解释一下这段代码

if(_AppsFlyerdelegate == nil){
    _AppsFlyerdelegate = [[RNAppsFlyer alloc] init];
  }
  [[AppsFlyerLib shared] setDelegate:_AppsFlyerdelegate];
  [AppsFlyerLib shared].appsFlyerDevKey = @"YOUR_APPSFLYER_DEV_KEY"; // HACK: iOS SDK is faster than RN plugin


  // React Native Bridge and Root View init here...
  RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
  RCTRootView *rootView = [[RCTRootView alloc] 
    initWithBridge:bridge
    moduleName:@"FiftyViewsUnderTheAppiumSea"
    initialProperties:nil
  ];

标签: swiftreact-native

解决方案


推荐阅读