1

次のエラーが表示されます

AppDelegate.swift:152:30: '(appToken: String!) -> SKTSettings' は '(appToken: String!) -> SKTSettings!' に変換できません

AppDelegate.swift:167:23: '(writeKey: String!) -> SEGAnalyticsConfiguration' は '(writeKey: String!) -> SEGAnalyticsConfiguration!' に変換できません。

問題のある行

let smoochSettings = SKTSettings(appToken: "xxxxx") let config = SEGAnalyticsConfiguration(writeKey: "xxxxx")

手がかり、わからない...

コードの詳細なコンテキスト

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

    setupToast()

    //setup rollbar
    let rollbarConfig: RollbarConfiguration = RollbarConfiguration()

    #if RELEASE
        rollbarConfig.environment = "production"
    #elseif ADHOC
        rollbarConfig.environment = "adhoc"
    #else
        rollbarConfig.environment = "development"
    #endif

    Rollbar.initWithAccessToken("xxx", configuration: rollbarConfig, enableCrashReporter: false)

    AFNetworkReachabilityManager.sharedManager().startMonitoring()
    AFNetworkReachabilityManager.sharedManager().setReachabilityStatusChangeBlock { status in
        switch status {
        case .NotReachable:
            self.SHOW_ERROR("La connexion internet semble interrompue", completion: nil)
            break
        default:
            CRToastManager.dismissAllNotifications(true)
            break
        }
    }

    ParseManager.initParse()
    LBStripeManager.initStripe()
    loadAppearances()
    //FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
    PFFacebookUtils.initializeFacebookWithApplicationLaunchOptions(launchOptions)
    FBSDKProfile.enableUpdatesOnAccessTokenChange(true)

    GMSServices.provideAPIKey("xxx")
    GMSPlacesClient.provideAPIKey("xxx")
    NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(AppDelegate.loadAppearances), name: "switchUserType", object: nil)
    let branch = Branch.getInstance()
    branch.initSessionWithLaunchOptions(launchOptions, andRegisterDeepLinkHandler: { params, error in

        if params["fromUserId"] != nil {
            let senderId = params["fromUserId"]!
            SEGAnalytics.sharedAnalytics().track("Refferal", properties: ["branchFromUser": senderId])
        }

        if params["adId"] != nil {
            let adId = params["adId"] as! String
            NSNotificationCenter.defaultCenter().postNotificationName("adCreated", object: nil)
            AdManager.sharedInstance.showAdToBabysitterFromRemoteNotification(adId, presentingController: self.window!.rootViewController!)
        }

        if (error == nil) {
            DeepLinkManager.handleDeepLinkWithParams(params)
            DeepLinkManager.sharedInstance.alreadyGotANetworkError = false
        } else if !DeepLinkManager.sharedInstance.alreadyGotANetworkError && DeepLinkManager.sharedInstance.isLoadingDataFromBranchServer {
            DeepLinkManager.sharedInstance.alreadyGotANetworkError = true
            UIWindow.topViewController().hideHUD(false)
            var errorMessage = PFConfig.stringForKey("inviteNoInternetAlertMessage")
            if errorMessage.isEmpty {
                errorMessage = "Vous n'êtes actuellement pas connecté à Internet. Le parrainage reprendra automatiquement dès qu'Internet sera disponible."
            }
            UIWindow.topViewController().showAlert(message: errorMessage)
        }
    })

    initSiren()

    // fabric
    Crashlytics().debugMode = false
    Fabric.with([Crashlytics.self])
    logUserInFabric()

    // smooch
    let smoochSettings = SKTSettings(appToken: "xxxxx")

    smoochSettings.userId = PFUser.currentUser()?.objectId
    Smooch.initWithSettings(smoochSettings)

    // intercom
    Intercom.setApiKey("xxx", forAppId: "xxxx")
    AppDelegate.phoneForCurrentUser()

    if needToSendSmoochLastOpenTag() {
        SKTUser.currentUser().addProperties(["DELTA_USAGE": "true"])
    }

    NSUserDefaults.standardUserDefaults().setObject(NSDate().timeIntervalSince1970, forKey: "LastOpen")


    var config = SEGAnalyticsConfiguration(writeKey: "xxx")
    #if RELEASE
    config.flushAt = 15
    #else
    config.flushAt = 1
    #endif
    SEGAnalytics.setupWithConfiguration(config)

    return true
}
4

1 に答える 1