-
Notifications
You must be signed in to change notification settings - Fork 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
Push notifications #9
Conversation
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.
Thanks for the review request - in general this looks good to me, a couple things to note about this:
-
The integrator is still going to have to create their own Prime for Push campaign in the Braze dashboard as described at https://www.braze.com/documentation/Web/#soft-push-prompts
-
The event to trigger that campaign ("prime-for-push" in that example in the documentation) will have to be logged somehow. If the desire is to do that prompt on initial page load, note further that logging that event will need to be embedded in the
messagingReadyCallback
foropenSession
, e.g.
appboy.openSession(function() {
appboy.logCustomEvent("prime-for-push");
});
to ensure that the soft prompt message will deliver. We have it slated to improve the behavior around message syncing and event logging in the future to prevent that necessity, but such is the current state.
- Also note that for anybody who has the
register_inapp
option set to false, this won't work of course, because the primer will not be displayed - I'm not sure how that option is exposed or not.
Also note it looks to me like the operations in this step https://www.braze.com/documentation/Web/#step-2-configure-your-site will also still need to be performed by the integrator:
|
thanks for all the feedback. yes we plan to have all of the additional integration steps (manifest, service-worker.js, etc), in our docs when this is pushed, referencing the Braze docs where applicable. |
Sounds good, I guess the only two things to make sure you think more about is that if you recommend that they log the event on page load through your integration, that probably won't work, because of the |
c1b2e76
to
0bce650
Compare
Cool. Reviewed this again.
|
@froodian - quick ping as we'd like to get this out by next wednesday. can you clarify my point 2/3? thanks! |
But unfortunately until then, if the event is going to be fired on page load, the only way that brand new users will get it on their first session is to use that Sounds good on all other points, thanks, sorry it took me a sec to reply. |
…r push notifications
great. i've reverted the one more thing for you @froodian - i noticed that for a first time visitor, when i log appboy.logCustomEvent('prime-for-push') before appboy fully loads, it'll get queued, and gets executed when the script loads, but the prime-for-push in app message doesn't come back. however, if i reload, and log the event again, it is queued, executed when the appboy script loads, then i do get the in app message. is that a bug related to what you were saying above regarding not the first page load? thanks and have a great weekend! |
So, that behavior sounds precisely like what logging inside the messagingReadyCallback should prevent. Are you saying you're seeing that behavior with the code that's currently in this request? I wouldn't expect that to be the case... when you call initialize, if you include The other thing that I would check is that your campaign is properly targeted at a segment which includes all users - no external id or previous events or attributes required, etc - and that the campaign has 0% going to the control group in its targeting phase. Additionally, you may want to control the "Allow users to become re-eligible to receive campaign" checkbox in the campaign if you want a given user to be able to see the prompt more than once - anonymous users will be persistently identified by cookies and localStorage, so unless both of those get cleared, they will remain the same user and will not receive the prompt more than once unless that box is checked. |
Thanks for the response @froodian. That was the behavior with the previous code when I allowed the integrator to choose when to log the Now I have the |
Awesome, yeah, that's what I'd expect - and the precise issue that I'm planning on solving within the SDK in a future version so that this won't be required any longer. Thanks, and this all looks good to me! |
Great. Will merge into the v2.2 PR and that will then go out tomorrow. Thanks again! |
This PR enables push notifications in MP's Braze SDK integration. I implemented a "soft push" as well, per Braze best practices for soft push prompts before the actual push notification request comes in.
A customer will follow along with the above instructions to set up a campaign, but can label the event whatever they want (not necessarily prime-for-push). Then in their app, they can call mParticle.logEvent('nameOfPushPrimerEvent') to activate.