Giter Site home page Giter Site logo

Comments (6)

Ehesp avatar Ehesp commented on June 14, 2024 1

Hm yeah, the | undefined part is really saying "don't add this key/value pair".

We're checking for property exists, which in this case, it does so it goes into that trap. Maybe we should just convert them to !isUndefined()

from react-native-notifee.

Salakar avatar Salakar commented on June 14, 2024

@Eralyne could you try largeIcon: require('./Images/logo.png').uri - I think our docs might need updating

from react-native-notifee.

Eralyne avatar Eralyne commented on June 14, 2024

There doesn't seem to be an error thrown anymore but I have yet to test if the icon appears.

from react-native-notifee.

whenmoon avatar whenmoon commented on June 14, 2024

I am still getting the error:

Error: notifee.displayNotification(*) 'notification.android.largeIcon' expected a string value

with the code:

largeIcon: require('../../assets/large-notification-icon.jpg').uri,

from react-native-notifee.

roni-castro avatar roni-castro commented on June 14, 2024

It also happens if you try using an url. I think the types needs to be updated or fixed, as most properties (largeIcon, title, subtitle, body, data...) have invalid type definition:
Captura de Tela 2020-06-03 às 16 58 19

This works:

 android: {
      largeIcon: 'https://repository-images.githubusercontent.com/226108661/7d2c3380-1aab-11ea-885e-f3466be45c26'
}

Captura de Tela 2020-06-03 às 16 57 29

This does not work:

 android: {
      largeIcon: ''
}

This does not work:

 android: {
      largeIcon: undefined
}

Error:

Possible Unhandled Promise Rejection (id: 0):
Error: notifee.displayNotification(*) 'notification.android.largeIcon' expected a string value.
Error: notifee.displayNotification(*) 'notification.android.largeIcon' expected a string value.
    at NotifeeApiModule.displayNotification (blob:file:///2bf99935-1ffc-4fef-bd95-58d94339e3ae:141175:17)
    at showNotification$ (blob:file:///2bf99935-1ffc-4fef-bd95-58d94339e3ae:1849:68)
    at tryCatch (blob:file:///2bf99935-1ffc-4fef-bd95-58d94339e3ae:41180:19)
    at Generator.invoke [as _invoke] (blob:file:///2bf99935-1ffc-4fef-bd95-58d94339e3ae:41355:24)
    at Generator.prototype.<computed> [as next] (blob:file:///2bf99935-1ffc-4fef-bd95-58d94339e3ae:41223:23)
    at tryCatch (blob:file:///2bf99935-1ffc-4fef-bd95-58d94339e3ae:41180:19)
    at invoke (blob:file:///2bf99935-1ffc-4fef-bd95-58d94339e3ae:41256:22)
    at blob:file:///2bf99935-1ffc-4fef-bd95-58d94339e3ae:41266:15
    at tryCallOne (blob:file:///2bf99935-1ffc-4fef-bd95-58d94339e3ae:45659:14)
    at blob:file:///2bf99935-1ffc-4fef-bd95-58d94339e3ae:45760:17

from react-native-notifee.

Salakar avatar Salakar commented on June 14, 2024

This has been fixed in 0.6.2 - changelog still to do but theres only 1 breaking change, renaming usages of Importance to AndroidImportance. Please give it a try, you only need the require now, without .uri

Thanks

from react-native-notifee.

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.