truecaller / ios-sdk

Apache License 2.0
16 stars 17 forks source link

Truecaller not getting user profile details in iOS 12 #17

Open Lyankar opened 5 years ago

Lyankar commented 5 years ago

I implemented trucaller sdk based on your guidelines. When I tap trucaller button it's opened trucaller app and it's getting my profile details, because I already logged in that app. But I need some one mobile number details. How to read ?

My code is ....

In AppDelegate:

import TrueSDK

in didFinishLaunchingWithOptions launchOptions

//Setup TruecallerSDK if TCTrueSDK.sharedManager().isSupported() { TCTrueSDK.sharedManager().setup(withAppKey: "CY16U82*****0e5c", appLink: "https://sif2bea1******dfb8.truecallerdevs.com") }

func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Swift.Void) -> Bool { return TCTrueSDK.sharedManager().application(application, continue: userActivity, restorationHandler: restorationHandler) }

In my ViewController:

import TrueSDK

class ViewController: UIViewController , TCTrueSDKDelegate {

@IBOutlet weak var btn: TCProfileRequestButton!

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view.

    TCTrueSDK.sharedManager().delegate = self

    self.btn.buttonStyle = TCButtonStyle.blue.rawValue
    self.btn.buttonCornersStyle = TCButtonCornersStyle.rounded.rawValue

}

func didFailToReceiveTrueProfileWithError(_ error: TCError) {
    //Custom code here
    print("This is error : \(error)")
}

func didReceive(_ profile: TCTrueProfile) {
    //Custom code here
    print("profile \(profile)")
    print("phoneNumber \(String(describing: profile.phoneNumber))")
    print("isVerified \(String(describing: profile.isVerified))")
    print("email \(String(describing: profile.email))")
    print("avatarURL \(String(describing: profile.avatarURL))")
    print("street \(String(describing: profile.street))")
    print("city \(String(describing: profile.city))")
    print("zipCode \(String(describing: profile.zipCode))")
    print("countryCode \(String(describing: profile.countryCode))")
    print("companyName \(String(describing: profile.companyName))")
    print("facebookID \(String(describing: profile.facebookID))")
    print("firstName \(String(describing: profile.firstName))")
    print("lastName \(String(describing: profile.lastName))")
    print("gender \(String(describing: profile.gender))")
    print("isAmbassador \(String(describing: profile.isAmbassador))")
    print("jobTitle \(String(describing: profile.jobTitle))")
    print("twitterID \(String(describing: profile.twitterID))")
}

}

parth0907 commented 3 years ago

Hi There,

Hope you are doing great!

First of all we highly apologies for the delay in response.

We didn't exactly understand the issue you are facing. It would be great if you could help us understand the issue in a little more depth?

In future, please feel free to write back via our support channel for a faster and dedicated response in case of any further confusion/issues.

-Parth