1. 导入 InMobi SDK 头文件并进行初始化:
IMSdk.initWithAccountID("accountID", consentDictionary: [IM_GDPR_CONSENT_AVAILABLE:
"true", IM_GDPR_CONSENT_IAB: "<<consent in IAB format>>" ]) { (error) in
if let error = error {
print(error.localizedDescription)
}
}
2. 创建如下用户数据模型:
let phoneNumber = IMUserDataTypes(md5: "2wse3e", sha256: "6tghjk")
let emailId = IMUserDataTypes(md5: "ujhjk99", sha256: "jhjyure4")
let userDataModel = IMUserDataModel(phoneNumber: phoneNumber, emailId: emailId, extra: nil)
3. 将此数据模型传递给 API 获取数据:
IMUnifiedIdService.push(data: userDataModel)
4. 调用此 API 获取 UnifID。
IMUnifiedIdService.fetchUnifiedIds(delegate: self)
实现以下委托以接收回调。
class ViewController: IMUnifiedIdInterface {
onFetchCompleted(response: Dictionary?, error: Error?) {
}
}
调用此重置 API 以清除 SDK 中存储的所有用户相关数据和 ID:
IMUnifiedIdService.reset()
如果您拥有供应商提供的 ID,则可以在以下 SDK 中使用它。如果存在重叠,系统将优先使用 InMobi 获取的统一 ID。
IMSdk.setPublisherProvidedUnifiedID(unifiedIds : Dictionary?);
JSONObject 结构:
{
"id5" : "json(blob)",
"liveramp": "json(blob)"
}
By installing this SDK update, you agree that your Children Privacy Compliance setting remains accurate or that you will update that setting, whenever there is a change in your app's audience. You may update the app's Children Privacy Compliance settings at https://publisher.inmobi.com/my-inventory/app-and-placements.
Support Center