Skip to content

Commit a928a2d

Browse files
authored
Release 3.1.0 (#234)
* Release 3.1.0 * Mention +[Intercom updateUserWithAttributes:] deprecation in changelog
1 parent c303aac commit a928a2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+670
-43
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Intercom
22

3+
## 3.1.0 (2017-02-27)
4+
5+
* Added new GIF button to the composer in the Messenger, so your users can search for and share GIFs in conversations.
6+
* Updated image upload functionality.
7+
* Added `ICMUserAttributes` and `+[Intercom updateUser:]` to help make updating users easier. `+[Intercom updateUserWithAttributes:]` is now deprecated.
8+
* Improved behaviour in landscape on small devices.
9+
* Fixed issue where errors could be logged on first launch.
10+
311
## 3.0.25 (2017-02-07)
412

513
* Fixed an issue with `[Intercom enableLogging]` that caused debug logs not to be shown.

Intercom.framework.dSYM/Contents/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundleSignature</key>
1414
<string>????</string>
1515
<key>CFBundleShortVersionString</key>
16-
<string>3.0.25</string>
16+
<string>3.1.0</string>
1717
<key>CFBundleVersion</key>
1818
<string>1</string>
1919
</dict>
719 KB
Binary file not shown.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
//
2+
// ICMCompany.h
3+
//
4+
// Created by Intercom on 17/01/2017.
5+
// Copyright (c) 2017 Intercom. All rights reserved.
6+
//
7+
8+
#import <Foundation/Foundation.h>
9+
10+
/**
11+
* The ICMCompany object is used for adding companies to users in Intercom.
12+
* All of the default attributes you can modify are available as properties on ICMCompany.
13+
* This is an example of how to create an ICMCompany object to update default attributes.
14+
*
15+
* ICMCompany *company = [ICMCompany new];
16+
* company.companyId = @"12345";
17+
* company.name = @"TestCorp";
18+
*
19+
* You can also add custom attributes to your company.
20+
*
21+
* ICMCompany *company = [ICMCompany new];
22+
* company.companyId = @"12345";
23+
* company.name = @"TestCorp";
24+
* company.customAttributes = @{@"employee_count" : @200};
25+
*
26+
*/
27+
@interface ICMCompany : NSObject
28+
29+
/**
30+
The ID of the company.
31+
@note This property is required
32+
*/
33+
@property (nonatomic, copy, nullable) NSString *companyId;
34+
35+
/**
36+
The name of the company.
37+
*/
38+
@property (nonatomic, copy, nullable) NSString *name;
39+
40+
/**
41+
The created at date for this company.
42+
*/
43+
@property (nonatomic, strong, nullable) NSDate *createdAt;
44+
45+
/**
46+
The monthly spend of the company.
47+
*/
48+
@property (nonatomic, strong, nullable) NSNumber *monthlySpend;
49+
50+
/**
51+
The plan of the company.
52+
*/
53+
@property (nonatomic, copy, nullable) NSString *plan;
54+
55+
/**
56+
Custom attributes for this user.
57+
@note Each key must be an NSString and each value must be of type NSString, NSNumber or NSNull.
58+
*/
59+
@property (nonatomic, strong, nullable) NSDictionary<NSString *, id> *customAttributes;
60+
61+
/**
62+
Gives you a null value to apply to string attributes.
63+
64+
@return the value to set on string attributes which you wish to be null
65+
*/
66+
+ (nonnull NSString *)nullStringAttribute;
67+
68+
/**
69+
Gives you a null value to apply to number attributes.
70+
71+
@return the value to set on number attributes which you wish to be null
72+
*/
73+
+ (nonnull NSNumber *)nullNumberAttribute;
74+
75+
/**
76+
Gives you a null value to apply to date attributes.
77+
78+
@return the value to set on date attributes which you wish to be null
79+
*/
80+
+ (nonnull NSDate *)nullDateAttribute;
81+
82+
/**
83+
A dictionary representation for the company.
84+
*/
85+
- (nonnull NSDictionary<NSString *, id> *)attributes;
86+
87+
@end
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
//
2+
// ICMUserAttributes.h
3+
//
4+
// Created by Intercom on 17/01/2017.
5+
// Copyright (c) 2017 Intercom. All rights reserved.
6+
//
7+
8+
#import <Foundation/Foundation.h>
9+
#import "ICMCompany.h"
10+
11+
/**
12+
The ICMUserAttributes object is used for updating a user in Intercom.
13+
All of the default attributes you can modify are available as properties on ICMUserAttributes.
14+
This is an example of how to create an ICMUserAttributes object to update default attributes
15+
16+
ICMUserAttributes *userAttributes = [ICMUserAttributes new];
17+
userAttributes.userId = @"12345";
18+
userAttributes.email = @"[email protected]";
19+
userAttributes.name = @"Andy";
20+
21+
You can also add custom attributes to your user:
22+
23+
ICMUserAttributes *userAttributes = [ICMUserAttributes new];
24+
userAttributes.userId = @"12345";
25+
userAttributes.email = @"[email protected]";
26+
userAttributes.customAttributes = @{@"items_in_cart" : @8};
27+
*/
28+
@interface ICMUserAttributes : NSObject
29+
30+
/**
31+
The email for this user.
32+
*/
33+
@property (nonatomic, copy, nullable) NSString *email;
34+
35+
/**
36+
The user ID for this user.
37+
*/
38+
@property (nonatomic, copy, nullable) NSString *userId;
39+
40+
/**
41+
The name of this user.
42+
*/
43+
@property (nonatomic, copy, nullable) NSString *name;
44+
45+
/**
46+
The phone number of this user.
47+
*/
48+
@property (nonatomic, copy, nullable) NSString *phone;
49+
50+
/**
51+
The signed up date for this user.
52+
*/
53+
@property (nonatomic, strong, nullable) NSDate *signedUpAt;
54+
55+
/**
56+
A boolean indicating if the user has unsubscribed from emails.
57+
*/
58+
@property (nonatomic, assign) BOOL unsubscribedFromEmails;
59+
60+
/**
61+
The companies for this user.
62+
*/
63+
@property (nonatomic, strong, nullable) NSArray<ICMCompany *> *companies;
64+
65+
/**
66+
Custom attributes for this user.
67+
@note Each key must be an NSString and each value must be of type NSString, NSNumber or NSNull.
68+
*/
69+
@property (nonatomic, strong, nullable) NSDictionary<NSString *, id> *customAttributes;
70+
71+
/**
72+
Gives you a null value to apply to string attributes.
73+
74+
@return the value to set on string attributes which you wish to be null
75+
*/
76+
+ (nonnull NSString *)nullStringAttribute;
77+
78+
/**
79+
Gives you a null value to apply to number attributes.
80+
81+
@return the value to set on number attributes which you wish to be null
82+
*/
83+
+ (nonnull NSNumber *)nullNumberAttribute;
84+
85+
/**
86+
Gives you a null value to apply to date attributes.
87+
88+
@return the value to set on date attributes which you wish to be null
89+
*/
90+
+ (nonnull NSDate *)nullDateAttribute;
91+
92+
/**
93+
A dictionary representation for the user attributes.
94+
*/
95+
- (nonnull NSDictionary<NSString *, id> *)attributes;
96+
97+
@end

Intercom.framework/Headers/Intercom.h

Lines changed: 10 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#import <Foundation/Foundation.h>
1010
#import <UIKit/UIKit.h>
11+
#import "ICMUserAttributes.h"
1112

1213
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0
1314
#error This version (3.0.25) of Intercom for iOS supports iOS 8.0 upwards.
@@ -173,44 +174,17 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){
173174
You can send any data you like to Intercom. Typically our customers see a lot of value in sending data that
174175
relates to customer development, such as price plan, value of purchases, etc. Once these have been sent to
175176
Intercom you can then apply filters based on these attributes.
177+
178+
Details on attributes available to update can be found in ICMUserAttributes.
179+
180+
@param userAttributes The attributes to update the user with.
181+
*/
182+
+ (void)updateUser:(ICMUserAttributes *)userAttributes;
176183

177-
A detailed list of the fields you can use to [update a user is available here](https://developers.intercom.com/reference/#user-model )
178-
179-
Attributes such as the user email or name can be updated by calling
180-
181-
[Intercom updateUserWithAttributes:@{
182-
@"email" : @"[email protected]",
183-
@"name" : @"Admin Name"
184-
}];
185-
186-
Custom user attributes can be created and modified by passing a custom_attributes dictionary
187-
You do not have to create attributes in Intercom beforehand. If one hasn't been seen before, it will be
188-
created for you automatically.
189-
190-
[Intercom updateUserWithAttributes:@{
191-
@"custom_attributes": @{
192-
@"paid_subscriber" : @YES,
193-
@"monthly_spend": @155.5,
194-
@"team_mates": @3
195-
}
196-
}];
197-
198-
You can also set company data via this call by submitting an attribute dictionary like
199-
200-
[Intercom updateUserWithAttributes:@{
201-
@"companies": @[ @{
202-
@"name" : @"My Company",
203-
@"id" : @"abcd1234"
204-
}
205-
]}];
206-
207-
id is a required field for adding or modifying a company. A detailed description of the
208-
[company model is available here](https://developers.intercom.com/reference/#companies )
209-
210-
@param attributes This is a dictionary containing key/value pairs for multiple attributes.
211-
@note Attributes may be either a `string`, `integer`, `double`, `unix timestamp` or `bool`.
184+
/*!
185+
@deprecated +[Intercom updateUserWithAttributes:] is deprecated. Use +[Intercom updateUser:] instead.
212186
*/
213-
+ (void)updateUserWithAttributes:(NSDictionary *)attributes;
187+
+ (void)updateUserWithAttributes:(NSDictionary *)attributes __attribute((deprecated("'+[Intercom updateUserWithAttributes:]' is deprecated. 'Use +[Intercom updateUser:]' instead.")));
214188

215189
/*!
216190
Log an event with a given name.

Intercom.framework/Info.plist

-1 Bytes
Binary file not shown.

Intercom.framework/Intercom

3.19 MB
Binary file not shown.
1.08 KB
Loading
2.11 KB
Loading

0 commit comments

Comments
 (0)