Giter Club home page Giter Club logo

react-native-notification-banner's Introduction

PRs Welcome

ReactNative: Native Notification Banner (Android/iOS)

If this project has helped you out, please support us with a star ๐ŸŒŸ

A simple lightweight dropdown banner library using creates native capabilities

Android

Tapadoo/Alerter

iOS

bryx-inc/BRYXBanner

๐Ÿ“– Getting started

$ yarn add react-native-notification-banner

RN61 >= RNBAS V2 >

  • Add react-native-image-helper your app package.json

$ npm install react-native-image-helper --save

  • Add react-native-vector-icons to your app package.json and configure it as per their installation steps

$ npm install react-native-vector-icons --save

  • iOS

    • Add the following to your Podfile -> ios/Podfile and run pod update:
    use_native_modules!
    
    pod 'RNNotificationBanner', :path => '../node_modules/react-native-notification-banner/ios'
    
    use_frameworks!
    
    pod 'BRYXBanner', :git => 'https://github.com/prscX/BRYXBanner.git', :branch => 'master'
    
    post_install do |installer|
     installer.pods_project.targets.each do |target|
       if target.name.include?('BRYXBanner')
         target.build_configurations.each do |config|
           config.build_settings['SWIFT_VERSION'] = '4.2'
         end
       end
     end
    end
    
  • Android

Please add below snippet into your app build.gradle

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

RN60 >= RNNB V1 >

$ yarn add react-native-vector-icons

RN60 above please use react-native-notification-banner V1 and above

  • iOS

    • Add the following to your Podfile -> ios/Podfile and run pod update:
    use_native_modules!
    
    pod 'RNNotificationBanner', :path => '../node_modules/react-native-notification-banner/ios'
    
    use_frameworks!
    
    pod 'BRYXBanner', :git => 'https://github.com/prscX/BRYXBanner.git', :branch => 'master'
    
    post_install do |installer|
     installer.pods_project.targets.each do |target|
       if target.name.include?('BRYXBanner')
         target.build_configurations.each do |config|
           config.build_settings['SWIFT_VERSION'] = '4.2'
         end
       end
     end
    end
    
  • Android

Please add below snippet into your app build.gradle

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
    }
}

RN60 < RNNB V1 <

RN60 below please use react-native-notification-banner V.0.*

$ react-native link react-native-notification-banner

$ react-native link react-native-vector-icons

  • iOS

    • After react-native link react-native-notification-banner, please verify node_modules/react-native-notification-banner/ios/ contains Pods folder. If does not exist please execute pod install command on node_modules/react-native-notification-banner/ios/, if any error => try pod repo update then pod install

    • After verification, open your project and create a folder 'RNNotificationBanner' under Libraries.

    • Drag node_modules/react-native-notification-banner/ios/pods/Pods.xcodeproject into RNNotificationBanner, as well as the RNNotificationBanner.xcodeproject if it does not exist.

    • Add the BRYXBanner.framework into your project's Embedded Binaries and make sure the framework is also in linked libraries.

    • Go to your project's Build Settings -> Frameworks Search Path and add ${BUILT_PRODUCTS_DIR}/BRYXBanner non-recursive.

    • Now build your iOS app through Xcode

  • Android

Please add below snippet into your app build.gradle


buildscript {
    repositories {
        jcenter()
        maven { url "https://maven.google.com" }
		...
    }
	...
}


allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
		maven { url "https://maven.google.com" }
		...
    }
}

Note: This library is support on Android 27 > above

๐Ÿ’ป Usage

import { RNNotificationBanner } from 'react-native-notification-banner';

import Icon from 'react-native-vector-icons/FontAwesome'
let copy = <Icon name="copy" size={24} color="#FFFFFF" family={"FontAwesome"} />;

RNNotificationBanner.Show({
  title: "Message",
  subTitle: "Message",
  withIcon: true,
  icon: copy,
  titleColor: "#FFFFFF",
  subTitleColor: "#FFFFFF",
  isSwipeToDismissEnabled: true,
})

Note:

  • We have added family prop for Icon class, please make sure that you pass the props

๐Ÿ’ก API's

Success, Error, Info, Warn, Normal, Show

๐ŸŽจ Props

Prop Type Default Note
title string Specify title of banner
subTitle string Specify subtitle of banner
tintColor HEX-COLOR Specify tint color of banner
withIcon bool Enable/Disable icon
icon RNVectorIcon Specify banner icon
duration int Specify duration to show banner
enableProgress bool false Specify to show progress on banner
onClick func Specify onClick callback
onHide func Specify onHide callback

Icons

	let facebook = <Icon family={'FontAwesome'} name={'facebook'} color={'#000000'} size={30} />

    RNNotificationBanner.Success({ title: "Message", subTitle: "Message", withIcon: true, icon: copy})

Note:

  • We have added family prop for Icon class, please make sure that you pass the props

