GithubHelp home page GithubHelp logo

Comments (4)

fortesdev avatar fortesdev commented on August 17, 2024

Hi @moustafadevrn, in our Example app (included within the SDK), HomeScreen.js file, function HomeScreen, block code of useEffect, I added the following:

mobileMessaging.subscribe( 'messageReceived', eventData => { console.log('Event received', eventData); } );

Then I triggered a notification through chat message, broadcasted a regular push, and also a In-App push through Moments, and all three printed the 'Event received' and its content on my real iOS device, even with the app in background. I don't know what the issue in your end is, could you please retry with our Example app perhaps?

from mobile-messaging-react-native-plugin.

moustafadevrn avatar moustafadevrn commented on August 17, 2024

Hello @fortesdev

Thank you for your suggestion. I actually tried the same line of code you mentioned. However, the event is not triggered as you suggested.

As I mentioned before, the notification is not received while the app is in the foreground.

Furthermore, I have searched for the code block you mentioned in the HomeScreen.js file located in the Example folder of the SDK, but I couldn't find any code like that.

from mobile-messaging-react-native-plugin.

fortesdev avatar fortesdev commented on August 17, 2024

Hi @moustafadevrn,

I wrote that "I added" that line of code (that you can write as well, not to search for it), in line 11 here.

And it works on my testing:
App in foreground, broadcasting regular push => event received (notification not visible as it is silent)
App in foreground, chat message received, but chat not present => event received (notification visible)
App in foreground, chat message received, but chat present => event and notification not received by design, as explained here.

If you still face issues, feel free to check/share [MobileMessaging] console logs (excluding your ids/secrets), but also test with our Example if possible.

from mobile-messaging-react-native-plugin.

riskpp avatar riskpp commented on August 17, 2024

I'll close the issue due to inactivity, feel free to reopen it if needed.

from mobile-messaging-react-native-plugin.

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.