-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Removed a reference to the UserNotifications Framework in the podspec to ensure iOS 8 & 9 compatibility
- Loading branch information
1 parent
7b3f4e1
commit f812e4e
Showing
7 changed files
with
65 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// Intercom.h | ||
// Intercom for iOS - Version 3.0.16 | ||
// Intercom for iOS - Version 3.0.17 | ||
// | ||
// Created by Intercom on 8/01/2015. | ||
// Copyright (c) 2014 Intercom. All rights reserved. | ||
|
@@ -10,7 +10,7 @@ | |
#import <UIKit/UIKit.h> | ||
|
||
#if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_8_0 | ||
#error This version (3.0.16) of Intercom for iOS supports iOS 8.0 upwards. | ||
#error This version (3.0.17) of Intercom for iOS supports iOS 8.0 upwards. | ||
#endif | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
@@ -25,57 +25,57 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){ | |
/** | ||
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 protected]"]; | ||
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 protected]"]; | ||
## Can I track unidentified 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. | ||
## How do push notifications work? | ||
Intercom for iOS 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 Intercom for iOS checks to see if it is an Intercom push notification | ||
and opens the message. You do not need to implement any additional code in order to launch the message window. | ||
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 use any private APIs to do this. | ||
## More information | ||
Full documentation is available [here](https://docs.intercom.io/install-on-your-product-or-site/quick-install/install-intercom-on-your-ios-app) and please contact | ||
us directly via Intercom for any support or questions you may have. | ||
*/ | ||
@interface Intercom : NSObject | ||
|
||
|
@@ -85,7 +85,7 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){ | |
/*! | ||
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 API key found on the API Key settings page. | ||
@param appId The App ID of your Intercom app. | ||
*/ | ||
|
@@ -99,7 +99,7 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){ | |
user can't impersonate another. In Secure Mode Intercom for iOS 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/enabling-secure-mode-in-intercom-for-ios) | ||
@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. | ||
|
@@ -113,9 +113,9 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){ | |
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. | ||
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; | ||
|
@@ -128,12 +128,12 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){ | |
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. | ||
If you are putting Intercom for iOS into an app that has persisted an authentication token or equivalent | ||
so your users don't have to log in repeatedly (like most apps) then we advise putting the user registration | ||
call in the `didBecomeActive:` method in your application delegate. This won't have any negative impact if | ||
you also add it to your authentication success method elsewhere in your app. | ||
@param userId A unique identifier 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. | ||
|
@@ -142,15 +142,15 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){ | |
|
||
/*! | ||
Register a user just with their userId. | ||
@param userId A unique identifier for your user. | ||
@note You must call one of the user registration methods in order to start communicating with Intercom. | ||
*/ | ||
+ (void)registerUserWithUserId:(NSString *)userId; | ||
|
||
/*! | ||
Register a user with just their email address. | ||
@param email Your user's email address. | ||
@note You must call one of the user registration methods in order to start communicating with Intercom. | ||
*/ | ||
|
@@ -160,7 +160,7 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){ | |
/*! @name Resetting user data */ | ||
//========================================================================================================= | ||
/*! | ||
reset is used to reset all local caches and user data Intercom has created. Reset will also close any active | ||
reset is used to reset all local caches and user data Intercom has created. Reset will also close any active | ||
UI that is on screen. Use this at a time when you wish to log a user out of your app or change a user. | ||
Once called, Intercom for iOS will no longer communicate with Intercom until a further registration is made. | ||
*/ | ||
|
@@ -173,69 +173,69 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){ | |
You can send any data you like to Intercom. Typically our customers see a lot of value in sending data that | ||
relates to customer development, such as price plan, value of purchases, etc. Once these have been sent to | ||
Intercom you can then apply filters based on these attributes. | ||
A detailed list of the fields you can use to [update a user is available here](https://developers.intercom.io/reference/#user-model ) | ||
Attributes such as the user email or name can be updated by calling | ||
[Intercom updateUserWithAttributes:@{ | ||
@"email" : @"[email protected]", | ||
@"name" : @"Admin Name" | ||
}]; | ||
Custom user attributes can be created and modified by passing a custom_attributes dictionary | ||
You do not have to create attributes in Intercom beforehand. If one hasn't been seen before, it will be | ||
created for you automatically. | ||
[Intercom updateUserWithAttributes:@{ | ||
@"custom_attributes": @{ | ||
@"paid_subscriber" : @YES, | ||
@"monthly_spend": @155.5, | ||
@"team_mates": @3 | ||
} | ||
}]; | ||
You can also set company data via this call by submitting an attribute dictionary like | ||
[Intercom updateUserWithAttributes:@{ | ||
@"companies": @[ @{ | ||
@"name" : @"My Company", | ||
@"id" : @"abcd1234" | ||
} | ||
]}]; | ||
id is a required field for adding or modifying a company. A detailed description of the | ||
[company model is available here](https://developers.intercom.io/reference/#companies-and--users) | ||
@param attributes This is a dictionary containing key/value pairs for multiple attributes. | ||
@note Attributes may be either a `string`, `integer`, `double`, `unix timestamp` or `bool`. | ||
*/ | ||
+ (void)updateUserWithAttributes:(NSDictionary *)attributes; | ||
|
||
/*! | ||
Log an event with a given name. | ||
You can log events in Intercom based on user actions in your app. Events are different | ||
to custom user attributes in that events are information on what Users did and when they | ||
did it, whereas custom user attributes represent the User's current state as seen in their | ||
profile. See details about Events [here](https://developers.intercom.io/reference/#events) | ||
@param name The name of the event that it is going to be logged. | ||
*/ | ||
+ (void)logEventWithName:(NSString *)name; | ||
|
||
/*! | ||
Metadata Objects support a few simple types that Intercom can present on your behalf, see the | ||
[Intercom API docs](https://developers.intercom.io/reference/#event-metadata-types) | ||
[Intercom logEventWithName:@"ordered_item" metaData:@{ | ||
@"order_date": @1392036272, | ||
@"stripe_invoice": @"inv_3434343434", | ||
@"order_number": @{ | ||
@"value": @"3434-3434", | ||
@"url": @"https://example.org/orders/3434-3434" | ||
}]; | ||
@param name The name of the event you wish to track. | ||
@param metaData contains simple types to present to Intercom | ||
*/ | ||
|
@@ -247,7 +247,7 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){ | |
|
||
/*! | ||
Present the Intercom Messenger | ||
Opens the Intercom messenger to automatically to the best place for your users. | ||
*/ | ||
+ (void)presentMessenger; | ||
|
@@ -271,10 +271,10 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){ | |
/*! @name Working with push notifications */ | ||
//========================================================================================================= | ||
/*! | ||
Set the device token for push notifications. Once the device token is set, the methods for receiving push | ||
Set the device token for push notifications. Once the device token is set, the methods for receiving push | ||
notifications are safely swizzled so ones sent from Intercom can be intercepted. When a push notification from | ||
Intercom is received, Intercom for iOS will automatically launch the message from the notification. | ||
@param deviceToken The device token provided in the `didRegisterForRemoteNotificationsWithDeviceToken` method. | ||
*/ | ||
+ (void)setDeviceToken:(NSData *)deviceToken; | ||
|
@@ -286,7 +286,7 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){ | |
/*! | ||
This method allows you to set a fixed bottom padding for in app messages and the launcher. | ||
It is useful if your app has a tab bar or similar UI at the bottom of your window. | ||
@param bottomPadding The size of the bottom padding in points. | ||
*/ | ||
+ (void)setBottomPadding:(CGFloat)bottomPadding; | ||
|
@@ -298,19 +298,19 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){ | |
/*! | ||
Use this to hide all incoming Intercom messages and message previews in the parts of your app where you do | ||
not wish to interrupt users, for example Camera views, parts of a game or other scenarios. | ||
By default, all in app messages will be visible. | ||
@param visible A boolean indicating if in app messages should be visible. | ||
*/ | ||
+ (void)setInAppMessagesVisible:(BOOL)visible; | ||
|
||
/*! | ||
Use this to show the Intercom launcher selectively within your app. If you choose to display the launcher, | ||
you may want to hide it on some screens where screen space is critical (e.g. parts of a game). | ||
By default, the launcher is hidden. | ||
@param visible A boolean indicating if the launcher should be visible. | ||
*/ | ||
+ (void)setLauncherVisible:(BOOL)visible; | ||
|
@@ -328,7 +328,7 @@ typedef NS_ENUM(NSUInteger, ICMPreviewPosition){ | |
/*! | ||
This method provides the current number of unread conversations. | ||
This is useful if you want to display a badge counter on the button where you launch Intercom. | ||
@return The number of unread conversations. | ||
*/ | ||
+ (NSUInteger)unreadConversationCount; | ||
|
@@ -353,7 +353,7 @@ UIKIT_EXTERN NSString *const IntercomUnreadConversationCountDidChangeNotificatio | |
//========================================================================================================= | ||
|
||
/*! | ||
If you wish to change your status bar's style or visibility while an Intercom notification may be on | ||
If you wish to change your status bar's style or visibility while an Intercom notification may be on | ||
screen, call this method so that Intercom's window can reflect these changes accordingly. | ||
*/ | ||
+ (void)setNeedsStatusBarAppearanceUpdate; | ||
|
@@ -383,12 +383,12 @@ UIKIT_EXTERN NSString *const IntercomUnreadConversationCountDidChangeNotificatio | |
/*! | ||
These are notifications thrown by Intercom for iOS when the Intercom window is displayed and hidden or when | ||
a new conversation has been started. These notifications are fired only when there is a change in the state | ||
of Intercom's UI: when a user receives a message for instance, willShow and didShow notifications will be | ||
fired accordingly when the Intercom Notification (chat head) is presented. | ||
of Intercom's UI: when a user receives a message for instance, willShow and didShow notifications will be | ||
fired accordingly when the Intercom Notification (chat head) is presented. | ||
Once the user taps on the chat head, the message is presented in your app. It will be presented covering | ||
the entire screen, but no notifications will be thrown here as Intercom has already been visible. | ||
In the case of a new conversation this notification may be used to prompt users to enable push notifications. | ||
*/ | ||
|
||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
Pod::Spec.new do |s| | ||
s.name = 'Intercom' | ||
s.version = '3.0.16' | ||
s.version = '3.0.17' | ||
s.summary = 'The Intercom iOS SDK, for integrating Intercom into your iOS application.' | ||
s.license = { :type => "Apache 2.0", :file => "Intercom/LICENSE" } | ||
s.authors = {"Adam McCarthy"=>"[email protected]", "Brian Boyle"=>"[email protected]", "Conor O’Donnell"=>"[email protected]", "James Treanor"=>"[email protected]"} | ||
s.homepage = 'https://github.com/intercom/intercom-ios' | ||
s.description = 'The Intercom iOS SDK, for integrating Intercom into your iOS application. The SDK supports iOS 8, iOS 9 and iOS 10' | ||
s.frameworks = ["Foundation", "UIKit", "Accelerate", "Security", "SystemConfiguration", "MobileCoreServices", "ImageIO", "AudioToolbox", "QuartzCore", "CoreGraphics", "Photos", "Accelerate", "UserNotifications"] | ||
s.frameworks = ["Foundation", "UIKit", "Accelerate", "Security", "SystemConfiguration", "MobileCoreServices", "ImageIO", "AudioToolbox", "QuartzCore", "CoreGraphics", "Photos", "Accelerate"] | ||
s.library = "icucore", "xml2" | ||
s.requires_arc = true | ||
s.source = { :http => "https://github.com/intercom/intercom-ios/releases/download/#{s.version}/CocoaPods.zip" } | ||
|