Skip to content

Commit 7a5e69b

Browse files
authored
Merge pull request #186 from Iterable/brad/inbox/inbox-readme
Updates to README for Mobile Inbox
2 parents 713aeed + 1524453 commit 7a5e69b

File tree

1 file changed

+86
-157
lines changed

1 file changed

+86
-157
lines changed

README.md

Lines changed: 86 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,66 @@
44

55
# Iterable Android SDK
66

7-
The Iterable Android SDK is a Java implementation of an Android client for Iterable, supporting Android API versions 15 and higher.
7+
The Iterable Android SDK is a Java implementation of an Android client for
8+
Iterable, supporting Android API versions 15 and higher.
9+
10+
## Table of contents
11+
12+
- [Installation](#installation)
13+
- [Stable versions](#stable-versions)
14+
- [Beta versions](#beta-versions)
15+
- [Handling Firebase push messages and tokens](#handling-firebase-push-messages-and-tokens)
16+
- [Setting up a push integration in Iterable](#setting-up-a-push-integration-in-iterable)
17+
- [Migrating from a version prior to 3.1.0](#migrating-from-a-version-prior-to-310)
18+
- [Sample apps](#sample-apps)
19+
- [Using the SDK](#using-the-sdk)
20+
- [Push notifications](#push-notifications)
21+
- [In-app messages](#in-app-messages)
22+
- [Mobile Inbox](#mobile-inbox)
23+
- [Deep linking](#deep-linking)
24+
- [Optional setup](#optional-setup)
25+
- [Additional information](#additional-information)
26+
- [License](#license)
27+
- [Want to contribute?](#want-to-contribute)
28+
29+
## Installation
30+
31+
It's possible to install stable or beta versions of Iterable's Android SDK,
32+
as described below. You'll also need to handle Firebase push messages and
33+
tokens.
834

9-
## Setting up a push integration in Iterable
35+
> ⚠ **IMPORTANT**
36+
>
37+
> Versions 3.2.0 and higher of Iterable's Android SDK depend on the
38+
> [AndroidX](https://developer.android.com/jetpack/androidx) support libraries.
39+
> [Migrate your app to use AndroidX](https://developer.android.com/jetpack/androidx/migrate)
40+
> before using version 3.2.0 or higher of the SDK.
1041
11-
Before you even start with the SDK, you will need to:
42+
### Stable versions
1243

13-
1. Set your application up to receive push notifications
14-
2. Set up a push integration in Iterable. This allows Iterable to communicate on your behalf with Firebase Cloud Messaging.
44+
Add the following dependencies to your application's **build.gradle**:
1545

16-
For more details, read Iterable's [Setting up Android Push Notifications](https://support.iterable.com/hc/articles/115000331943-Setting-up-Android-Push-Notifications) guide.
46+
- `compile 'com.iterable:iterableapi:3.2.0'`
47+
- `compile 'com.google.firebase:firebase-messaging:X.X.X' // Min version 17.4.0`
1748

18-
Congratulations, you've configured your Iterable project to send push notifications to your app! Now, let's set up the Iterable SDK.
49+
See [Bintray](https://bintray.com/davidtruong/maven/Iterable-SDK) for the latest
50+
version of the SDK.
1951

20-
## Installing a beta version of the SDK to use with Iterable's Mobile Inbox beta
52+
### Beta versions
2153

2254
> ⚠ **IMPORTANT**
55+
>
2356
> Beta versions of this SDK are subject to Iterable's
24-
[Beta Mobile SDK Terms of Service](https://support.iterable.com/hc/articles/360034753412).
57+
> [Beta Mobile SDK Terms of Service](https://support.iterable.com/hc/articles/360034753412).
58+
59+
Beta versions of Iterable's Android SDK are published to JitPack instead of
60+
Maven. To find the latest beta version of Iterable's Android SDK, look at
61+
look at this [JitPack page](https://jitpack.io/#Iterable/iterable-android-sdk).
2562

26-
The current beta version of the SDK is `3.2.0-beta1`. Beta releases are not published to Maven; instead, use Jitpack:
63+
To install a beta version:
2764

28-
1. Add the JitPack repository to your build file. Add it in your root build.gradle at the end of repositories:
65+
1. Add the JitPack repository to your build file. Add it in your root
66+
**build.gradle** at the end of repositories:
2967

3068
```groovy
3169
allprojects {
@@ -35,8 +73,9 @@ The current beta version of the SDK is `3.2.0-beta1`. Beta releases are not publ
3573
}
3674
}
3775
```
38-
39-
2. Add Iterable SDK dependencies:
76+
77+
2. Add dependencies for Iterable's Android SDK (this example selects version
78+
`3.2.0-beta1`):
4079

4180
```groovy
4281
implementation 'com.github.Iterable.iterable-android-sdk:iterableapi:3.2.0-beta1'
@@ -45,9 +84,13 @@ The current beta version of the SDK is `3.2.0-beta1`. Beta releases are not publ
4584

4685
### Handling Firebase push messages and tokens
4786

48-
The SDK adds a `FirebaseMessagingService` to the app manifest automatically, so you don't have to do any extra setup to handle incoming push messages.
87+
The SDK adds a `FirebaseMessagingService` to the app manifest automatically, so
88+
you don't have to do any extra setup to handle incoming push messages.
4989

50-
If your application implements its own FirebaseMessagingService, make sure you forward `onMessageReceived` and `onNewToken` calls to `IterableFirebaseMessagingService.handleMessageReceived` and `IterableFirebaseMessagingService.handleTokenRefresh`, respectively:
90+
If your application implements its own `FirebaseMessagingService`, make sure you
91+
forward `onMessageReceived` and `onNewToken` calls to
92+
`IterableFirebaseMessagingService.handleMessageReceived` and
93+
`IterableFirebaseMessagingService.handleTokenRefresh`, respectively:
5194

5295
```java
5396
public class MyFirebaseMessagingService extends FirebaseMessagingService {
@@ -64,7 +107,21 @@ public class MyFirebaseMessagingService extends FirebaseMessagingService {
64107
}
65108
```
66109

67-
Note that `FirebaseInstanceIdService` is deprecated and replaced with `onNewToken` in recent versions of Firebase.
110+
Note that `FirebaseInstanceIdService` is deprecated and replaced with
111+
`onNewToken` in recent versions of Firebase.
112+
113+
## Setting up a push integration in Iterable
114+
115+
Before you even start with the SDK, you will need to:
116+
117+
1. Set your application up to receive push notifications
118+
119+
2. Set up a push integration in Iterable. This allows Iterable to communicate on
120+
your behalf with Firebase Cloud Messaging.
121+
122+
For more details, read Iterable's [Setting up Android Push Notifications](https://support.iterable.com/hc/articles/115000331943)
123+
guide.
124+
68125

69126
## Migrating from a version prior to 3.1.0
70127

@@ -111,6 +168,12 @@ Note that `FirebaseInstanceIdService` is deprecated and replaced with `onNewToke
111168
[Deep linking](#deep-linking) to migrate any existing URL handling code
112169
to this new API.
113170

171+
## Sample apps
172+
173+
This repository contains the following sample apps:
174+
175+
- [Inbox Customization](https://github.com/Iterable/iterable-android-sdk/tree/master/sample-apps/inbox-customization)
176+
114177
## Using the SDK
115178

116179
### Push notifications
@@ -280,143 +343,13 @@ To customize the time delay between successive in-app messages, set `inAppDispla
280343
281344
### Mobile Inbox
282345
283-
Apps using version 3.2.0 and later of this SDK can save in-app messages to an inbox. This inbox displays a list of saved in-app messages and allows users to read and interact with them at their convenience. The SDK provides a default user interface for the inbox, and it can be customized to match your brand's styles.
284-
285-
To configure an in-app message to use the inbox, marketers should:
286-
287-
- Enable the **Show in Inbox** toggle in the in-app message's template
288-
- Choose whether or not to **Deliver Silently to Inbox** (so that the message does not display prominently when the device receives it, but can be viewed later by the user)
289-
290-
#### Mobile Inbox implementation guide
291-
292-
Add a new dependency, `iterableapi-ui`, to your `build.gradle` file:
293-
294-
```groovy
295-
compile 'com.iterable:iterableapi-ui:3.2.0-beta1'
296-
```
297-
298-
To open Inbox as a separate activity, launch `IterableInboxActivity`. The SDK also provides `IterableInboxFragment` if you need to embed the Inbox UI within an existing activity.
299-
300-
##### Show the inbox inside an existing activity
301-
302-
You can embed `IterableInboxFragment` either via a layout .xml file, or by calling `IterableInboxFragment.newInstance()` and inserting it into your activity.
303-
304-
##### Display mobile inbox as a result of an user action
305-
306-
It's also possible to show the inbox when a user taps a button (or completes some other action). To do this, respond to the user's action by starting `IterableInboxActivity`. For example:
307-
308-
```java
309-
// Add this in your button handler
310-
startActivity(this, IterableInboxActivity.class);
311-
```
312-
313-
#### Mobile Inbox customization options
314-
315-
The SDK provides various ways to customize the inbox's interface to match your brand's styles. For simpler customization needs, specify a custom XML layout ID by calling `setItemLayoutId` on the `IterableInboxFragment`. For more advanced scenarios, define classes that inherit from `IterableInboxFragment` and `InboxRecyclerViewAdapter` and override existing methods as necessary.
316-
317-
##### inboxMode
318-
319-
`IterableInboxFragment` and `IterableInboxActivity` can display inbox messages in two ways:
346+
Apps using version 3.2.0 and later of this SDK can allow users to save in-app
347+
messages to an inbox. This inbox displays a list of saved in-app messages and
348+
allows users to read them at their convenience. The SDK provides a default user
349+
interface for the inbox, which can be customized to match your brand's styles.
320350

321-
- `POPUP` - (default): Displays the inbox message as a dialog on top of the Inbox UI.
322-
- `ACTIVITY` - Displays the inbox message in a new activity.
323-
324-
##### itemLayoutId
325-
326-
To completely change the look of an inbox, copy the contents of `fragment_inbox_item.xml` from `iterableapi-ui` into a new layout XML in your project and modify it. Then call `setItemLayoutId` on the `IterableInboxFragment` in `onCreate` of the parent activity to specify the custom layout XML for Inbox cells.
327-
328-
#### Mobile inbox events and the events lifecycle
329-
330-
An inbox lists saved in-app messages. Because of this, Iterable events that apply to in-app messages also apply to inbox messages. These events are described below:
331-
332-
##### In-App Send
333-
334-
This event is triggered when an in-app message is sent to a user.
335-
336-
Important event properties:
337-
338-
- `eventType` - `inAppSend`
339-
- `createdAt` - when the in-app message was sent
340-
- `campaignId`- the in-app message campaign ID
341-
342-
##### In-App Delivery
343-
344-
This event is triggered when an in-app message is received by a user's device.
345-
346-
Important event properties:
347-
348-
- `eventType` - `inAppDelivery`
349-
- `createdAt` - when the in-app message was received by the device
350-
- `campaignId` - the in-app message campaign ID
351-
352-
##### Inbox Message Impression
353-
354-
This event tracks the number of unique times a message appeared in the inbox during a single inbox session (period when the user had the inbox open). The total represents the count of unique times the message displayed on-screen in the inbox during an inbox session (not the number of times the user actually opened that message).
355-
356-
Important event properties:
357-
358-
- `eventType` - `inboxMessageImpression`
359-
- `createdAt` - when the event was created
360-
- `campaignId` - the in-app message campaign ID
361-
- `impressionCount` - how many times the message was visible in the inbox during the inbox session
362-
- `totalDuration` - the total duration of time (in seconds) the message was visible in the inbox
363-
364-
##### In-App Open
365-
366-
This event is triggered when the user taps a message in the inbox to view its contents.
367-
368-
Important event properties:
369-
370-
- `eventType` - `inAppOpen`
371-
- `createdAt` - when the in-app message was opened
372-
- `campaignId`- the in-app message campaign ID
373-
374-
##### In-App Click
375-
376-
This event is triggered when the user taps on a link or button in an in-app message.
377-
378-
Important event properties:
379-
380-
- `eventType` - `inAppClick`
381-
- `createdAt` - when the button in the in-app message was tapped
382-
- `campaignId`- the in-app message campaign ID
383-
- `clickedUrl` - the URL associated with the tapped link/button
384-
385-
##### In-App Close
386-
387-
This event is triggered when the user closes an inbox message by tapping a close button or a back button. Close buttons/links should have URL `iterable://dismiss`. Tapping a close button/link also creates an `inAppClick` event.
388-
389-
Important event properties:
390-
391-
- `eventType` - `inAppClose`
392-
- `createdAt` - when the in-app message was closed
393-
- `campaignId`- the in-app message campaign ID
394-
- `closeAction` - the type of item the user tapped: `link` (for buttons/links), `back` for a back button, or `other`
395-
396-
##### In-App Delete
397-
398-
This event is triggered when the user deletes an inbox message by swiping left on it and tapping the **Delete** button, or when the user taps a delete button/link in the in-app message, which should have a URL of `iterable://delete`. Tapping a delete button/link also creates an `inAppClick` event and an `inAppClose` event.
399-
400-
Important event properties:
401-
402-
- `eventType` - `inAppDelete`
403-
- `createdAt` - when the in-app message was deleted
404-
- `campaignId`- the in-app campaign ID
405-
- `deleteAction` - how the message was deleted (`inbox-swipe` if the user swiped left in the inbox and tapped **Delete**, or `delete-button` if the user tapped a button/link with URL `iterable://delete`).
406-
407-
##### Inbox Session
408-
409-
This event captures information about an inbox session, which starts when a user opens the inbox and ends when they navigate away (or close/minimize the app). Viewing a message in the inbox does not end the session.
410-
411-
Important event properties
412-
413-
- `eventType` - `inboxSession`
414-
- `campaignId`- the in-app campaign id
415-
- `inboxSessionStart` - when the session started
416-
- `inboxSessionEnd` - when the session ended
417-
- `uniqueImpressionCount` - no of unique messages visible in the Inbox message list to the user during the inbox session
418-
- `startTotalMessageCount` - the number of messages in the inbox at the session's start
419-
- `endTotalMessageCount` - the number of messages in the inbox at the session's end (messages can be added or removed during a session)
351+
To learn more about Mobile Inbox, how to customize it, and events related to
352+
its usage, read Iterable's [Mobile Developer Guides](https://support.iterable.com/hc/categories/360002288712).
420353
421354
### Deep linking
422355
@@ -516,11 +449,7 @@ If you're using a different project for FCM and have existing devices on a GCM p
516449

517450
## Additional information
518451

519-
For more information, take a look at:
520-
521-
- Iterable's [Android SDK Release Notes](https://support.iterable.com/hc/articles/360027543332)
522-
- Iterable's [Setting up Android Push Notifications](https://support.iterable.com/hc/articles/115000331943-Setting-up-Android-Push-Notifications) guide
523-
- Iterable's [Push Notification Setup FAQs](http://support.iterable.com/hc/articles/206791196-Push-Notification-Setup-FAQ-s)
452+
For more information, take a look at Iterable's [Mobile Developer Guides](https://support.iterable.com/hc/categories/360002288712).
524453

525454
## License
526455

0 commit comments

Comments
 (0)