Skip to content

Conversation

mithleshjs
Copy link

Extra Parameters Added:

  1. android_sound
  2. small_icon
  3. large_icon
  4. big_picture
  5. android_led_color
  6. android_background_data

post['url'] = data['uri'];
}

if(data['android_background_data'])
Copy link
Contributor

Choose a reason for hiding this comment

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

it would be nicer with a reduce:

post = ['android_background_data', ...].reduce( (post, key) {
  if (data[key]) {
    post[key] = data[key];
    delete data[key];
  }
  return post;
}, post);

@facebook-github-bot
Copy link

@mithleshjs updated the pull request.

@facebook-github-bot
Copy link

@mithleshjs updated the pull request.

3 similar comments
@facebook-github-bot
Copy link

@mithleshjs updated the pull request.

@facebook-github-bot
Copy link

@mithleshjs updated the pull request.

@facebook-github-bot
Copy link

@mithleshjs updated the pull request.

@mithleshjs
Copy link
Author

@flovilmart using reduce is causing build to fail and it overrides other params. I think it is best without a reduce.

@flovilmart
Copy link
Contributor

What do you mean it overrides other params and build is failing?

@mithleshjs
Copy link
Author

What I meant was that implementating reduce method as pointed by you is not working correctly.

@flovilmart
Copy link
Contributor

You mean with the ... ?

@mithleshjs
Copy link
Author

I was referring to this note by you.

post = ['android_background_data', ...].reduce( (post, key) {
if (data[key]) {
post[key] = data[key];
delete data[key];
}
return post;
}, post);

This method didn't work.

@flovilmart
Copy link
Contributor

post = keys.reduce((post, key) => {
  if (data[key]) {
    post[key] = data[key];
    delete data[key];
  }
  return post;
}, post);

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