Google App Indexing not resolving for Swift?

2019-07-14 06:27发布

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条回答
贼婆χ
2楼-- · 2019-07-14 06:53

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>
查看更多
登录 后发表回答