You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -20,13 +26,23 @@ Run `bundle exec fastlane create_binary_framework` to build the Swift binary fra
20
26
21
27
* The Mailchimp SDK is currently in a private beta. If you'd like to join the beta send your Mailchimp username to [[email protected]](mailto:[email protected]?subject=I%27d%20like%20to%20join%20the%20Mailchimp%20SDK%20Private%20Beta).
22
28
23
-
### Adding the XCFramework
29
+
## Installation
30
+
### Option 1: Cocoapods
31
+
For the latest version of our SDK, add the following to your project's Podfile:
32
+
```
33
+
pod 'MailchimpSDK'
34
+
```
35
+
36
+
### Option 2: Manual
37
+
1. Clone this repository
38
+
2. Run `bundle exec fastlane create_binary_framework` to build the Swift binary framework for iOS and iOS Simulator.
39
+
3. Add the XCFramework:
24
40
25
-
Click on the Project navigator, select your app’s target, go to the General tab, scroll down to Frameworks, Libraries, and Embedded Content. Drag the Mailchimp.xcframework from this repo into this section.
41
+
Click on the Project navigator, select your app’s target, go to the General tab, scroll down to Frameworks, Libraries, and Embedded Content. Drag the Mailchimp.xcframework from this repo into this section.
26
42
27
-

43
+

28
44
29
-
###Initializing the SDK
45
+
## Initializing the SDK
30
46
31
47
The initialize method has three different fields.
32
48
@@ -35,7 +51,7 @@ The initialize method has three different fields.
35
51
* Auto Tagging (Optional): Auto Tagging automatically tags contacts with information such as Device Type and Platform. This is on by default.
36
52
37
53
```swift
38
-
MailchimpSDK.initialize(token: sdkKey)
54
+
MailchimpSDK.initialize(token: sdkKey)
39
55
```
40
56
41
57
## Collecting contact information
@@ -45,19 +61,19 @@ The initialize method has three different fields.
45
61
To add a contact to your Mailchimp audience, first instantiate a new Contact struct. Then pass the contact into the `createOrUpdate()` method. This will add the contact to your Mailchimp audience with applied merge fields and/or tags. If the contact already exists, their information will be updated with the values that were passed in.
@@ -142,12 +158,12 @@ Merge Fields of type address are represented as an Address struct. Addresses hav
142
158
In addition there are three optional fields, Address Line Two, State, and Country. Below is an example of an Address object.
143
159
144
160
```swift
145
-
let address =Address(addressLineOne: "123 Chimp St.",
146
-
addressLineTwo: "Suite 456",
147
-
city: "Atlanta",
148
-
state: "GA",
149
-
zipCode: "30308",
150
-
country: CountryCode.USA)
161
+
let address =Address(addressLineOne: "123 Chimp St.",
162
+
addressLineTwo: "Suite 456",
163
+
city: "Atlanta",
164
+
state: "GA",
165
+
zipCode: "30308",
166
+
country: CountryCode.USA)
151
167
```
152
168
153
169
### Contact Status
@@ -162,7 +178,7 @@ Appropriate marketing permissions need to be set to communicate with any contact
162
178
Marketing permissions are set by instantiating a MarketingPermission struct with the corresponding `marketingPermissionsId` and setting `enabled` if the user granted permission for that permission ID.
163
179
164
180
```swift
165
-
let permission1 = Contact.MarketingPermission(marketingPermissionId: "permission1", enabled: true)
181
+
let permission1 = Contact.MarketingPermission(marketingPermissionId: "permission1", enabled: true)
166
182
```
167
183
168
184
## Collecting contact events
@@ -172,15 +188,15 @@ Marketing permissions are set by instantiating a MarketingPermission struct with
172
188
To add an event associated with a contact, first instantiate a new Event struct. Then pass the event into the `trackEventWithAttributes()` method. This will add the event to the specified contact.
173
189
174
190
```swift
175
-
let event: Event =try!Event(emailAddress: "[email protected]", name: "signup", properties: ["source":"iOS"])
176
-
MailchimpSDK.trackEventWithAttributes(event: event) { result in
177
-
switch result {
178
-
case .success:
179
-
print("Successfully tracked an event")
180
-
case .failure(let error):
181
-
print("Error: \(error.localizedDescription)")
182
-
}
191
+
let event: Event =try!Event(emailAddress: "[email protected]", name: "signup", properties: ["source":"iOS"])
192
+
MailchimpSDK.trackEventWithAttributes(event: event) { result in
0 commit comments