18

I've been trying to find a react-native module which allows custom notification templates for Android. I've tried https://github.com/neson/react-native-system-notification and https://github.com/zo0r/react-native-push-notification but it seems that they do not allow a custom template for the android notification - only setting the default template values. I am trying to achieve something similar to this:

enter image description here

1
  • 6
    Did you solve this problem? Commented May 25, 2017 at 21:02

2 Answers 2

1

You can you use react-native-music-control library to move your music controls at the notification panel.

You can customize it as you like with the following method. Read documentation for more.

  MusicControl.setNowPlaying({ 
title: 'Billie Jean',
artwork: 'https://i.imgur.com/e1cpwdo.png', // URL or RN's image require()
artist: 'Michael Jackson',
album: 'Thriller',
genre: 'Post-disco, Rhythm and Blues, Funk, Dance-pop',
duration: 294, // (Seconds)
description: '', // Android Only
color: 0xFFFFFF, // Notification Color - Android Only
date: '1983-01-02T00:00:00Z', // Release Date (RFC 3339) - Android Only
rating: 84, // Android Only (Boolean or Number depending on the type)
notificationIcon: 'my_custom_icon' // Android Only (String), Android Drawable resource name for a custom notification icon
})

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

0

You can also try this react-native-track-player package it will help you to show controls event the phone is locked.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.