facebook - AWS Cognito , logins method of AWSIdentityProviderManager protocol is not getting called for iOS -
we trying use aws cognito facebook login, when integrating code per aws documentation below
class facebookprovider: nsobject, awsidentityprovidermanager { func logins() -> awstask<nsdictionary> { if let token = accesstoken.current?.authenticationtoken { return awstask(result: [awsidentityproviderfacebook:token]) } return awstask(error:nserror(domain: "facebook login", code: -1 , userinfo: ["facebook" : "no current facebook access token"])) } }
this code have written in appdelegate.swift
in didfinishlaunchingwithoptions
method
fbsdkapplicationdelegate.sharedinstance().application(application, didfinishlaunchingwithoptions: launchoptions) let obj = facebookprovider() let credentialsprovider = awscognitocredentialsprovider(regiontype:.useast1, identitypoolid:"somepoolid",identityprovidermanager: obj) let configuration = awsserviceconfiguration(region:.useast1, credentialsprovider:credentialsprovider) awsservicemanager.default().defaultserviceconfiguration = configuration
here see logins method not getting called.
since logins method not getting called not able pass facebook authentication token amazon cognito.
any highly appreciated.
Comments
Post a Comment