-
Notifications
You must be signed in to change notification settings - Fork 262
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
Iam carousel page impressions #735
Conversation
1835641
to
daac10d
Compare
a95c174
to
f9975e3
Compare
0c88546
to
1cb389d
Compare
f6a0f33
to
be53dc8
Compare
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.
Looks good, just one nit on a comment clean up
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.
LGTM, nit comments
@@ -72,6 +75,8 @@ + (instancetype _Nullable)instanceWithJson:(NSDictionary *)json { | |||
action.closesMessage = [json[@"close"] boolValue]; | |||
else | |||
action.closesMessage = true; // Default behavior | |||
|
|||
[OneSignal onesignal_Log:ONE_S_LL_VERBOSE message:[NSString stringWithFormat:@"%@",json]]; |
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.
nit indentation comment, space before the json variable.
Is it clear that this log is from the OSInAppMessageAction" If not maybe add @"OSInAppMessageAction json: %@" introduction string
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.
fixed
@property (strong, nonatomic, nullable) OSInAppMessageAction *userAction; | ||
@end | ||
|
||
|
||
|
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.
remove extra enters
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.
fixed
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error]; | ||
|
||
if (error || !json) { | ||
[OneSignal onesignalLog:ONE_S_LL_ERROR message:[NSString stringWithFormat:@"Unable to decode in-app message JSON: %@", error.description ?: @"No Data"]]; |
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.
can this be in-app message page? just to know the error is from this log
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.
fixed
011c705
to
fbed254
Compare
@@ -372,7 +426,10 @@ - (void)setDataForRedisplay:(OSInAppMessage *)message { | |||
|
|||
[self.seenInAppMessages removeObject:message.messageId]; | |||
[self.impressionedInAppMessages removeObject:message.messageId]; | |||
[self.viewedPageIDs removeAllObjects]; |
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 shouldn't instead remove all objects from the message page ids?
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.
removed tracking from the message itself
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.
instead of removing all objects, should only remove the ids that have this IAM id prefix, right?
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.
It actually doesn't matter since at this point we have dismissed and are showing a different IAM, at which point we can resend the impressions so either way it will always be empty when a new IAM is showing. I would rather have some weird edge case that results in sending too many impressions than an edge case that results in not sending impressions.
|
||
NSString *messagePrefixedPageId = [message.messageId stringByAppendingString:pageId]; | ||
|
||
if ([[message getViewedPageIds] containsObject:pageId] || [self.viewedPageIDs containsObject:messagePrefixedPageId]) { |
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.
sry is not clear to me why we have pageIds under the message and a global list
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 removed it from the message!
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.
LGTM, just reset the URL back to normal before merging
940a588
to
1374c71
Compare
This PR adds SDK support for individual IAM Carousel page impressions.
It adds a new model
OSInAppMessagePage
and bridge event typeOSInAppMessageBridgeEventTypePageChange
that reads thepageId
from the newpage_change
event that is received from the carousel's javascript.To send the page impression we use the new pageImpression endpoint using the new request
OSRequestInAppMessagePageViewed
Page impressions are only sent once per Impression of a Carousel. The ids are tracked in a new set
viewedPageIds
on theOSInAppMessage
objectAdditionally we receive the pageId for click events, but do not currently use them.
This change is