Skip to content

Commit 022ea95

Browse files
authored
Merge pull request #730 from Iterable/feature/itbl-track-anon-user
[Feature] Unknown User Activation
2 parents 9576367 + d18a75c commit 022ea95

File tree

48 files changed

+11227
-51
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+11227
-51
lines changed

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ This project adheres to [Semantic Versioning](http://semver.org/).
2121
- Migrated embedded message OOTB views to use Material Design buttons for better UI consistency
2222
- Updated sample app Gradle configuration to use newer versions for better compatibility
2323

24+
## [3.6.0-beta3]
25+
26+
### Added
27+
- Added consent logging functionality for unknown user activation feature
28+
29+
### Changed
30+
- Enhanced unknown user activation with improved criteria fetching and user ID generation logic
31+
32+
### Fixed
33+
- Fixed unknown user activation to ensure criteria is fetched on foregrounding the app by default
34+
- Fixed unknown user ID generation to only occur once when multiple track calls are made
35+
- Fixed consent timestamp handling when consent is revoked
36+
2437
## [3.5.14]
2538
### Fixed
2639
- Fixed auth token refresh when app is in background, ensuring reliable token refresh in all app states.
@@ -63,6 +76,14 @@ IterableApi.initialize(context, apiKey, config);
6376
- Added support for providing a list of placement ids to sync only certain placement ids.
6477
- support for pre-release automation
6578

79+
## [3.6.0-beta2]
80+
81+
### Fixed
82+
- This release includes fixes for the Unknown user activation private beta:
83+
- Criteria is now fetched on foregrounding the app by default. This feature can be turned off setting enableForegroundCriteriaFetch flag to false.
84+
- Unknown user ids are only generated once when multiple track calls are made.
85+
- Unknown user activation is currently in private beta. If you'd like to learn more about it or discuss using it, talk to your Iterable customer success manager (who can also provide detailed documentation).
86+
6687
## [3.5.10]
6788

6889
### Added
@@ -109,6 +130,16 @@ IterableApi.initialize(context, apiKey, config);
109130
- Addressed a text truncation issue in Embedded Message templates for applications targeting Android 14 and Android 15.
110131
- Improved InboxActivity compatibility with edge-to-edge layouts, ensuring seamless handling of notches and display cutouts.
111132

133+
## [3.6.0-beta1]
134+
135+
#### Added
136+
- This release includes initial support for Unknown user activation, a feature that allows marketers to convert valuable visitors into customers. With this feature, the SDK can:
137+
- Fetch unknown user profile creation criteria from your Iterable project, and then automatically create Iterable user profiles for unknown users who meet these criteria.
138+
- Save information about a visitor's previous interactions with your application to their unknown user profile, after it's created.
139+
- Display personalized messages for unknown users (in-app, push, and embedded messages).
140+
- Merge unknown user profiles into an existing, known user profiles (when needed).
141+
- Unknown user activation is currently in private beta. If you'd like to learn more about it or discuss using it, talk to your Iterable customer success manager (who can also provide detailed documentation).
142+
112143
## [3.5.3]
113144
#### Fixed
114145
- Fixed an [issue](https://github.com/Iterable/react-native-sdk/issues/547) where the SDK would crash if the `IterableInAppMessage` object was null when consuming an in-app message.

app/.idea/workspace.xml

Lines changed: 135 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ dependencies {
5050
implementation 'androidx.annotation:annotation:1.1.0'
5151
implementation 'androidx.fragment:fragment:1.8.5'
5252
androidTestImplementation 'androidx.fragment:fragment-testing:1.8.5'
53+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
5354

5455
implementation project(':iterableapi')
5556
implementation project(':iterableapi-ui')

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
android:supportsRtl="true"
1111
android:usesCleartextTraffic="true"
1212
android:theme="@style/AppTheme">
13+
<activity
14+
android:name="com.iterable.androidsdk.UnknownUserTrackingTestActivity"
15+
android:exported="false" />
1316
<activity
1417
android:name="com.iterable.androidsdk.MainActivity"
1518
android:label="@string/app_name"
@@ -22,4 +25,5 @@
2225
</intent-filter>
2326
</activity>
2427
</application>
28+
2529
</manifest>

app/src/main/java/com/iterable/androidsdk/MainActivity.java

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
package com.iterable.androidsdk;
22

3+
import android.content.Intent;
34
import android.os.Bundle;
5+
46
import com.google.android.material.floatingactionbutton.FloatingActionButton;
57
import com.google.android.material.snackbar.Snackbar;
8+
69
import androidx.appcompat.app.AppCompatActivity;
710
import androidx.appcompat.widget.Toolbar;
11+
812
import android.view.View;
913
import android.view.Menu;
1014
import android.view.MenuItem;
1115

16+
import com.iterable.iterableapi.CommerceItem;
17+
import com.iterable.iterableapi.IterableApi;
1218
import com.iterable.iterableapi.testapp.R;
1319

20+
import org.json.JSONException;
21+
import org.json.JSONObject;
22+
23+
import java.util.ArrayList;
24+
import java.util.List;
25+
1426
public class MainActivity extends AppCompatActivity {
1527

1628
@Override
@@ -19,6 +31,8 @@ protected void onCreate(Bundle savedInstanceState) {
1931
setContentView(R.layout.activity_main);
2032
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
2133
setSupportActionBar(toolbar);
34+
//Below api key is used to display merge user feature
35+
IterableApi.initialize(this, "289895aa038648ee9e4ce60bd0a46e9c");
2236

2337
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
2438
fab.setOnClickListener(new View.OnClickListener() {
@@ -28,6 +42,46 @@ public void onClick(View view) {
2842
.setAction("Action", null).show();
2943
}
3044
});
45+
46+
findViewById(R.id.mainLayout).setOnLongClickListener(v -> {
47+
Intent intent = new Intent(this, UnknownUserTrackingTestActivity.class);
48+
startActivity(intent);
49+
return true;
50+
});
51+
52+
findViewById(R.id.btn_track_event).setOnClickListener(v -> IterableApi.getInstance().track("Browse Mocha"));
53+
54+
findViewById(R.id.btn_update_cart).setOnClickListener(v -> {
55+
List<CommerceItem> items = new ArrayList<>();
56+
items.add(new CommerceItem("123", "Mocha", 1, 1));
57+
IterableApi.getInstance().updateCart(items);
58+
});
59+
60+
findViewById(R.id.btn_buy_mocha).setOnClickListener(v -> {
61+
List<CommerceItem> items = new ArrayList<>();
62+
items.add(new CommerceItem("456", "Black Coffee", 2, 1));
63+
IterableApi.getInstance().trackPurchase(4, items);
64+
});
65+
66+
findViewById(R.id.btn_buy_coffee).setOnClickListener(v -> {
67+
List<CommerceItem> items = new ArrayList<>();
68+
items.add(new CommerceItem("456", "Black Coffee", 5, 1));
69+
IterableApi.getInstance().trackPurchase(5, items);
70+
});
71+
72+
findViewById(R.id.btn_set_user).setOnClickListener(v -> IterableApi.getInstance().setUserId("hani7"));
73+
74+
findViewById(R.id.btn_update_user).setOnClickListener(v -> {
75+
try {
76+
JSONObject jsonObject = new JSONObject();
77+
jsonObject.put("firstName", "Hani");
78+
IterableApi.getInstance().updateUser(jsonObject);
79+
} catch (JSONException e) {
80+
throw new RuntimeException(e);
81+
}
82+
});
83+
84+
findViewById(R.id.btn_logout).setOnClickListener(view -> IterableApi.getInstance().setUserId(null));
3185
}
3286

3387
@Override

0 commit comments

Comments
 (0)