1
1
2
2
//
3
3
// Intercom.h
4
- // Intercom for iOS - Version 2.2. 3
4
+ // Intercom for iOS - Version 2.3
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.2.4) of Intercom for iOS supports iOS 7.0 upwards.
14
+ #error This version (2.3) of Intercom for iOS supports iOS 7.0 upwards.
15
+ #endif
16
+
17
+ #if __has_feature(nullability)
18
+ #define ICM_ASSUME_NONNULL_BEGIN _Pragma (" clang assume_nonnull begin" )
19
+ #define ICM_ASSUME_NONNULL_END _Pragma (" clang assume_nonnull end" )
20
+ #define icm_nullable nullable
21
+ #define __icm_nullable __nullable
22
+ #else
23
+ #define ICM_ASSUME_NONNULL_BEGIN
24
+ #define ICM_ASSUME_NONNULL_END
25
+ #define icm_nullable
26
+ #define __icm_nullable
15
27
#endif
16
28
17
29
// Use these values to constrain an incoming notification view to a defined section of the window.
@@ -101,6 +113,7 @@ typedef NS_ENUM(NSUInteger, ICMPresentationMode){
101
113
102
114
*/
103
115
@interface Intercom : NSObject
116
+ ICM_ASSUME_NONNULL_BEGIN
104
117
105
118
// =========================================================================================================
106
119
/* ! @name Getting set up */
@@ -335,29 +348,42 @@ typedef NS_ENUM(NSUInteger, ICMPresentationMode){
335
348
*/
336
349
+ (void )enableLogging ;
337
350
351
+ // =========================================================================================================
352
+ /* ! @name Status bar handling */
353
+ // =========================================================================================================
354
+
355
+ /* !
356
+ If you wish to change your status bar's style or visibility while an Intercom notification may be on
357
+ screen, call this method so that Intercom's window can reflect these changes accordingly.
358
+ */
359
+ + (void )setNeedsStatusBarAppearanceUpdate ;
360
+
338
361
// =========================================================================================================
339
362
/* ! @name Intercom Notifications */
340
363
// =========================================================================================================
341
364
/* !
342
- Notifications thrown by Intercom for iOS when the Intercom window is displayed and hidden. These notifications
343
- are fired only when there is a change in the state of Intercom's UI: when a user receives a message for
344
- instance, willShow and didShow notifications will be fired accordingly when the Intercom Notification (chat head)
345
- is presented.
365
+ These are notifications thrown by Intercom for iOS when the Intercom window is displayed and hidden or when
366
+ a new conversation has been started. These notifications are fired only when there is a change in the state
367
+ of Intercom's UI: when a user receives a message for instance, willShow and didShow notifications will be
368
+ fired accordingly when the Intercom Notification (chat head) is presented.
346
369
347
370
Once the user taps on the chat head, the message is presented in your app. It will be presented covering
348
371
the entire screen, but no notifications will be thrown here as Intercom has already been visible.
372
+
373
+ In the case of a new conversation this notification may be used to prompt users to enable push notifications.
349
374
*/
350
375
351
376
UIKIT_EXTERN NSString *const IntercomWindowWillShowNotification;
352
377
UIKIT_EXTERN NSString *const IntercomWindowDidShowNotification;
353
378
UIKIT_EXTERN NSString *const IntercomWindowWillHideNotification;
354
379
UIKIT_EXTERN NSString *const IntercomWindowDidHideNotification;
380
+ UIKIT_EXTERN NSString *const IntercomDidStartNewConversationNotification;
355
381
356
382
/* *
357
383
@warning Deprecated methods will be removed in version 2.4.
358
384
*/
359
385
360
- typedef void (^ICMCompletion)(NSError *error ) __attribute((deprecated));
386
+ typedef void (^ICMCompletion)(NSError * __icm_nullable ) __attribute((deprecated));
361
387
362
388
// =========================================================================================================
363
389
/* ! @name Deprecated methods */
@@ -371,17 +397,17 @@ typedef void(^ICMCompletion)(NSError *error) __attribute((deprecated));
371
397
/* !
372
398
@deprecated Use registerUserWithEmail: instead
373
399
*/
374
- + (void )beginSessionForUserWithEmail : (NSString *)email completion : (ICMCompletion)completion __attribute((deprecated(" Use method 'registerUserWithEmail:' instead" )));
400
+ + (void )beginSessionForUserWithEmail : (NSString *)email completion : (icm_nullable ICMCompletion)completion __attribute((deprecated(" Use method 'registerUserWithEmail:' instead" )));
375
401
376
402
/* !
377
403
@deprecated Use registerUserWithUserId: instead
378
404
*/
379
- + (void )beginSessionForUserWithUserId : (NSString *)userId completion : (ICMCompletion)completion __attribute((deprecated(" Use method 'registerUserWithUserId:' instead" )));
405
+ + (void )beginSessionForUserWithUserId : (NSString *)userId completion : (icm_nullable ICMCompletion)completion __attribute((deprecated(" Use method 'registerUserWithUserId:' instead" )));
380
406
381
407
/* !
382
408
@deprecated Use registerUnidentifiedUser instead
383
409
*/
384
- + (void )beginSessionForAnonymousUserWithCompletion : (ICMCompletion)completion __attribute((deprecated(" Use method 'registerUnidentifiedUser' instead" )));
410
+ + (void )beginSessionForAnonymousUserWithCompletion : (icm_nullable ICMCompletion)completion __attribute((deprecated(" Use method 'registerUnidentifiedUser' instead" )));
385
411
386
412
/* !
387
413
@deprecated Use reset instead
@@ -391,17 +417,17 @@ typedef void(^ICMCompletion)(NSError *error) __attribute((deprecated));
391
417
/* !
392
418
@deprecated Use updateUserWithAttributes: instead
393
419
*/
394
- + (void )updateUserWithAttributes : (NSDictionary *)attributes completion : (ICMCompletion)completion __attribute((deprecated(" Use method 'updateUserWithAttributes:' instead" )));
420
+ + (void )updateUserWithAttributes : (NSDictionary *)attributes completion : (icm_nullable ICMCompletion)completion __attribute((deprecated(" Use method 'updateUserWithAttributes:' instead" )));
395
421
396
422
/* !
397
423
@deprecated Use logEventWithName: instead
398
424
*/
399
- + (void )logEventWithName : (NSString *)name completion : (ICMCompletion)completion __attribute((deprecated(" Use method 'logEventWithName:' instead" )));
425
+ + (void )logEventWithName : (NSString *)name completion : (icm_nullable ICMCompletion)completion __attribute((deprecated(" Use method 'logEventWithName:' instead" )));
400
426
401
427
/* !
402
428
@deprecated Use logEventWithName:metaData: instead
403
429
*/
404
- + (void )logEventWithName : (NSString *)name optionalMetaData : (NSDictionary *)metadata completion : (ICMCompletion)completion __attribute((deprecated(" Use method 'logEventWithName:metaData:' instead" )));
430
+ + (void )logEventWithName : (NSString *)name optionalMetaData : (NSDictionary *)metadata completion : (icm_nullable ICMCompletion)completion __attribute((deprecated(" Use method 'logEventWithName:metaData:' instead" )));
405
431
406
432
/* !
407
433
@deprecated This is no longer supported
@@ -421,7 +447,7 @@ typedef void(^ICMCompletion)(NSError *error) __attribute((deprecated));
421
447
/* !
422
448
@deprecated This is no longer supported. You can change your app's theme through settings on Intercom in the web.
423
449
*/
424
- + (void )setBaseColor : (UIColor *)color __attribute((deprecated(" This is no longer supported." )));
450
+ + (void )setBaseColor : (icm_nullable UIColor *)color __attribute((deprecated(" This is no longer supported." )));
425
451
426
452
/* !
427
453
@deprecated Use setMessagesHidden: instead
@@ -436,11 +462,12 @@ typedef void(^ICMCompletion)(NSError *error) __attribute((deprecated));
436
462
/* !
437
463
@deprecated This is no longer supported.
438
464
*/
439
- + (void )setSessionListener : (id <IntercomSessionListener>)sessionListener __attribute((deprecated(" This is no longer supported." )));
465
+ + (void )setSessionListener : (icm_nullable id <IntercomSessionListener>)sessionListener __attribute((deprecated(" This is no longer supported." )));
440
466
441
467
/* !
442
468
@deprecated Use method setDeviceToken instead.
443
469
*/
444
470
+ (void )registerForRemoteNotifications __attribute((deprecated(" Use method 'setDeviceToken' instead." )));
445
471
446
- @end
472
+ ICM_ASSUME_NONNULL_END
473
+ @end
0 commit comments