I am trying to implement Google Cloud Messaging into my iOS app. But I keep getting the error
Use of undeclared type 'GGLInstanceIDDelegate'
I have been following the instructions on Google's support pages but to no avail. My code looks like:
import UIKit
@UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate, GGLInstanceIDDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
var osV = String(getMajorSystemVersion())
if osV == "7"
{
UIApplication.sharedApplication().registerForRemoteNotificationTypes(UIRemoteNotificationType.Badge | UIRemoteNotificationType.Sound | UIRemoteNotificationType.Alert)
}
else if osV == "8"
{
// Register for remote notifications
var types: UIUserNotificationType = UIUserNotificationType.Badge | UIUserNotificationType.Alert | UIUserNotificationType.Sound
var settings: UIUserNotificationSettings = UIUserNotificationSettings( forTypes: types, categories: nil )
application.registerUserNotificationSettings( settings )
application.registerForRemoteNotifications()
}
/* All the line below are throwing a similar error */ //GGLInstanceID.sharedInstance().startWithConfig(GGLInstanceIDConfig.defaultConfig())
//registrationOptions = [kGGLInstanceIDRegisterAPNSOption:deviceToken, kGGLInstanceIDAPNSServerTypeSandboxOption:true]
//GGLInstanceID.sharedInstance().tokenWithAuthorizedEntity(gcmSenderID, scope: kGGLInstanceIDScopeGCM, options: registrationOptions, handler: registrationHandler)
return true
}
I am getting in my class declaration:
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, GGLInstanceIDDelegate {
Has anybody had success with this? I would appreciate any help. I think it has to do with the linking or something like that.