MentionmeSwift
README
通过Mention Me的客户推荐营销增值您的客户增长
- 专门为您品牌量身定制的推荐人平台
- AB测试以优化您的项目
- 独特地捕捉口碑分享
- 从我们的客户成功团队获得最佳实践洞察
这是一个用于 Mention Me 客户将其集成到 iOS 应用程序中的 SDK。如果您有兴趣成为客户,请先联系我们。
安装
Swift 包管理器
要安装 MentionmeSwift,只需将包作为依赖项添加到您的 Package.swift
文件中。
dependencies: [
.package(url: "https://github.com/mention-me/ios-sdk.git", .branch("master"))
]
CocoaPods
MentionmeSwift 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中:
pod 'MentionmeSwift'
文档
首先了解如何 与 Mention Me 集成。另外,API 文档:Mention Me API
将以下内容添加到您的类中,以访问 MentionmeSwift 文件
import MentionmeSwift
您需要设置请求参数,这些参数可以通过您的 Mention Me 入门经理获取。
Mentionme.shared.requestParameters = MentionmeRequestParameters(partnerCode: "PARTNER_CODE")
当进行开发和测试时,应始终在 SDK 中使用演示模式。演示平台类似于生产版本,将使用您的账户设置,并具有演示活动,当您使用 SDK 请求时,将返回这些活动。
要启用演示 API 模式和调试网络日志,请包括以下内容
let config = MentionmeConfig(demo: true)
config.debugNetwork = true
Mentionme.shared.config = config
将其设置为 false 或完全不包含它,将默认为实时模式。
您可以在没有任何风险的情况下发送演示系统测试/模拟客户数据,不会向真实客户发送电子邮件,不会发放优惠券或改变金钱/奖励。我们可以在您的请求下向您提供演示平台的客户仪表板的登录信息,以便您可以审查集成的状态。
可以在 Mention Me 平台上随时启用或禁用每个触点的优惠和客户体验,无需任何开发工作,因此可以在任何活动设计开始之前发布您的 SDK 应用集成,它可以开始、更改和完成,而无需任何进一步的开发工作。
在任何典型的客户旅程中(无论是在网站还是在应用中),我们都需要做四件事情
-
促进那些愿意分享的客户的推荐(并允许他们进行分享)
-
跟踪可能被推荐的客户成功下单或注册
-
允许新客户在应用中通过口碑推荐进行“姓名分享”。
-
向作为推荐者的现有客户提供仪表板,以便他们可以跟踪分享和奖励
1. 注册推荐者
告诉我们客户详情,以便将其注册为推荐者,并为他们提供分享优惠,包括个人分享方法和在所有原生分享中包含的唯一分享跟踪URL。
let parameters = MentionmeCustomerParameters(emailAddress: email, firstname: firstname, surname: surname)
let request = MentionmeCustomerRequest(mentionmeCustomerParameters: parameters)
Mentionme.shared.enrolReferrer(mentionmeCustomerRequest: request, situation: "app-enrol-referer-screen", success: { (offer, shareLinks, termsLinks) in
//offer - Description of the offer and rewards
//shareLinks - List of share links for different share mechanisms
//termsLinks - Links to the terms and conditions for this offer
}, failure: { (error) in
print(error?.errors)
print(error?.statusCode)
}) { (error) in
print(error)
}
您的应用中的每个促销接触点都应该有一个特定的“情况”名称,例如 app-main-menu 或 post-purchase-success
这些不同的情景参数允许我们独立于 Mention Me 平台控制每个接触点,这意味着您可以安全地将新的接触点添加到您的应用中,但可以先将其关闭,直到进行全面测试,并且由管理推荐计划的团队控制其使用方式和多样性。
例如,您可以在以下操作中检查特定情况(例如 app-main-menu)的推荐者注册接触点是否已启用
Mentionme.shared.entryPointForReferrerEnrollment(mentionmeReferrerEnrollmentRequest: MentionmeReferrerEnrollmentRequest(), situation: "app-main-menu", success: { (url, defaultCallToActionString) in
//if success then enrol referrer
}, failure: { (error) in
print(error?.errors)
print(error?.statusCode)
}) { (error) in
print(error)
}
此端点还返回一个 "defaultCallToActionString",它可能包含动态内容,可以用来设置按钮或链接的内容。这允许市场营销团队在不需要与应用程序开发者协调更改文字的情况下,进行此类按钮内容的 A/B 测试(例如,通过推荐赚 £20 与通过推荐赚 20% 折扣)
2. 记录订单
告知我们订单(或客户注册)已发生,以便我们能奖励任何适当的推荐者
let orderParameters = MentionmeOrderParameters(orderIdentifier: orderIdentifier, total: price, currencyCode: currencyCode, dateString: dateString)
let customerParameters = MentionmeCustomerParameters(emailAddress: email, firstname: firstname, surname: surname)
let orderRequest = MentionmeOrderRequest(mentionmeOrderParameters: orderParameters, mentionmeCustomerParameters: customerParameters)
Mentionme.shared.recordOrder(mentionmeOrderRequest: orderRequest, situation: "app-post-purchase", success: {
//success
}, failure: { (error) in
print(error?.errors)
print(error?.statusCode)
}) { (error) in
print(error)
}
3a. 通过姓名查找推荐者
通过推荐者的姓名搜索推荐者以将其连接到被推荐人
let request = MentionmeReferrerByNameRequest(mentionmeReferrerNameParameters: MentionmeReferrerNameParameters(name: text))
Mentionme.shared.findReferrerByName(mentionmeReferrerByNameRequest: request, situation: "app-checkout-name-find", success: { (referrer, multipleNamesFound, contentCollectionLinks) in
//referrer - The payload of the request
//multipleNamesFound - Whether the user should be prompted to narrow the search (by entering an email address for example)
//contentCollectionLinks - Pagination of output and links to associated resources, including content-collection items
}, failure: { (error) in
print(error?.errors)
print(error?.statusCode)
}) { (error) in
print(error)
}
3b. 将新客户链接到推荐者
在成功找到推荐者以将其与之链接后,发布推荐者的详细信息以将其注册为推荐者
let referrerParameters = MentionmeReferrerParameters(referrerMentionMeIdentifier: identifier, referrerToken: token)
let customerParameters = MentionmeCustomerParameters(emailAddress: email, firstname: firstname, surname: surname)
let request = MentionmeRefereeRegisterRequest(mentionmeReferrerParameters: referrerParameters, mentionmeCustomerParameters: customerParameters)
Mentionme.shared.linkNewCustomerToReferrer(mentionmeRefereeRegisterRequest: request, situation: "app-referee-register", success: { (offer, refereeReward, contentCollectionLink, status) in
//offer - Description of the offer and rewards
//refereeReward - The details of the reward for the referee
//contentCollectionLink - Pagination of output and link to associated resources, including content-collection items
//status - Response status
}, failure: { (error) in
print(error?.errors)
print(error?.statusCode)
}) { (error) in
print(error)
}
4. 获取推荐者仪表板
获取推荐者的仪表板(给定推荐者身份,获取其仪表板数据)
let dashboardParameters = MentionmeDashboardParameters(emailAddress: email)
let dashboardRequest = MentionmeDashboardRequest(mentionmeDashboardParameters: dashboardParameters)
Mentionme.shared.getReferrerDashboard(mentionmeDashboardRequest: dashboardRequest, situation: "app-dashboard", success: { (offer, shareLinks, termsLinks, referralStats, dashboardRewards) in
//offer - Description of the offer and rewards
//shareLinks - List of share links for different share mechanisms
//termsLinks - Links to the terms and conditions for this offer
//referralStats - Referral Stats
//dashboardRewards - Referral rewards, list of potential rewards they are due for introducing customers
}, failure: { (error) in
print(error?.errors)
print(error?.statusCode)
}) { (error) in
print(error)
}
您可以创建自己的自定义验证警告类并覆盖reportWarning函数以用于分析目的。
Mentionme.shared.validationWarning = CustomValidationWarning()
如果您需要帮助设计集成或有任何问题,请联系 Mention Me 的入驻经理或发送电子邮件至 [email protected]。