1
1
2
2
//
3
3
// Intercom.h
4
- // Intercom for iOS SDK - Version 2.1.1
4
+ // Intercom for iOS SDK - Version 2.2
5
5
//
6
6
// Created by Intercom on 8/01/2015.
7
7
// Copyright (c) 2014 Intercom. All rights reserved.
11
11
#import < UIKit/UIKit.h>
12
12
13
13
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0
14
- #error This version (2.1.1 ) of the Intercom iOS SDK supports iOS 7.0 upwards.
14
+ #error This version (2.2 ) of the Intercom iOS SDK supports iOS 7.0 upwards.
15
15
#endif
16
16
17
- __attribute__ ((deprecated))
18
- @protocol IntercomSessionListener <NSObject>
19
- - (void )intercomSessionStatusDidChange:(BOOL )isSessionOpen;
20
- @end
21
-
22
17
// Use these values to constrain an incoming notification view to a defined section of the window.
23
18
typedef NS_ENUM (NSUInteger , ICMPreviewPosition){
24
19
ICMPreviewPositionBottomLeft = 0 ,
@@ -49,7 +44,7 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){
49
44
50
45
[Intercom registerUserWithEmail:@"[email protected] "];
51
46
52
- ## Can I track unidentifed users?
47
+ ## Can I track unidentified users?
53
48
54
49
Yes, absolutely. If you have an application that doesn't require users to log in, you can call:
55
50
@@ -62,7 +57,7 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){
62
57
## I'm using a previous SDK version and this looks different, what has changed?
63
58
64
59
We have re-architected the internals of the iOS SDK to ensure it is as reliable as possible while tracking
65
- your users. We have focused on removing the asychronous behaviour of the SDK for example you no longer need
60
+ your users. We have focused on removing the asynchronous behaviour of the SDK. For example you no longer need
66
61
to wait for the completion blocks of the old `beginSession` calls before logging events or updating user data.
67
62
In doing so the SDK is more nimble and reliable than ever before.
68
63
@@ -85,7 +80,7 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){
85
80
and opens the SDK if required. You do not need to implement any additional code in order to launch the SDK.
86
81
87
82
To do this we [safely swizzle](http://blog.newrelic.com/2014/04/16/right-way-to-swizzle/) the public methods
88
- in `UIApplicationDelegate` that handle receiving push notifications. We do not user any private APIs to do this.
83
+ in `UIApplicationDelegate` that handle receiving push notifications. We do not use any private APIs to do this.
89
84
90
85
## More information
91
86
@@ -128,9 +123,9 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){
128
123
/* !
129
124
If you call registerUnidentifiedUser, all activity will be tracked anonymously. If you choose to subsequently
130
125
identify that user, all that anonymous activity will be merged into the identified user. This means that you
131
- will no longer see the anonymous user in Intercom, but rather the identified one.
132
-
133
- @note We recommend this is called from within the application delegate's didFinishLaunchingWithOptions: method.
126
+ will no longer see the anonymous user in Intercom, but rather the identified one.
127
+
128
+ We recommend this is called from within the application delegate's didFinishLaunchingWithOptions: method.
134
129
135
130
@note You must call one of the user registration methods in order to start communicating with Intercom.
136
131
*/
@@ -145,7 +140,12 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){
145
140
This is a userId, supplied by you (e.g. from an existing web service for your product) to represent your
146
141
user in Intercom, once set it cannot be changed.
147
142
148
- @param userId A unique identifer for your user.
143
+ If you are putting the Intercom SDK into an app that has persisted an authentication token or equivalent
144
+ so your users don't have to log in repeatedly (like most apps) then we advise putting the user registration
145
+ call in the `didBecomeActive:` method in your application delegate. This won't have any negative impact if
146
+ you also add it to your authentication success method elsewhere in your app.
147
+
148
+ @param userId A unique identifier for your user.
149
149
@param email Your user's email address.
150
150
@note You must call one of the user registration methods in order to start communicating with Intercom.
151
151
*/
@@ -154,7 +154,7 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){
154
154
/* !
155
155
Register a user just with their userId.
156
156
157
- @param userId A unique identifer for your user.
157
+ @param userId A unique identifier for your user.
158
158
@note You must call one of the user registration methods in order to start communicating with Intercom.
159
159
*/
160
160
+ (void )registerUserWithUserId : (NSString *)userId ;
@@ -239,9 +239,6 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){
239
239
Metadata Objects support a few simple types that Intercom can present on your behalf, see the
240
240
[Intercom API docs](http://doc.intercom.io/api/#event-metadata-types)
241
241
242
- @param name The name of the event you wish to track.
243
- @param metadata contains simple types to present to Intercom
244
-
245
242
[Intercom logEventWithName:@"ordered_item" metaData:@{
246
243
@"order_date": @1392036272,
247
244
@"stripe_invoice": @"inv_3434343434",
@@ -250,7 +247,8 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){
250
247
@"url": @"https://example.org/orders/3434-3434"
251
248
}];
252
249
253
- @param completion The completion block to be executed after the event is logged.
250
+ @param name The name of the event you wish to track.
251
+ @param metaData contains simple types to present to Intercom
254
252
*/
255
253
+ (void )logEventWithName : (NSString *)name metaData : (NSDictionary *)metaData ;
256
254
@@ -294,7 +292,7 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){
294
292
295
293
/* !
296
294
Depending on the layout of your app you may need to modify the position of the message preview relative to the
297
- preview's position. Use this method to add sufficent padding using x and y values.
295
+ preview's position. Use this method to add sufficient padding using x and y values.
298
296
299
297
@param x A horizontal padding value.
300
298
@param y A vertical padding value.
@@ -342,10 +340,12 @@ UIKIT_EXTERN NSString *const IntercomWindowDidShowNotification;
342
340
UIKIT_EXTERN NSString *const IntercomWindowWillHideNotification;
343
341
UIKIT_EXTERN NSString *const IntercomWindowDidHideNotification;
344
342
345
- /* !
346
- ## Version 2.1 Deprecations
347
- */
343
+ @end
348
344
345
+ __attribute__ ((deprecated))
346
+ @protocol IntercomSessionListener <NSObject>
347
+ - (void )intercomSessionStatusDidChange:(BOOL )isSessionOpen;
348
+ @end
349
349
350
350
typedef NS_ENUM (NSUInteger , ICMPresentationMode){
351
351
ICMPresentationModeBottomLeft = 0 ,
@@ -354,37 +354,96 @@ typedef NS_ENUM(NSUInteger, ICMPresentationMode){
354
354
ICMPresentationModeTopRight = 3
355
355
};
356
356
357
+ /* * Deprecated methods are listed here.
358
+
359
+ All methods listed in this document have been deprecated.
360
+
361
+ @warning Deprecated methods will be removed in version 2.4.
362
+ */
363
+ @interface Intercom (Deprecated)
364
+
357
365
typedef void (^ICMCompletion)(NSError *error) __attribute((deprecated));
358
366
367
+ /* !
368
+ @deprecated Use setSecureOptions: instead
369
+ */
359
370
+ (void )setApiKey : (NSString *)apiKey forAppId : (NSString *)appId securityOptions : (NSDictionary *) securityOptions __attribute((deprecated(" Use method 'setSecureOptions:' instead" )));
360
371
372
+ /* !
373
+ @deprecated Use registerUserWithEmail: instead
374
+ */
361
375
+ (void )beginSessionForUserWithEmail : (NSString *)email completion : (ICMCompletion)completion __attribute((deprecated(" Use method 'registerUserWithEmail:' instead" )));
362
376
377
+ /* !
378
+ @deprecated Use registerUserWithUserId: instead
379
+ */
363
380
+ (void )beginSessionForUserWithUserId : (NSString *)userId completion : (ICMCompletion)completion __attribute((deprecated(" Use method 'registerUserWithUserId:' instead" )));
364
381
382
+ /* !
383
+ @deprecated Use registerUnidentifiedUser instead
384
+ */
365
385
+ (void )beginSessionForAnonymousUserWithCompletion : (ICMCompletion)completion __attribute((deprecated(" Use method 'registerUnidentifiedUser' instead" )));
366
386
387
+ /* !
388
+ @deprecated Use reset instead
389
+ */
367
390
+ (void )endSession __attribute((deprecated(" Use method 'reset' to reset your local install instead" )));
368
391
392
+ /* !
393
+ @deprecated Use updateUserWithAttributes: instead
394
+ */
369
395
+ (void )updateUserWithAttributes : (NSDictionary *)attributes completion : (ICMCompletion)completion __attribute((deprecated(" Use method 'updateUserWithAttributes:' instead" )));
370
396
397
+ /* !
398
+ @deprecated Use logEventWithName: instead
399
+ */
371
400
+ (void )logEventWithName : (NSString *)name completion : (ICMCompletion)completion __attribute((deprecated(" Use method 'logEventWithName:' instead" )));
372
401
402
+ /* !
403
+ @deprecated Use logEventWithName:metaData: instead
404
+ */
373
405
+ (void )logEventWithName : (NSString *)name optionalMetaData : (NSDictionary *)metadata completion : (ICMCompletion)completion __attribute((deprecated(" Use method 'logEventWithName:metaData:' instead" )));
374
406
407
+ /* !
408
+ @deprecated This is no longer supported
409
+ */
375
410
+ (void )checkForUnreadMessages __attribute((deprecated(" This is no longer supported." )));
376
411
412
+ /* !
413
+ @deprecated Use setPreviewPaddingX:y: instead
414
+ */
377
415
+ (void )setPresentationInsetOverScreen : (UIEdgeInsets)presentationInset __attribute((deprecated(" Use method 'setPreviewPaddingX:y:' instead" )));
378
416
417
+ /* !
418
+ @deprecated Use setPreviewPosition: instead
419
+ */
379
420
+ (void )setPresentationMode : (ICMPresentationMode)presentationMode __attribute((deprecated(" Use method 'setPreviewPosition:' instead" )));
380
421
422
+ /* !
423
+ @deprecated This is no longer supported. You can change your app's theme through settings on Intercom in the web.
424
+ */
381
425
+ (void )setBaseColor : (UIColor *)color __attribute((deprecated(" This is no longer supported." )));
382
426
427
+ /* !
428
+ @deprecated Use setMessagesHidden: instead
429
+ */
383
430
+ (void )hideIntercomMessages : (BOOL )hidden __attribute((deprecated(" Use method 'setMessagesHidden:' instead" )));
384
431
432
+ /* !
433
+ @deprecated Use presentConversationList or presentMessageComposer instead
434
+ */
385
435
+ (void )presentMessageViewAsConversationList : (BOOL )showConversationList __attribute((deprecated(" Use method 'presentConversationList & presentMessageComposer' instead" )));
386
436
437
+ /* !
438
+ @deprecated This is no longer supported.
439
+ */
387
440
+ (void )setSessionListener : (id <IntercomSessionListener>)sessionListener __attribute((deprecated(" This is no longer supported." )));
388
441
442
+ /* !
443
+ @deprecated Use method setDeviceToken instead.
444
+ */
389
445
+ (void )registerForRemoteNotifications __attribute((deprecated(" Use method 'setDeviceToken' instead." )));
446
+
390
447
@end
448
+
449
+
0 commit comments