-
Notifications
You must be signed in to change notification settings - Fork 33
ITBL-1286 Supports messageID for push opens on android. #6
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,7 @@ public final class IterableConstants { | |
| public static final String KEY_RECIPIENT_EMAIL = "recipientEmail"; | ||
| public static final String KEY_SEND_AT = "sendAt"; | ||
| public static final String KEY_TEMPLATE_ID = "templateId"; | ||
| public static final String KEY_MESSAGE_ID = "messageId"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like spacing didn't line up |
||
| public static final String KEY_TOKEN = "token"; | ||
| public static final String KEY_PLATFORM = "platform"; | ||
| public static final String KEY_APPLICATIONNAME = "applicationName"; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
| class IterableNotificationData { | ||
| private int campaignId; | ||
| private int templateId; | ||
| private String messageId; | ||
| private boolean isGhostPush; | ||
|
|
||
| IterableNotificationData(String data){ | ||
|
|
@@ -22,6 +23,10 @@ class IterableNotificationData { | |
| templateId = iterableJson.getInt(IterableConstants.KEY_TEMPLATE_ID); | ||
| } | ||
|
|
||
| if (iterableJson.has(IterableConstants.KEY_MESSAGE_ID)) { | ||
| messageId = iterableJson.getString(IterableConstants.KEY_MESSAGE_ID); | ||
| } | ||
|
|
||
| if (iterableJson.has(IterableConstants.IS_GHOST_PUSH)) { | ||
| isGhostPush = iterableJson.getBoolean(IterableConstants.IS_GHOST_PUSH); | ||
| } | ||
|
|
@@ -40,6 +45,8 @@ public int getTemplateId() | |
| return this.templateId; | ||
| } | ||
|
|
||
| public String getMessageId() { return this.messageId; } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be fine going forward right? before we make the change on the server, the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The server code should go out first since the old SDK won't process anything related to messageID. I'll deploy the mobile SDKs afterward. |
||
|
|
||
| public boolean getIsGhostPush() | ||
| { | ||
| return this.isGhostPush; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ public void onReceive(Context context, Intent intent) { | |
| IterableNotificationData iterableNotificationData = new IterableNotificationData(iterableDataString); | ||
| if (IterableApi.sharedInstance != null) { | ||
| IterableApi.sharedInstance.setNotificationData(iterableNotificationData); | ||
| IterableApi.sharedInstance.trackPushOpen(iterableNotificationData.getCampaignId(), iterableNotificationData.getTemplateId()); | ||
| IterableApi.sharedInstance.trackPushOpen(iterableNotificationData.getCampaignId(), iterableNotificationData.getTemplateId(), iterableNotificationData.getMessageId()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems like it would make sense to use the |
||
| } | ||
| } | ||
| } | ||
|
|
||
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.
are we guaranteed to always have a
messageId?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.
Are you always passing down a messageId along with every message sent from our servers (similar to campaignID/templateId)? If not then I'll check for an optional messageID.
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.
Yeah, I think it should always be set. In case you find that we aren't, lmk and I'll fix it.