Getting phone number from Facebook Account Kit

前端 未结 4 1126
暗喜
暗喜 2021-02-06 07:25

The Account Kit documentation states that if your began the login session with AccountKitActivity.ResponseType.TOKEN, it\'s possible to access the Account Kit ID, phone number a

4条回答
  •  日久生厌
    2021-02-06 07:35

    You can fetch Account ID,Email and Phone number using below code:

        let accountKit = AKFAccountKit(responseType: AKFResponseType.accessToken)
        accountKit.requestAccount { (account, error) in
         if(error != nil){
            //error while fetching information
          }else{
            print("Account ID  \(account?.accountID)")
            if let email = account?.emailAddress,email.characters.count > 0{
                 print("Email\(email)")
            }else if let phoneNum = account?.phoneNumber{
                 print("Phone Number\(phoneNum.stringRepresentation())")
            }
          }
        }
    

提交回复
热议问题