You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+43-18Lines changed: 43 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,10 @@ Intercom for iOS supports iOS 7.x, iOS 8.x and iOS 9.x.
7
7
8
8
### CocoaPods
9
9
Add the Intercom pod into your Podfile and run `pod install`.
10
-
10
+
11
11
pod 'Intercom'
12
-
13
-
### Manual Installation
12
+
13
+
### Manual Installation
14
14
15
15
[Download Intercom for iOS](https://github.com/intercom/intercom-ios/archive/master.zip) and use Finder to drag `Intercom.framework` and `Intercom.bundle` into your Xcode project, ticking the "Copy items if needed" checkbox.
16
16
@@ -45,26 +45,26 @@ No matter what category of app you have, you'll need your Intercom app id and th
45
45
###My app only has logged in users
46
46
1. Firstly, on successful completion of your authentication method in your login view controller you will need to register your user.
47
47
48
-
- (void)successfulLogin {
48
+
- (void)successfulLogin {
49
49
...
50
50
// Registering with Intercom is easy. For best results, use a unique user_id if you have one.
51
51
[Intercom registerUserWithUserId:@"<#123456#>"];
52
52
}
53
53
**Note:**_If you don't have a unique `userId` to use here, or if you have a `userId` and an `email` you can [register with those too](https://github.com/intercom/intercom-ios/blob/master/Intercom.framework/Versions/A/Headers/Intercom.h#L152)._
54
54
55
-
2. Also, in your application delegate's `didFinishLaunchingWithOptions:` method (or wherever you _check_ your user's authenticated state when your app starts up)
55
+
2. Also, in your application delegate's `didFinishLaunchingWithOptions:` method (or wherever you _check_ your user's authenticated state when your app starts up)
56
56
57
57
// Override point for customization after application launch.
58
58
if(loggedIn){
59
59
...
60
60
// We're logged in, we can register the user with Intercom
61
61
[Intercom registerUserWithUserId:@"<#123456#>"];
62
-
62
+
63
63
// Carry on as normal
64
64
...
65
65
}
66
66
}
67
-
67
+
68
68
3. Finally, when users eventually want to log out of your app, we should clear Intercom for iOS's caches so that when they log back in again, everything works perfectly. In your logout code, simply call `[Intercom reset];` like so:
69
69
70
70
- (void)logout {
@@ -83,41 +83,41 @@ No matter what category of app you have, you'll need your Intercom app id and th
83
83
[Intercom registerUnidentifiedUser];
84
84
...
85
85
}
86
-
86
+
87
87
Because Intercom listens for UIApplication start notifications, there is no need to have this line of code anywhere else. Intercom will track all of your user sessions for you.
88
88
89
89
###My app has logged in and logged out users
90
90
91
91
1. Firstly, on successful completion of your authentication method in your login view controller you will need to register your user.
92
92
93
-
- (void)successfulLogin {
93
+
- (void)successfulLogin {
94
94
...
95
95
// Registering with Intercom is easy. For best results, use a unique user_id if you have one.
96
96
[Intercom registerUserWithUserId:@"<#123456#>"];
97
97
}
98
98
**Note:**_If you don't have a unique `userId` to use here, or if you have a `userId` and an `email` you can [register with those too](https://github.com/intercom/intercom-ios/blob/master/Intercom.framework/Versions/A/Headers/Intercom.h#L152)._
99
99
100
-
2. In your application delegate's `didFinishLaunchingWithOptions:` method (or wherever you _check_ your user's authenticated state when your app starts up)
100
+
2. In your application delegate's `didFinishLaunchingWithOptions:` method (or wherever you _check_ your user's authenticated state when your app starts up)
// We're logged in, we can register the user with Intercom
106
106
[Intercom registerUserWithUserId:@"<#123456#>"];
107
-
107
+
108
108
} else {
109
109
// Since we aren't logged in, we are an unidentified user. Lets register.
110
110
[Intercom registerUnidentifiedUser];
111
111
}
112
112
}
113
-
113
+
114
114
3. Finally, when users eventually want to log out of your app, we should clear Intercom for iOS's caches so that when they log back in again, everything works perfectly. In your logout code, simply call `[Intercom reset];` like so:
115
115
116
116
- (void)logout {
117
117
...
118
118
// This reset's the Intercom integration's cache of your user's identity and wipes the slate clean.
119
119
[Intercom reset];
120
-
120
+
121
121
// Now that you have logged your user out and reset, you can register a new
122
122
// unidentified user in their place.
123
123
[Intercom registerUnidentifiedUser];
@@ -129,8 +129,8 @@ Because Intercom listens for UIApplication start notifications, there is no need
129
129
1.**Do not use an email address as a `userId` as this field is unique and cannot be changed or updated later.** If you only have an email address, you can just register a user with that. [More details are available here](https://github.com/intercom/intercom-ios/blob/master/Intercom.framework/Versions/A/Headers/Intercom.h#L168).
130
130
2.**If you register users with an email address, email must be a unique field in your app.** Otherwise we won't know which user to update and the mobile integration won't work.
131
131
3. Intercom for iOS listens for when your app starts and stops, so all you need to do is register a type of user like the examples above and we'll do the rest.
132
-
133
-
132
+
133
+
134
134
## How does the in-app messenger work?
135
135
136
136
Intercom allows you to send messages to your users while also enabling your users send messages to you. If you have a dedicated button in your app that you wish to hook the new message composer up to, you can control Intercom's messaging UI via the `[Intercom presentMessageComposer];` and `[Intercom presentConversationList];` methods. More information on messaging with Intercom for iOS can be found [here](http://docs.intercom.io/Install-on-your-mobile-product/configuring-intercom-for-ios#messaging).
@@ -139,15 +139,15 @@ Intercom allows you to send messages to your users while also enabling your user
139
139
140
140
Intercom for iOS has support for all these things. For full details please read our [documentation](http://docs.intercom.io/Install-on-your-mobile-product/configuring-intercom-for-ios).
141
141
142
-
142
+
143
143
## I'm using a previous version and this looks different, what's changed?
144
-
144
+
145
145
We have re-architected Intercom for iOS to ensure it is as reliable as possible while tracking your users. We have focused on removing the asychronous behaviour of Intercom for iOS, for example you no longer need to wait for the completion blocks of the now deprecated `beginSession` calls before logging events or updating user data. In doing so it is more nimble and reliable than ever before.
146
146
147
147
Previous versions of Intercom for iOS will migrate with minimal effort. All deprecated methods still work for now, excluding the old session listener (since v2.0.6). These deprecated methods will be permanently removed in a future version.
148
148
149
149
## Documentation and getting started guides
150
-
150
+
151
151
Detailed documentation and getting started guides for:
152
152
153
153
- Updating a user
@@ -163,3 +163,28 @@ are available in [our documentation](https://docs.intercom.io/configuring-for-yo
163
163
## Xcode Documentation
164
164
165
165
This documentation provides integrated help in Xcode for all public APIs in Intercom for iOS. [Download the docset](https://github.com/intercom/intercom-ios/archive/master.zip) from the repository above and Copy the content into ~`/Library/Developer/Shared/Documentation/DocSets`.
166
+
167
+
168
+
## Migrating to the latest version of the SDK
169
+
170
+
Migrating to the latest version of the iOS SDK should be a very straight forward and worthwhile process. There are two main ways you can update your SDK library version in your app.
171
+
172
+
1. Run `pod update Intercom` from the root of you Xcode project where your *Podfile* lives.
173
+
2. Download the latest binary version of the SDK and include it in your app's dependency library directory.
174
+
175
+
As the SDK has evolved some method signatures have changed but their purpose has stayed the same. Here is a list of some of the more commonly used methods and their new names:
176
+
177
+
<table>
178
+
<tr><th colspan="3" style="text-align:center;">iOS Method Name Changes</th></tr>
0 commit comments