Comments (10)
Just aded :
super(context, bundle, appLifecycleFacade, new AppLaunchHelper(), new JsIOHelper());
Seems to work as expected. Can you update the wiki?
Also, if we can have some leads to have the behavior described in the first post, it'll be very helpful since I added an Hight priority but I still have no banner with my Push :(
from react-native-notifications.
Same issue in here.
from react-native-notifications.
It seems that this type of notification is called Heads-up notifications
on Android (https://developer.android.com/guide/topics/ui/notifiers/notifications.html#Heads-up) but the default behavior is just to have an icon :/
We can definitely set a higher priority and so on, but not sure how we can display this banner on the home screen
from react-native-notifications.
Is this still relevant?
from react-native-notifications.
Yes... Can we have this as the default behavior?
I tried to override PushNotification
but I've an issue since the wiki said we have to write something like :
public class MyPushNotification extends PushNotification {
public MyPushNotification(Context context, Bundle bundle, AppLifecycleFacade appLifecycleFacade) {
super(context, bundle, appLifecycleFacade);
}
I tried, but the super constructor
wants 5 arguments... How can I solve this issue?
from react-native-notifications.
Sure, thank you!
from react-native-notifications.
Any updates on this?
from react-native-notifications.
I was able to make a heads-up notification appear by adding
builder.setPriority(PRIORITY_HIGH);
to the class:
public class PushNotificationBanner extends PushNotification {
public PushNotificationBanner(Context context, Bundle bundle, AppLifecycleFacade appLifecycleFacade, AppLaunchHelper appLaunchHelper, JsIOHelper jsIoHelper) {
super(context, bundle, appLifecycleFacade, appLaunchHelper, jsIoHelper);
}
@Override
protected Notification.Builder getNotificationBuilder(PendingIntent intent) {
final Resources resources = mContext.getResources();
// First, get a builder initialized with defaults from the core class.
final Notification.Builder builder = super.getNotificationBuilder(intent);
// Set our custom overrides --
// Enable 'extended' layout (extends on down-stroke gesture):
final Notification.BigTextStyle extendedNotificationStyle =
new Notification.BigTextStyle()
.bigText(mNotificationProps.getBody()); // "4:15 - 5:15 PM\nBig Conference Room"
builder.setStyle(extendedNotificationStyle);
// Set custom-action icon.
builder.setSmallIcon(R.drawable.ic_launcher);
// Set high priority for notification
builder.setPriority(PRIORITY_HIGH);
return builder;
}
}
from react-native-notifications.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest Detox and report back. Thank you for your contributions.
from react-native-notifications.
The issue has been closed for inactivity.
from react-native-notifications.
Related Issues (20)
- Notifications android refreshToken() not in package but in API docs
- IOS background and foreground notification is not working
- How to set batch count for android
- App relaunch on notification click. HOT 1
- Cannot read property 'refreshToken' of null. HOT 1
- registerNotificationOpened is not called when app is in foreground. HOT 1
- Crash app when recieve Notification in IOS 14 HOT 6
- Fix API Documentation so that postLocalNotification works - Includes fix HOT 1
- [iOS] getInitialNotification returnsthe notification even when the app was opened without tapping it HOT 2
- app crashes receiving a notification during startup
- How do I even use this package?
- registerNotificationOpened isn't working as expected in iOS HOT 1
- `startObserving` method call is happening post send event call
- Android 10 and below: NullPointerException: Attempt to invoke virtual method 'int android.content.Intent.getFlags()' on a null object reference HOT 1
- Invariant Violation: new NativeEventEmitter() requires a non-null argument.
- Update Robolectric version
- Subscriptions to topics
- "$" getting copied HOT 1
- Code that setting NotificationChannel sound on Android might lead unexpected consequences HOT 1
- Application does not trigger registerNotificationOpened when it is closed, only when it is in the background.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-notifications.