Skip to content

Commit 9424d2d

Browse files
committed
Merge branch 'release/3.0.0'
# Conflicts: # AndroidSDK/src/com/leanplum/LeanplumInbox.java # AndroidSDK/src/com/leanplum/NewsfeedMessage.java # AndroidSDK/src/com/leanplum/internal/Constants.java # AndroidSDK/src/com/leanplum/internal/LeanplumManifestHelper.java # AndroidSDK/src/com/leanplum/internal/LeanplumManifestParser.java
2 parents 869c754 + d26c3b7 commit 9424d2d

File tree

151 files changed

+12158
-2191
lines changed

Some content is hidden

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

151 files changed

+12158
-2191
lines changed

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,28 @@ captures/
156156
# Keystore files
157157
*.jks
158158

159+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
160+
161+
# User-specific stuff:
162+
.idea/**/workspace.xml
163+
.idea/**/tasks.xml
164+
.idea/dictionaries
165+
.idea/vcs.xml
166+
.idea/copyright
167+
168+
# Sensitive or high-churn files:
169+
.idea/**/dataSources/
170+
.idea/**/dataSources.ids
171+
.idea/**/dataSources.xml
172+
.idea/**/dataSources.local.xml
173+
.idea/**/sqlDataSources.xml
174+
.idea/**/dynamic.xml
175+
.idea/**/uiDesigner.xml
176+
177+
# Gradle:
178+
.idea/**/gradle.xml
179+
.idea/**/libraries
180+
159181

160182
## CUSTOM
161183

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.

.idea/misc.xml

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

.idea/modules.xml

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

AndroidSDK/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.leanplum"
33
android:versionCode="1" android:versionName="1.0">
44

5-
<uses-sdk android:minSdkVersion="10" />
5+
<uses-sdk android:minSdkVersion="14" />
66

77
<!-- Minimum permissions needed for SDK to work -->
88
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

AndroidSDK/build.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ apply plugin: 'com.android.library'
22
apply plugin: 'com.jfrog.artifactory'
33
apply plugin: 'maven-publish'
44

5+
def COMPILE_SDK_VERSION=26
6+
def BUILD_TOOLS_VERSION='26.0.1'
7+
def SUPPORT_LIBRARY_VERSION='26.1.0'
8+
59
allprojects {
610
gradle.projectsEvaluated {
711
tasks.withType(JavaCompile) {
@@ -13,9 +17,9 @@ allprojects {
1317
dependencies {
1418
// Compile dependencies will be added as dependency in pom file.
1519
//noinspection GradleDynamicVersion
16-
compile 'com.android.support:support-v4:[10.0.0,26.+['
20+
compile "com.android.support:support-v4:[14.0.0,${SUPPORT_LIBRARY_VERSION}]"
1721
//noinspection GradleDynamicVersion
18-
compile 'com.android.support:appcompat-v7:[10.0.0,26.+['
22+
compile "com.android.support:appcompat-v7:[14.0.0,${SUPPORT_LIBRARY_VERSION}]"
1923

2024
// Provided dependencies are optional dependencies and will not show up in pom file.
2125
provided('com.google.android.gms:play-services-gcm:[8.3.0,)') {
@@ -30,8 +34,8 @@ dependencies {
3034
}
3135

3236
android {
33-
compileSdkVersion 25
34-
buildToolsVersion "25.0.2"
37+
compileSdkVersion COMPILE_SDK_VERSION
38+
buildToolsVersion BUILD_TOOLS_VERSION
3539
useLibrary 'org.apache.http.legacy'
3640
publishNonDefault true
3741

AndroidSDK/src/com/leanplum/ActionContext.java

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import android.support.annotation.NonNull;
2525
import android.text.TextUtils;
2626

27+
import com.leanplum.callbacks.VariablesChangedCallback;
2728
import com.leanplum.internal.ActionManager;
2829
import com.leanplum.internal.BaseActionContext;
2930
import com.leanplum.internal.CollectionUtil;
@@ -225,7 +226,7 @@ public String stringNamed(String name) {
225226
}
226227
}
227228

228-
private String fillTemplate(String value) {
229+
public String fillTemplate(String value) {
229230
if (contextualValues == null || value == null || !value.contains("##")) {
230231
return value;
231232
}
@@ -365,7 +366,7 @@ public void runActionNamed(String name) {
365366
// Try to start action "Chain to a new Message".
366367
Object messageAction = args.get(Constants.Values.ACTION_ARG);
367368
if (messageAction != null) {
368-
createActionContextForMessageId(messageAction.toString(), args, messageId, name);
369+
createActionContextForMessageId(messageAction.toString(), args, messageId, name, false);
369370
}
370371
}
371372
}
@@ -374,16 +375,29 @@ public void runActionNamed(String name) {
374375
* Return true if here was an action for this message and we started it.
375376
*/
376377
private boolean createActionContextForMessageId(String messageAction, Map<String, Object>
377-
messageArgs, String messageId, String name) {
378+
messageArgs, String messageId, String name, Boolean chained) {
378379
try {
379-
ActionContext actionContext = new ActionContext(messageAction,
380+
final ActionContext actionContext = new ActionContext(messageAction,
380381
messageArgs, messageId);
381382
actionContext.contextualValues = contextualValues;
382383
actionContext.preventRealtimeUpdating = preventRealtimeUpdating;
383384
actionContext.isRooted = isRooted;
384-
actionContext.parentContext = this;
385385
actionContext.key = name;
386-
LeanplumInternal.triggerAction(actionContext);
386+
if (chained) {
387+
LeanplumInternal.triggerAction(actionContext, new VariablesChangedCallback() {
388+
@Override
389+
public void variablesChanged() {
390+
try {
391+
ActionManager.getInstance().recordMessageImpression(actionContext.getMessageId());
392+
} catch (Throwable t) {
393+
Util.handleException(t);
394+
}
395+
}
396+
});
397+
} else {
398+
actionContext.parentContext = this;
399+
LeanplumInternal.triggerAction(actionContext);
400+
}
387401
return true;
388402
} catch (Throwable t) {
389403
Util.handleException(t);
@@ -410,7 +424,7 @@ private boolean isChainToExistingMessageStarted(Map<String, Object> args, String
410424
message.get(Constants.Keys.VARS));
411425
Object messageAction = message.get("action");
412426
return messageAction != null && createActionContextForMessageId(messageAction.toString(),
413-
messageArgs, messageId, name);
427+
messageArgs, messageId, name, true);
414428
}
415429
}
416430
}

0 commit comments

Comments
 (0)