Skip to content

Commit 14bad0a

Browse files
authored
Merge branch 'encryption' into master
2 parents e8b6532 + b2dcaa0 commit 14bad0a

File tree

16 files changed

+379
-75
lines changed

16 files changed

+379
-75
lines changed

CHANGELOG.md

Lines changed: 117 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,124 @@ This project adheres to [Semantic Versioning](http://semver.org/).
1515
#### Fixed
1616
- nothing yet
1717

18-
## [3.4.9](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.4.9)
18+
## [3.4.14](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.4.14)
19+
#### Added
20+
- `IterableInAppManager.setRead` now accepts `IterableHelper.FailureHandler failureHandler`
21+
22+
#### Fixed
23+
- Fixes an issue where `IterableInAppManager.removeMessage` caused build failure in React Native SDK pointing to legacy method calls.
24+
- Fixes an issue where custom action handlers were not invoked when tapping on push notification when the app is in background.
25+
26+
## [3.4.13](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.4.13)
27+
#### Added
28+
- `IterableInAppManager.setRead` now accepts `IterableHelper.SuccessHandler successHandler`.
29+
- `IterableApi.inAppConsume` now accepts `IterableHelper.SuccessHandler successHandler` and `IterableHelper.FailureHandler failureHandler`.
30+
31+
## [3.4.12](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.4.12)
32+
#### Added
33+
- `setEmail` and `setUserId` now accepts `IterableHelper.SuccessHandler successHandler` and `IterableHelper.FailureHandler failureHandler`.
34+
35+
#### Changed
36+
- OTT devices (FireTV) will now register as `OTT` device instead of `Android` under user's devices.
37+
38+
## [3.4.11](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.4.11)
39+
40+
#### Added
41+
42+
- Custom push notification sounds! To play a custom sound for a push notification, add a sound file to your app's `res/raw` folder and specify that same filename when setting up a template in Iterable.
43+
44+
Some important notes about custom sounds and notification channels:
45+
46+
- Android API level 26 introduced [notification channels](https://developer.android.com/develop/ui/views/notifications/channels). Every notification must be assigned to a channel.
47+
- Each custom sound you add to an Iterable template creates a new Android notification channel. The notification channel's name matches the filename of the sound (without its extension).
48+
- To ensure sensible notification channel names for end users, give friendly names to your sound files. For example, a custom sound file with name `Paid.mp3` creates a notification channel called `Paid`. The end user can see this notification channel name in their device's notification channel settings.
49+
- Be sure to place the corresponding sound file in your app's `res/raw` directory.
50+
51+
- To help you access a user's `email` address, `userId`, and `authToken`, the SDK now provides convenience methods: `getEmail()`, `getUserId()`, and `getAuthToken()`.
52+
53+
#### Changed
54+
55+
- Updated the [Security library](https://developer.android.com/topic/security/data) and improved `EncryptedSharedPreferences` handling.
56+
57+
To work around a [known Android issue](https://issuetracker.google.com/issues/164901843) that can cause crashes when creating `EncryptedSharedPreferences`, we've upgraded `androidx.security.crypto` from version `1.0.0` to `1.1.0-alpha04`. When `EncryptedSharedPreferences` cannot be created, the SDK now uses `SharedPreferences` (unencrypted).
58+
59+
If your app requires encryption, you can prevent this fallback to `SharedPreferences` by setting the `encryptionEnforced` configuration flag to `true`. However, if you enable this flag and `EncryptedSharedPreferences` cannot be created, an exception will be thrown.
60+
61+
- Improved JWT token management. This change addresses an issue where `null` values could prevent the refresh of a JWT token.
62+
63+
#### Fixed
1964

65+
- Fixed an issue which could prevent in-app messages from respecting the **Position** value selected when setting up the template (top / center / bottom / full).
66+
67+
- Fixed crashes that sometimes happened during in-app message animations.
68+
69+
## [3.4.10](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.4.10)
70+
This release includes support for encrypting some data at rest, and an option to
71+
store in-app messages in memory.
72+
73+
#### Encrypted data
74+
75+
In Android apps with `minSdkVersion` 23 or higher ([Android 6.0](https://developer.android.com/studio/releases/platforms#6.0))
76+
Iterable's Android SDK now encrypts the following fields when storing them at
77+
rest:
78+
79+
- `email` — The user's email address.
80+
- `userId` — The user's ID.
81+
- `authToken` — The JWT used to authenticate the user with Iterable's API.
82+
83+
(Note that Iterable's Android SDK does not store the last push payload at
84+
rest—before or after this update.)
85+
86+
For more information about this encryption in Android, examine the source code
87+
for Iterable's Android SDK: [`IterableKeychain`](https://github.com/Iterable/iterable-android-sdk/blob/master/iterableapi/src/main/java/com/iterable/iterableapi/IterableKeychain.kt).
88+
89+
#### Storing in-app messages in memory
90+
91+
This release also allows you to have your Android apps (regardless of `minSdkVersion`)
92+
store in-app messages in memory, rather than in an unencrypted local file.
93+
However, an unencrypted local file is still the default option.
94+
95+
To store in-app messages in memory, set the `setUseInMemoryStorageForInApps(true)`
96+
SDK configuration option (defaults to `false`):
97+
98+
_Java_
99+
100+
```java
101+
IterableConfig.Builder configBuilder = new IterableConfig.Builder()
102+
// ... other configuration options ...
103+
.setUseInMemoryStorageForInApps(true);
104+
IterableApi.initialize(context, "<YOUR_API_KEY>", config);
105+
```
106+
107+
_Kotlin_
108+
109+
```kotlin
110+
val configBuilder = IterableConfig.Builder()
111+
// ... other configuration options ...
112+
.setUseInMemoryStorageForInApps(true);
113+
IterableApi.initialize(context, "<YOUR_API_KEY>", configBuilder.build());
114+
```
115+
116+
When users upgrade to a version of your Android app that uses this version of
117+
the SDK (or higher), and you've set this configuration option to `true`, the
118+
local file used for in-app message storage (if it already exists) is deleted
119+
However, no data is lost.
120+
121+
#### Android upgrade instructions
122+
123+
If your app targets API level 23 or higher, this is a standard SDK upgrade, with
124+
no special instructions.
125+
126+
If your app targets an API level less than 23, you'll need to make the following
127+
changes to your project (which allow your app to build, even though it won't
128+
encrypt data):
129+
130+
1. In `AndroidManifest.xml`, add `<uses-sdk tools:overrideLibrary="androidx.security" />`
131+
2. In your app's `app/build.gradle`:
132+
- Add `multiDexEnabled true` to the `default` object, under `android`.
133+
- Add `implementation androidx.multidex:multidex:2.0.1` to the `dependencies`.
134+
135+
## [3.4.9](https://github.com/Iterable/iterable-android-sdk/releases/tag/3.4.9)
20136
#### Added
21137
- Added new methods for `setEmail`, `setUserId` and `updateEmail` which accepts `authToken`, providing more ways to pass `authToken` to SDK
22138
- Added two interface methods - `onTokenRegistrationSuccessful` and `onTokenRegistrationFailed`. Override these methods to see if authToken was successfully received by the SDK.

app/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,25 @@ android {
2020
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2121
multiDexEnabled true
2222
}
23+
2324
buildTypes {
2425
release {
2526
minifyEnabled false
2627
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2728
}
29+
2830
debug {
2931
testCoverageEnabled true
3032
}
3133
}
3234

3335
testOptions.unitTests.includeAndroidResources = true
36+
3437
compileOptions {
3538
sourceCompatibility = 1.8
3639
targetCompatibility = 1.8
3740
}
41+
3842
kotlinOptions {
3943
jvmTarget = "1.8"
4044
}
@@ -73,9 +77,11 @@ dependencies {
7377
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
7478
androidTestImplementation 'br.com.concretesolutions:kappuccino:1.2.1'
7579
}
80+
7681
tasks.withType(Test) {
7782
jacoco.includeNoLocationClasses = true
7883
}
84+
7985
task jacocoDebugTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
8086
group = "reporting"
8187
description = "Generate unified Jacoco code coverage report"
@@ -103,12 +109,14 @@ task jacocoDebugTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest'])
103109
'**/*$ModuleAdapter.class',
104110
'**/*$ViewInjector*.class',
105111
]
112+
106113
def debugTree = fileTree(dir: "${buildDir}/intermediates/javac/debug/classes", excludes: fileFilter) //we use "debug" build type for test coverage (can be other)
107114
def sdkTree = fileTree(dir: "${buildDir}/../../iterableapi/build/intermediates/javac/debug/classes", excludes: fileFilter)
108115
def sdkUiTree = fileTree(dir: "${buildDir}/../../iterableapi-ui/build/intermediates/javac/debug/classes", excludes: fileFilter)
109116
def mainSrc = "${project.projectDir}/src/main/java"
110117
def sdkSrc = "${project.projectDir}/../iterableapi/src/main/java"
111118
def sdkUiSrc = "${project.projectDir}/../iterableapi-ui/src/main/java"
119+
112120
sourceDirectories.from = files([mainSrc])
113121
classDirectories.from = files([debugTree])
114122
additionalSourceDirs.from = files([sdkSrc, sdkUiSrc])
@@ -121,11 +129,13 @@ task jacocoDebugTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest'])
121129
task jacocoDebugAndroidTestReport(type: JacocoReport, dependsOn: ['connectedCheck']) {
122130
group = "reporting"
123131
description = "Generate Jacoco code coverage report for instumentation tests"
132+
124133
reports {
125134
xml.enabled = true
126135
html.enabled = true
127136
csv.enabled = false
128137
}
138+
129139
def fileFilter = [
130140
'**/*Test*.*',
131141
'**/AutoValue_*.*',
@@ -145,12 +155,14 @@ task jacocoDebugAndroidTestReport(type: JacocoReport, dependsOn: ['connectedChec
145155
'**/*$ModuleAdapter.class',
146156
'**/*$ViewInjector*.class',
147157
]
158+
148159
def debugTree = fileTree(dir: "${buildDir}/intermediates/javac/debug/classes", excludes: fileFilter) //we use "debug" build type for test coverage (can be other)
149160
def sdkTree = fileTree(dir: "${buildDir}/../../iterableapi/build/intermediates/javac/debug/classes", excludes: fileFilter)
150161
def sdkUiTree = fileTree(dir: "${buildDir}/../../iterableapi-ui/build/intermediates/javac/debug/classes", excludes: fileFilter)
151162
def mainSrc = "${project.projectDir}/src/main/java"
152163
def sdkSrc = "${project.projectDir}/../iterableapi/src/main/java"
153164
def sdkUiSrc = "${project.projectDir}/../iterableapi-ui/src/main/java"
165+
154166
sourceDirectories.from = files([mainSrc])
155167
classDirectories.from = files([debugTree])
156168
additionalSourceDirs.from = files([sdkSrc, sdkUiSrc])
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:tools="http://schemas.android.com/tools"
3-
package="iterable.com.iterableapi">
2+
<manifest xmlns:tools="http://schemas.android.com/tools" package="iterable.com.iterableapi">
43
<uses-sdk tools:overrideLibrary="br.com.concretesolutions.kappuccino,android_libs.ub_uiautomator"/>
54
</manifest>

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="com.iterable.iterableapi.testapp">
4-
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.iterable.iterableapi.testapp">
53
<application
64
android:allowBackup="true"
75
android:icon="@mipmap/ic_launcher"
@@ -14,10 +12,8 @@
1412
android:theme="@style/AppTheme.NoActionBar">
1513
<intent-filter>
1614
<action android:name="android.intent.action.MAIN" />
17-
1815
<category android:name="android.intent.category.LAUNCHER" />
1916
</intent-filter>
2017
</activity>
2118
</application>
22-
23-
</manifest>
19+
</manifest>

iterableapi-ui/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ ext {
4848
siteUrl = 'https://github.com/Iterable/iterable-android-sdk'
4949
gitUrl = 'https://github.com/Iterable/iterable-android-sdk.git'
5050

51-
libraryVersion = '3.4.9'
51+
libraryVersion = '3.4.14'
5252

5353
developerId = 'davidtruong'
5454
developerName = 'David Truong'
@@ -60,7 +60,8 @@ ext {
6060
}
6161

6262
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
63-
if(hasProperty("mavenPublishEnabled")) {
63+
64+
if (hasProperty("mavenPublishEnabled")) {
6465
apply from: '../maven-push.gradle'
6566
}
6667

iterableapi-ui/src/main/java/com/iterable/iterableapi/ui/inbox/IterableInboxFragment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public void onListItemTapped(@NonNull IterableInAppMessage message) {
255255

256256
@Override
257257
public void onListItemDeleted(@NonNull IterableInAppMessage message, @NonNull IterableInAppDeleteActionType source) {
258-
IterableApi.getInstance().getInAppManager().removeMessage(message, source, IterableInAppLocation.INBOX);
258+
IterableApi.getInstance().getInAppManager().removeMessage(message, source, IterableInAppLocation.INBOX, null, null);
259259
}
260260

261261
@Override

iterableapi/build.gradle

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ android {
1111
minSdkVersion 16
1212
targetSdkVersion 27
1313

14-
buildConfigField "String", "ITERABLE_SDK_VERSION", "\"3.4.9\""
14+
buildConfigField "String", "ITERABLE_SDK_VERSION", "\"3.4.14\""
1515

1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
}
18+
1819
buildTypes {
1920
release {
2021
minifyEnabled false
@@ -25,11 +26,13 @@ android {
2526
multiDexEnabled true
2627
}
2728
}
29+
2830
testOptions.unitTests.all {
2931
testLogging {
3032
exceptionFormat "full"
3133
}
3234
}
35+
3336
testOptions.unitTests.includeAndroidResources = true
3437
}
3538

@@ -39,6 +42,7 @@ dependencies {
3942
api 'androidx.appcompat:appcompat:1.0.0'
4043
api 'androidx.annotation:annotation:1.0.0'
4144
api 'com.google.firebase:firebase-messaging:20.3.0'
45+
implementation "androidx.security:security-crypto:1.1.0-alpha04"
4246

4347
testImplementation 'junit:junit:4.12'
4448
testImplementation 'androidx.test:runner:1.3.0'
@@ -72,7 +76,7 @@ ext {
7276
siteUrl = 'https://github.com/Iterable/iterable-android-sdk'
7377
gitUrl = 'https://github.com/Iterable/iterable-android-sdk.git'
7478

75-
libraryVersion = '3.4.9'
79+
libraryVersion = '3.4.14'
7680

7781
developerId = 'davidtruong'
7882
developerName = 'David Truong'
@@ -84,12 +88,14 @@ ext {
8488
}
8589

8690
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
87-
if(hasProperty("mavenPublishEnabled")) {
91+
92+
if (hasProperty("mavenPublishEnabled")) {
8893
apply from: '../maven-push.gradle'
8994
}
9095

9196
task javadoc(type: Javadoc) {
9297
source = android.sourceSets.main.java.srcDirs
98+
excludes = ['**/*.kt']
9399
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
94100

95101
exclude '**/*.kt'
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<manifest xmlns:tools="http://schemas.android.com/tools"
3-
xmlns:android="http://schemas.android.com/apk/res/android"
4-
package="iterable.com.iterableapi">
2+
<manifest xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android" package="iterable.com.iterableapi">
53
<uses-sdk tools:overrideLibrary="android_libs.ub_uiautomator"/>
64
<application
75
android:label="IterableAPI"
8-
android:supportsRtl="true"/>
6+
android:supportsRtl="true" />
97
</manifest>

iterableapi/src/main/AndroidManifest.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
23
package="com.iterable.iterableapi">
34

45
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
5-
<application>
66

7+
<application>
78
<!--FCM-->
89
<service
910
android:name="com.iterable.iterableapi.IterableFirebaseMessagingService"
@@ -27,6 +28,8 @@
2728
android:exported="false"
2829
android:launchMode="singleTop"
2930
android:theme="@style/TrampolineActivity.Transparent"/>
31+
32+
<uses-library android:name="androidx.security" android:required="false" />
3033
</application>
3134

3235
<queries>

0 commit comments

Comments
 (0)