โœจ Credits

๐Ÿค” How to contribute

Have an idea? Found a bug? Please raise to ISSUES. Contributions are welcome and are greatly appreciated! Every little bit helps, and credit will always be given.

๐Ÿ’ซ Where is this library used?

If you are using this library in one of your projects, add it in this list below. โœจ

๐Ÿ“œ License

This library is provided under the Apache 2 License.

RNBottomActionSheet @ prscX

๐Ÿ’– Support my projects

I open-source almost everything I can, and I try to reply everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).

However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:

  • Starring and sharing the projects you like ๐Ÿš€

  • If you're feeling especially charitable, please follow prscX on GitHub.

    Buy Me A Coffee

    Thanks! โค๏ธ
    prscX.github.io
    </ Pranav >

react-native-notification-banner's People

Contributors

andrejcesen avatar b3da-cz avatar eredessil avatar jpig avatar prscms avatar prscx avatar saeedzhiany avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-notification-banner's Issues

Notch support

Hello Pranav, how's going?

First, thanks for providing such an amazing tool for us to work. Now the problem. How can I support devices with a notch, such as Iphone X. There's an offset param?

Thanks

iOS installation

I have not had any luck implementing either this lib, or your https://github.com/prscX/react-native-fluidic-slider lib, with ios. They use kind of the same installation pattern.

Is there a reason for the setup using this specific pattern, or would it be possible to install them the way most libs do. I.e adding needed pods to to the project own podfile and os on.

Also BRYXbanner throws this error for me:
BRYXBanner does not specify a Swift version and none of the targets (...) integrating it have the SWIFT_VERSION` attribute set.

How did you get around it?

Notification showing multiple times

When a notification is received in the foreground, it's rendering 3-4 times for a single notification.

Here is my code, please have a look :


  RNNotificationBanner.Show({
                        title: title && title != '' ? title : '',
                        subTitle: body && body != '' ? body : '',
                        tintColor: '#406FCA', onClick: this.onClickNotificationBanner.bind(this, notification)
                    })

Statusbar reset

When I trigger notification banner from a function it dismiss my statusbar color. See the difference before after trigging.
Screenshot_1594894012
Screenshot_1594894002

Can this banner override react-native-modal

I use react-native-modal and this banner can override the modal window only if the modal window is set to coverScreen={false}.

Is it possible to somehow improve your banner so that it is higher than the modal window, if it has a coverScreen={true}?

Android: Could not find com.tapadoo.android:alerter:2.0.6.

Bug Report

Can't get android to build the following error is thrown when building the app:

Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.tapadoo.android:alerter:2.0.6.
     Searched in the following locations:

Environment

"react": "17.0.2"
"react-native": "0.66.4"
Platform(s) (iOS, Android, or both?): Android
"react-native-notification-banner": "^2.0.0"

Image/Photo option in addition to icon

This is a suggestion, who would be really appreciated for me.
It would be great if we can pass another param instead of icon, like image with image path, if we prefer image in some case.
I have a notification for new comment in my application, and it would be great if a rounded profil image (jpg) of user can be shown.

Thx.

iOS installation

I'm not able to build the dependency for iOS. I get 'BRYXBanner/BRYXBanner-Swift.h' file not found and I don't know why.
Any help, please? Thanks in advance!

Options for styling

Hello,

We are running into an issue about styling the notification banner. We would like to see the options title and sub title alignment (left, center, right) to be added into the package. Maybe only when the icon is hidden or just this option in general would be fine.

Kind regards,

Jordy Ortega
X-Guard

Swift Compiler Error

i have problem with react-native-notification-banner V0.7 it says swift compiler error, can you help me to solve it? thanks before

image

Use with Expo

Hello,
Does this dependency works on Expo? Trying to use it here, but without success.

Header not found error

I am running:

In my Podfile I have added the following, per the instructions:

  pod 'BRYXBanner', :git => 'https://github.com/prscX/BRYXBanner.git', :branch => 'master'

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      if target.name.include?('BRYXBanner')
        target.build_configurations.each do |config|
          config.build_settings['SWIFT_VERSION'] = '4.2'
        end
      end
    end
  end

When I run react-native run-ios I am getting this error:

RNNotificationBanner.h:3:9: fatal error: 'BRYXBanner/BRYXBanner-Swift.h' file not found
#import "BRYXBanner/BRYXBanner-Swift.h"

If I add use_frameworks! to the Podfile the error goes away.
If I change to use_modular_headers! the error also goes away.
Both of these settings impact other modules though, and in particular Firebase/Core has a problem when they are on.

Any workaround?

add custom component

Hi @prscX,
I want to add an input field into the notification banner, is this possible? if yes how can I do that?

thanks in advance,

Pods.xcodeproj is not found

I have added the library to my app and followed the installation instructions, but I can't find the Pods.xcodeproj. Everything else is there but this.

Has anyone had this issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.