Skip to content
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

Fix Incorrect Notification Opened Events #357

Merged
merged 2 commits into from
Apr 2, 2018

Conversation

Nightsd01
Copy link
Contributor

@Nightsd01 Nightsd01 commented Apr 2, 2018

• The SDK was previously incorrectly sending 'notification opened' HTTP requests when notifications were received
• Fixed the issue so that this event is only triggered when the user opens a notification
• Added a test to ensure it doesn't occur in the future


This change is Reviewable

• The SDK was previously incorrectly sending 'notification opened' HTTP requests when notifications were received
• Fixed the issue so that this event is only triggered when the user opens a notification
• Added a test to ensure it doesn't occur in the future
• In some tests, the SDK was previously checking to make sure the last HTTP request was of a certain type, which caused some race condition issues. Changed it so that it will now check to see if the request was executed recently (since some other event, ie. registering the user, may occur but this shouldn't break the test)
@Nightsd01 Nightsd01 requested a review from jkasten2 April 2, 2018 17:57
@jkasten2
Copy link
Member

jkasten2 commented Apr 2, 2018

Review status: 0 of 7 files reviewed at latest revision, all discussions resolved.


iOS_SDK/OneSignalSDK/Source/OneSignal.m, line 1445 at r1 (raw file):

        // Notify backend that user opened the notification
        NSString *messageId = [customDict objectForKey:@"i"];
        [OneSignal submitNotificationOpened:messageId];

We should still count a message as opened if the app is in focus and it's display type is set to none if there is a message body.


Comments from Reviewable

• Changes the SDK so that it will correctly send a notification opened HTTP request even if the display type == None and the notification has content.
• However, this change also makes it so that the initialization handleNotificationOpened completion block does not get called
@jkasten2
Copy link
Member

jkasten2 commented Apr 2, 2018

Reviewed 5 of 7 files at r1, 2 of 2 files at r2.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@Nightsd01 Nightsd01 merged commit e602cb2 into master Apr 2, 2018
@Nightsd01 Nightsd01 deleted the notification_opened_event branch April 2, 2018 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants