Client Attributes
Optional
In some cases, the Host application may need to pass attributes to the DR SDK. This is supported with the ClientAttributes class provided as a part of the SDK.
The following code snippet shows how this can be done.
Avoid Data Override
Please note that all values need to be passed together to the SDK before the
setClientAttributes
method is called. By calling multiple times the previous data would be overwritten and only the new value would be available and sent to DR servers.
void setClientAttributes() {
Map<String, dynamic> parameters = new Map();
parameters["NAME_ATTRIBUTE"] = "VALUE";
parameters["NAME_ATTRIBUTE"] = "VALUE";
_drpluginPlugin.setClientAttributes(parameters);
}
The following are the keys which we have pre-defied.
- Phone number - "PHONE_NUMBER"
- Carrier - "CARRIER"
- Bill type - "BILL_TYPE" // POSTPAY or PREPAY.
In addition to the keys above you are free to add your own keys, DR would be storing the information in DB for future reference.
External ID
We can set the Partner ID or External ID or Host App reference ID using the Client Attributes.
For this we have reserved a KEY as "EXTERNAL_ID".
Example:
void setClientAttributes() {
Map<String, dynamic> parameters = new Map();
parameters["EXTERNAL_ID"] = "VALUE";
_drpluginPlugin.setClientAttributes(parameters);
}
Updated almost 2 years ago