<commit_before>
//
//  Intercom.h
//  Intercom for iOS SDK - Version 2.1
//
//  Created by Intercom on 8/01/2015.
//  Copyright (c) 2014 Intercom. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0
#error This version (2.1) of the Intercom iOS SDK supports iOS 7.0 upwards.
#endif

__attribute__ ((deprecated))
@protocol IntercomSessionListener <NSObject>
- (void)intercomSessionStatusDidChange:(BOOL)isSessionOpen;
@end

// Use these values to constrain an incoming notification view to a defined section of the window.
typedef NS_ENUM(NSUInteger, ICMPreviewPosition){
    ICMPreviewPositionBottomLeft   = 0,
    ICMPreviewPositionBottomRight  = 1,
    ICMPreviewPositionTopLeft      = 2,
    ICMPreviewPositionTopRight     = 3
};

/**
 Intercom is your direct line of communication to every user, right inside your app. Intercom’s in-app messages
 are up to 10 times more effective than email too! Send the right messages, to the right users, at exactly the right time.
 
 ## How do I track my users?
 
 In order to see your users in Intercom's user list, you must first register them via your iOS application. If you have a
 place in your application where you become aware of the user's identity such as a log in view controller, call one of the
 following depending on the information you have available for that user:

 If you have both a unique user identifier and an email for your users::
 
    [Intercom registerUserWithUserId:@"123456" email:@"<EMAIL>"];
 
 If you only have a unique identifier for your users:
 
    [Intercom registerUserWithUserId:@"123456"];
 
 Finally, if you only have an email address for your users:
    
    [Intercom registerUserWithEmail:@"<EMAIL>"];
 
 ## Can I track unidentifed users?
 
 Yes, absolutely. If you have an application that doesn't require users to log in, you can call:
 
    [Intercom registerUnidentifiedUser];
 
 If the user subsequently logs in or you learn additional information about them (e.g. get an email address), 
 calling any of the other user registration methods will update that user's identity in Intercom and contain 
 all user data tracked previously.
 
 ## I'm using a previous SDK version and this looks different, what has changed?
 
 We have re-architected the internals of the iOS SDK to ensure it is as reliable as possible while tracking
 your users. We have focused on removing the asychronous behaviour of the SDK for example you no longer need 
 to wait for the completion blocks of the old `beginSession` calls before logging events or updating user data. 
 In doing so the SDK is more nimble and reliable than ever before.
 
 Previous versions of the SDK will migrate with minimal effort. All deprecated methods still work for now, 
 excluding the old session listener (since v2.0.6). These methods will be permanently removed in a future
 version.
 
 ## How do push notifications work?
 
 The Intercom iOS SDK enables your users to receive push notifications for new messages. Simply call:
 
    - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
        [Intercom setDeviceToken:deviceToken];
    }
 
 in your `didRegisterForRemoteNotificationsWithDeviceToken:` method once you have registered your app for 
 push notifications with the `UIApplicationDelegate`.
 
 When your app receives a push notification the SDK checks to see if it is an Intercom push notification
 and opens the SDK if required. You do not need to implement any additional code in order to launch the SDK.
 
 To do this we [safely swizzle](http://blog.newrelic.com/2014/04/16/right-way-to-swizzle/) the public methods
 in `UIApplicationDelegate` that handle receiving push notifications. We do not user any private APIs to do this.
 
 ## More information
 
 Full documentation is available [here](http://docs.intercom.io/Install-on-your-mobile-product) and please contact 
 us directly via Intercom for any support or questions you may have.
 
 */
@interface Intercom : NSObject

//=========================================================================================================
/*! @name Getting set up */
//=========================================================================================================
/*!
 Initialize Intercom with your iOS API key and App ID.  This will allow your app to connect with Intercom.
 This is best done in the application delegate's didFinishLaunchingWithOptions: method.
 
 @param apiKey The iOS-SDK API key found on the API Key settings page.
 @param appId  The App ID of your Intercom app.
 */
+ (void)setApiKey:(NSString *)apiKey forAppId:(NSString *)appId;

//=========================================================================================================
/*! @name Using secure mode */
//=========================================================================================================
/*!
 Secure Mode helps to make sure that conversations between you and your users are kept private, and that one
 user can't impersonate another. In Secure Mode the iOS SDK will sign all requests going to the Intercom servers
 with tokens. It requires your mobile application to have its own server which authenticates the app's users,
 and which can store a secret. More information on secure mode can be found [here](http://docs.intercom.io/Install-on-your-mobile-product/secure-mode-ios-sdk).
 
 @note This should be called before any user registration takes place.
 @param hmac A HMAC digest of data.
 @param data A piece of user data.
 */
+ (void)setHMAC:(NSString *)hmac data:(NSString *)data;

//=========================================================================================================
/*! @name Working with anonymous users */
//=========================================================================================================
/*!
 If you call registerUnidentifiedUser, all activity will be tracked anonymously. If you choose to subsequently
 identify that user, all that anonymous activity will be merged into the identified user. This means that you
 will no longer see the anonymous user in Intercom, but rather the identified one.
 
 @note We recommend this is called from within the application delegate's didFinishLaunchingWithOptions: method.
 
 @note You must call one of the user registration methods in order to start communicating with Intercom.
 */
+ (void)registerUnidentifiedUser;

//=========================================================================================================
/*! @name Working with identified users */
//=========================================================================================================
/*!
 In order to keep track of a specific user, you must identify it with a unique user identifier, an email
 address, or both. By supplying information like this Intercom provides richer user profiles for your users.
 This is a userId, supplied by you (e.g. from an existing web service for your product) to represent your
 user in Intercom, once set it cannot be changed.
 
 @param userId  A unique identifer for your user.
 @param email   Your user's email address.
 @note You must call one of the user registration methods in order to start communicating with Intercom.
 */
+ (void)registerUserWithUserId:(NSString *)userId email:(NSString *)email;

/*!<commit_msg>Update Intercom.h<commit_after>
//
//  Intercom.h
//  Intercom for iOS SDK - Version 2.1
//
//  Created by Intercom on 8/01/2015.
//  Copyright (c) 2014 Intercom. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0
#error This version (2.1) of the Intercom iOS SDK supports iOS 7.0 upwards.
#endif

__attribute__ ((deprecated))
@protocol IntercomSessionListener <NSObject>
- (void)intercomSessionStatusDidChange:(BOOL)isSessionOpen;
@end

// Use these values to constrain an incoming notification view to a defined section of the window.
typedef NS_ENUM(NSUInteger, ICMPreviewPosition){
    ICMPreviewPositionBottomLeft   = 0,
    ICMPreviewPositionBottomRight  = 1,
    ICMPreviewPositionTopLeft      = 2,
    ICMPreviewPositionTopRight     = 3
};

/**
 Intercom is your direct line of communication to every user, right inside your app. Intercom’s in-app messages
 are up to 10 times more effective than email too! Send the right messages, to the right users, at exactly the right time.
 
 ## How do I track my users?
 
 In order to see your users in Intercom's user list, you must first register them via your iOS application. If you have a
 place in your application where you become aware of the user's identity such as a log in view controller, call one of the
 following depending on the information you have available for that user:

 If you have both a unique user identifier and an email for your users::
 
    [Intercom registerUserWithUserId:@"123456" email:@"<EMAIL>"];
 
 If you only have a unique identifier for your users:
 
    [Intercom registerUserWithUserId:@"123456"];
 
 Finally, if you only have an email address for your users:
    
    [Intercom registerUserWithEmail:@"<EMAIL>"];
 
 ## Can I track unidentifed users?
 
 Yes, absolutely. If you have an application that doesn't require users to log in, you can call:
 
    [Intercom registerUnidentifiedUser];
 
 If the user subsequently logs in or you learn additional information about them (e.g. get an email address), 
 calling any of the other user registration methods will update that user's identity in Intercom and contain 
 all user data tracked previously.
 
 ## I'm using a previous SDK version and this looks different, what has changed?
 
 We have re-architected the internals of the iOS SDK to ensure it is as reliable as possible while tracking
 your users. We have focused on removing the asychronous behaviour of the SDK for example you no longer need 
 to wait for the completion blocks of the old `beginSession` calls before logging events or updating user data. 
 In doing so the SDK is more nimble and reliable than ever before.
 
 Previous versions of the SDK will migrate with minimal effort. All deprecated methods still work for now, 
 excluding the old session listener (since v2.0.6). These methods will be permanently removed in a future
 version.
 
 ## How do push notifications work?
 
 The Intercom iOS SDK enables your users to receive push notifications for new messages. Simply call:
 
    - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
        [Intercom setDeviceToken:deviceToken];
    }
 
 in your `didRegisterForRemoteNotificationsWithDeviceToken:` method once you have registered your app for 
 push notifications with the `UIApplicationDelegate`.
 
 When your app receives a push notification the SDK checks to see if it is an Intercom push notification
 and opens the SDK if required. You do not need to implement any additional code in order to launch the SDK.
 
 To do this we [safely swizzle](http://blog.newrelic.com/2014/04/16/right-way-to-swizzle/) the public methods
 in `UIApplicationDelegate` that handle receiving push notifications. We do not user any private APIs to do this.
 
 ## More information
 
 Full documentation is available [here](http://docs.intercom.io/Install-on-your-mobile-product) and please contact 
 us directly via Intercom for any support or questions you may have.
 
 */
