Skip to content

Truecaller not getting user profile details in iOS 12 #17

@Lyankar

Description

@Lyankar

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))")
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions