-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MOB-10364 Support for In App JSON Only Messages #857
Conversation
@@ -414,7 +419,8 @@ private void processMessages() { | |||
InAppResponse response = handler.onNewInApp(message); | |||
IterableLogger.d(TAG, "Response: " + response); | |||
message.setProcessed(true); | |||
if (response == InAppResponse.SHOW) { | |||
|
|||
if (response == InAppResponse.SHOW || message.isJsonOnly()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sumeruchat I might be mis-reading this, but should this be !message.isJsonOnly()
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it looks like showMessage
immediately discards it. Sorry for the noise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, circling back — why pass it to showMessage
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line means we "show" the message and ignore whatever the return value from onNew was. In the showMessage method we will just simply consume jsonOnly messages without actually showing them. I agree it looks like a mistake should I try to do it differently?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll think about it and change this just for clarity later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. This isn't a big deal — feel free to leave it if you think that's best! Maybe just a comment?
setRead(message, true, null, null); | ||
message.setConsumed(true); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bradumbaugh here we will make sure we dont actually "show" jsonOnly messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few comments. We will look at the end-to-end test tomorrow. It seems that I am getting a jsonOnly message with flag set to false when I send a json only message from the backend.
|
||
message.inAppStorageInterface = storageInterface; | ||
if (html != null) { | ||
if (content.html != null && content.html.length() > 0 && !jsonOnly) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was suggested to be replaced with !content.html.isEmpty()
iterableapi/src/test/java/com/iterable/iterableapi/IterableInAppManagerTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. Updated the parsing of JSON only flag and tested end-to-end.
🔹 Jira Ticket(s) if any
✏️ Description
Support for JSON Only in app messages