From 58d7fc46a70ca970527f3158316b3258cdaa9c2f Mon Sep 17 00:00:00 2001 From: Matt Long Date: Tue, 10 Jan 2023 12:28:39 +0000 Subject: [PATCH 1/2] Update request to accept parameters with a segment --- Example/MentionmeSwift/EnrolReferrerViewController.swift | 8 +++++++- .../Requests/MentionmeReferrerEnrollmentRequest.swift | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Example/MentionmeSwift/EnrolReferrerViewController.swift b/Example/MentionmeSwift/EnrolReferrerViewController.swift index eae8e1f..1117493 100755 --- a/Example/MentionmeSwift/EnrolReferrerViewController.swift +++ b/Example/MentionmeSwift/EnrolReferrerViewController.swift @@ -21,6 +21,7 @@ class EnrolReferrerViewController: UIViewController { var firstname = "Logan" var surname = "Smith" var email = "logansmith813@mention-me.com" + var segment = "vip" var privacyTermsString = "" var offer: MentionmeOffer? var shareLinks: [MentionmeShareLink]? @@ -52,10 +53,13 @@ class EnrolReferrerViewController: UIViewController { } func checkIfReferrerCanEnrol() { + let parameters = MentionmeCustomerParameters( + emailAddress: email, firstname: firstname, surname: surname) + parameters.segment = segment //Check if the enrollment can even happen before trying to enrol the referrer Mentionme.shared.entryPointForReferrerEnrollment( - mentionmeReferrerEnrollmentRequest: MentionmeReferrerEnrollmentRequest(), + mentionmeReferrerEnrollmentRequest: MentionmeReferrerEnrollmentRequest(mentionmeCustomerParameters: parameters), situation: "app-check-enrol-referrer", success: { (url, defaultCallToActionString) in @@ -82,6 +86,8 @@ class EnrolReferrerViewController: UIViewController { //Creating customer parameters with email , firstname and surname let parameters = MentionmeCustomerParameters( emailAddress: email, firstname: firstname, surname: surname) + parameters.segment = segment + //Creating the customer request needed for the referrer enrolment. let request = MentionmeCustomerRequest(mentionmeCustomerParameters: parameters) diff --git a/MentionmeSwift/Classes/Requests/MentionmeReferrerEnrollmentRequest.swift b/MentionmeSwift/Classes/Requests/MentionmeReferrerEnrollmentRequest.swift index 1b80908..82afc17 100755 --- a/MentionmeSwift/Classes/Requests/MentionmeReferrerEnrollmentRequest.swift +++ b/MentionmeSwift/Classes/Requests/MentionmeReferrerEnrollmentRequest.swift @@ -10,8 +10,13 @@ import Foundation public class MentionmeReferrerEnrollmentRequest: MentionmeRequest { - public override init() { + override init() { super.init() + } + + public convenience init(mentionmeCustomerParameters: MentionmeCustomerParameters) { + + self.init() super.method = MethodType.post super.urlSuffix = "referrer" From f0a8f142c8fa0b50cb547e8de3e5a8b5b9cb3ad3 Mon Sep 17 00:00:00 2001 From: Matt Long Date: Wed, 11 Jan 2023 10:02:15 +0000 Subject: [PATCH 2/2] Updated pod file --- MentionmeSwift.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MentionmeSwift.podspec b/MentionmeSwift.podspec index faa35d3..69c32e8 100755 --- a/MentionmeSwift.podspec +++ b/MentionmeSwift.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'MentionmeSwift' - s.version = '1.2' + s.version = '2.0' s.summary = 'Supercharge your customer growth with referral marketing through Mention Me' # This description is used to generate tags and improve search results. @@ -24,7 +24,7 @@ Pod::Spec.new do |s| s.author = { 'mention-me' => 'appledeveloper@mention-me.com' } s.source = { :git => 'https://github.com/mention-me/ios-sdk.git', :tag => s.version.to_s } - s.ios.deployment_target = '9.3' + s.ios.deployment_target = '11.0' s.swift_version = '5.0' s.source_files = 'MentionmeSwift/Classes/**/*' s.pod_target_xcconfig = { 'SWIFT_VERSION' => '5.0' }