Giter Site home page Giter Site logo

Comments (10)

Crash-- avatar Crash-- commented on July 24, 2024 5

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.

kristikristo avatar kristikristo commented on July 24, 2024

Same issue in here.

from react-native-notifications.

Crash-- avatar Crash-- commented on July 24, 2024

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.

d4vidi avatar d4vidi commented on July 24, 2024

Is this still relevant?

from react-native-notifications.

Crash-- avatar Crash-- commented on July 24, 2024

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?
capture d ecran 2017-01-02 a 17 09 02

from react-native-notifications.

d4vidi avatar d4vidi commented on July 24, 2024

Sure, thank you!

from react-native-notifications.

kaloncheung124 avatar kaloncheung124 commented on July 24, 2024

Any updates on this?

from react-native-notifications.

kaloncheung124 avatar kaloncheung124 commented on July 24, 2024

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.

stale avatar stale commented on July 24, 2024

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.

stale avatar stale commented on July 24, 2024

The issue has been closed for inactivity.

from react-native-notifications.

Related Issues (20)

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.