Google App Indexing not resolving for Swift?

*爱你&永不变心* 提交于 2019-12-24 03:16:59

问题


I'm trying to integrate Google App Indexing into my iOS / Swift app. I installed it via CocoaPods. The problem is it's not resolving any of Google's code. Here's what I got:

func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool {
    var sanitizedURL = GSDDeepLink.handleDeepLink(url)
    return true
}

The compile error says: Use of unresolved identifier 'GSDDeepLink'. I tried adding import GoogleAppIndexing and even import GSDDeepLink, but it says: no such module 'GoogleAppIndexing'. Any ideas or anyone got this to work with Swift?


回答1:


under supporting files, there should be a file that ends with "-Bridging-Header.h." You want to do the Objective-C import statement there:

#import <GoogleAppIndexing/GoogleAppIndexing.h>


来源:https://stackoverflow.com/questions/31514747/google-app-indexing-not-resolving-for-swift

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!