Skip to content

Updated iOS alert object to display title and body detail #735

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

Merged
merged 5 commits into from
Aug 9, 2017

Conversation

repertus
Copy link
Contributor

This fix addresses the issue outlined in #539 by being able to now render the title and body keys from the alert object.

@natanrolnik
Copy link
Contributor

Thanks for the PR, @repertus !

Would you mind showing a screenshot of the result?

Also, could you please update the Changelog.md file as well, to contain your improvement?

@repertus
Copy link
Contributor Author

@natanrolnik

Here are the screenshots of the results and I have updated the Changelog.md to reflect the fix details:

Alert entered as a JSON object:
screen shot 2017-06-28 at 6 22 21 am

Title now reflected for the alert object containing title in the "Past Pushes":
screen shot 2017-06-28 at 6 23 41 am

Message now reflected in the "Pash Pushes" detail:
screen shot 2017-06-28 at 6 24 05 am

@repertus
Copy link
Contributor Author

@natanrolnik,

I will need you help looking at why the build failed in Travis with one of the newer versions of node.js.

@@ -39,7 +39,13 @@ const EXP_STATS_URL = 'http://docs.parseplatform.org/ios/guide/#push-experiments
let getMessage = (payload) => {
if(payload) {
let payloadJSON = JSON.parse(payload);
return payloadJSON.alert ? payloadJSON.alert : payload;
if (payloadJSON.alert.body) {
Copy link
Contributor

@natanrolnik natanrolnik Jun 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to check the type of payloadJSON.alert, like in the other changed file? Also, in case there is a body, could you also add the title?

Copy link
Contributor Author

@repertus repertus Jun 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@natanrolnik - So under PushDetails if an alert object contains title and body, would you like me to show both the title and message just below the title in smaller font size?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be ideal! Do you think you can do it? I think it makes sense to do it the best way we can if you are already touching these files.

And did you see my question? Don't we need to check the type of payloadJSON.alert, or it will always be an object here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@repertus Robert, we wanted to make a release in the next few days - if you could do these changes, it will enter in the next release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@natanrolnik,

Sorry I took so long to circle back, but I've been tied up. I was able to modify the component to display both the title and the body as part of detail by checking the existance of an tyeof objective to keep consistant as per your observation. Here is a screenshot.
screen shot 2017-08-09 at 8 29 55 am

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@natanrolnik,

Can you outline why the build is failing in Travis.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@repertus Sorry, I was afk for a few hours. Thanks for working on it!

@pungme
Copy link

pungme commented Jul 20, 2017

Hey this feature is neat!, @repertus do you have time to wrap it up? or can we help? How does it work in this case? @natanrolnik

Cheers

@natanrolnik natanrolnik merged commit 99cd752 into parse-community:master Aug 9, 2017
@natanrolnik
Copy link
Contributor

Merged! Thank you so much for your efforts, @repertus!

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.

3 participants