@interface Intercom : NSObject

//=========================================================================================================
/*! @name Getting set up */
//=========================================================================================================
/*!
 Initialize Intercom with your iOS API key and App ID.  This will allow your app to connect with Intercom.
 This is best done in the application delegate's didFinishLaunchingWithOptions: method.
 
 @param apiKey The iOS-SDK API key found on the API Key settings page.
 @param appId  The App ID of your Intercom app.
 */
+ (void)setApiKey:(NSString *)apiKey forAppId:(NSString *)appId;

//=========================================================================================================
/*! @name Using secure mode */
//=========================================================================================================
/*!
 Secure Mode helps to make sure that conversations between you and your users are kept private, and that one
 user can't impersonate another. In Secure Mode the iOS SDK will sign all requests going to the Intercom servers
 with tokens. It requires your mobile application to have its own server which authenticates the app's users,
 and which can store a secret. More information on secure mode can be found [here](http://docs.intercom.io/Install-on-your-mobile-product/secure-mode-ios-sdk).
 
 @note This should be called before any user registration takes place.
 @param hmac A HMAC digest of data.
 @param data A piece of user data.
 */
+ (void)setHMAC:(NSString *)hmac data:(NSString *)data;

//=========================================================================================================
/*! @name Working with anonymous users */
//=========================================================================================================
/*!
 If you call registerUnidentifiedUser, all activity will be tracked anonymously. If you choose to subsequently
 identify that user, all that anonymous activity will be merged into the identified user. This means that you
 will no longer see the anonymous user in Intercom, but rather the identified one.
 
 @note For March 2015, this is **an opt-in beta feature** in Intercom. Unlike previous versions of the SDK, 
 we're turning this into a stand alone mode for the SDK. Please get in touch with us if you would like your
 app opted in to this feature.

@note We recommend this is called from within the application delegate's didFinishLaunchingWithOptions: method.
 
 @note You must call one of the user registration methods in order to start communicating with Intercom.
 */
+ (void)registerUnidentifiedUser;

//=========================================================================================================
/*! @name Working with identified users */
//=========================================================================================================
/*!
 In order to keep track of a specific user, you must identify it with a unique user identifier, an email
 address, or both. By supplying information like this Intercom provides richer user profiles for your users.
 This is a userId, supplied by you (e.g. from an existing web service for your product) to represent your
 user in Intercom, once set it cannot be changed.
 
 @param userId  A unique identifer for your user.
 @param email   Your user's email address.
 @note You must call one of the user registration methods in order to start communicating with Intercom.
 */
+ (void)registerUserWithUserId:(NSString *)userId email:(NSString *)email;

/*!
{'fraction_non_alphanumeric': 0.16701944701680116, 'fraction_numerical': 0.006614631565021828, 'mean_word_length': 4.698831511496419, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3828866', 'n_tokens_mistral': 3760, 'n_tokens_neox': 3356, 'n_words': 1815}