iOS Mobile SDK: Assign Tracker ID

The methodAssign Tracker ID” is used to manually assign a contact identifier (trackerId) to the SDK that was obtained from an external source outside the SDK itself. Before applying it, the SDK validates with the server that the given trackerId corresponds to an existing contact in your account, using the Connectif.assignTrackerId function.

 

How to Use It

The tracker assignment uses the trackerId parameter to validate and identify the corresponding contact in Connectif.

As a recommendation, this method should only be used when receiving a trackerId from a source external to the SDK session itself.

It is not recommended to use this method if the SDK has already identified a known contact.

• Tracker Info:

Parameter Description Required Considerations
trackerId The contact identifier to assign Yes Must correspond to an existing contact in Connectif. If the sent trackerId does not exist, it cannot be assigned.
 

If the provided trackerId does not exist for the account, the assignment will not be applied and the error will be reported through the onError callback, keeping the previously assigned trackerId.

 

Example

The tracker assignment will look like this.

Connectif.assignTrackerId("60f1b3b3b3b3b3b3b3b3b3b3")

 

Callbacks (Optional)

If you want to have feedback on possible errors when sending events, you can add an EventCallbacks when using our method.

EventCallbacks(
    onSuccess: {
        //Handling in case of success
    },
    onError: { error in
        //Handling in case of error
    })
    

 

 

Congratulations!
You have reached the end of the lesson.

  

Still have questions?
Remember that our Connectif specialists are available to assist you. To contact them, simply open a support ticket by clicking the blue “Help” button on your dashboard.

 


Keep Learning!

To make the most out of your Connectif account, we recommend continuing with the following articles: