Skip to content

Commit

Permalink
Merge pull request #9 from mention-me/feature/segment-update
Browse files Browse the repository at this point in the history
Pass segment through to the enrolment
  • Loading branch information
matiasm authored Jan 11, 2023
2 parents 766459d + f0a8f14 commit 128c977
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
8 changes: 7 additions & 1 deletion Example/MentionmeSwift/EnrolReferrerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class EnrolReferrerViewController: UIViewController {
var firstname = "Logan"
var surname = "Smith"
var email = "[email protected]"
var segment = "vip"
var privacyTermsString = ""
var offer: MentionmeOffer?
var shareLinks: [MentionmeShareLink]?
Expand Down Expand Up @@ -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

Expand All @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions MentionmeSwift.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -24,7 +24,7 @@ Pod::Spec.new do |s|
s.author = { 'mention-me' => '[email protected]' }
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' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 128c977

Please sign in to comment.