我正试图在我的Intercom.io应用程序中实现iOS的自定义属性。我在XCode 7,Swift 2和iOS 9。
这是我的密码:
class func updateUser(user: User) {
Intercom.updateUserWithAttributes([
"name": user.name,
"email": user.email
])
let userAttributes = ([
"role": "customer",
"phone": user.phone,
"First Name": user.firstName,
"Last Name": user.lastName,
"Referral Code": user.referralCode,
"Avatar Pic": user.avatarURL,
"Profile Pic": user.profilePicURL
])
Intercom.updateUserWithAttributes(["custom_attributes": userAttributes])
}我成功地提交了“姓名”和“电子邮件”,但我的"custom_attributes“不起作用。根据对讲机的文档:https://docs.intercom.io/Install-on-your-mobile-product/configuring-intercom-for-ios,我认为我的语法是正确的
但我是个斯威夫特新手,对奥比杰-C没有经验。
同样重要的是要注意,我的事件是通过适当的报告。
Intercom.logEventWithName(eventName)我的语法有什么问题吗??或者别的什么?请帮帮我!
发布于 2015-10-19 13:47:29
结果发现有两个问题:
1)内部通信文档错误和自定义属性不需要"custom_attributes“标记
2)我的URL格式是NSURL而不是String,因此整个对象都被拒绝了
现在就修好!感谢对讲机对Dale的支持
守则很简单:
let userAttributes = [
"name": user.name,
"email": user.email,
"role": "customer",
"phone": user.phone,
"first_name": user.firstName,
"last_name": user.lastName,
"referral_code": user.referralCode,
"avatar_pic": user.avatarURLString,
"profile_pic": user.profilePicURLString
]
Intercom.updateUserWithAttributes(userAttributes)https://stackoverflow.com/questions/33187287
复制相似问题