Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

[QUESTION] In-App Notification Bug Question #2114

Closed
ghost opened this issue Aug 7, 2018 · 2 comments
Closed

[QUESTION] In-App Notification Bug Question #2114

ghost opened this issue Aug 7, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Aug 7, 2018

  • Your Rocket.Chat app version: 3.1.0 (204)
  • Your Rocket.Chat server version: 0.63.0
  • Device (or Simulator) you're running with: iPhone 8

The app isn't connecting to your server?
Make sure your server supports WebSocket. These are the minimum requirements for Apache 2.4 and Nginx 1.3 or greater.

I am working on a project that integrates Rocket.Chat into one of the tabs of a TabViewController. Just for some background: we create the user's account on our Rocket.Chat server upon sign up with our app. And we handle authorizing them via OAuth with our Rocket.Chat server upon the launch of the app. Once the OAuth process completes, we set the view controller of the Tab correlated with Rocket.Chat to the MainSplitViewController (the root of the app when authorized).

At this point, I am able to send a messages from other user and receive in-app notifications as expected. If I go to the Rocket.Chat tab, I am still able to get notifications as expected. I end up running into two issues once I start interacting with the app:

  1. When I go into a subscription's chat view and then go back to subscriptions, I still receive the in-app notification, but the SocketHandler function handleEventSubscription ends up handling an event that marks the message as read immediately, even though the subscription's chat view has been closed and the new message has not been read.

  2. When I tap preferences and the PreferencesViewController is presented or I go into a subscription's chat view and then tap the ChatTitleView to present the ChannelActionsViewController, and then return to the SubscriptionsViewController, I don't get any notifications whatsoever.

I know this issue doesn't occur with the Rocket.Chat app, but it does when Rocket.Chat is integrated as a single tab, and considering how most parts of Rocket.Chat aren't very modular and are reliant on specific view architecture in order to work properly, I can only assume that it has something to do with Rocket.Chat being nested into a TabViewController.

And for issue (2) I noticed that after returning back to the SubscriptionsViewController that the function webSocketDidReceiveMessage isn't even triggered when receiving a new message.

I was wondering if I could get some information about why you may think this is occurring and a possible work-around to fix these issues or if I could get a little more insight about how your in-app notification's are set up and why Notifications would just stop working after moving away from the SubscriptionsViewController

@ghost ghost changed the title In-App Notification Bug Question [QUESTION] In-App Notification Bug Question Aug 10, 2018
@Sameesunkaria
Copy link
Collaborator

@TannerJuby01 The in-app notifications rely on the realtime api to receive notifications (stream-notify-user/notification, this is the same stream used for desktop notifications). It does mean that if webSocketDidReceiveMessage is not called, then the app did not receive the notification.

One possible cause for this might be that the app lost connection to the server and did not renegotiate it. Ensure that you are receiving other messages over web-sockets.

Here's the PR for the in-app notifications, if you want to understand it in detail. #1504

@rafaelks
Copy link
Contributor

Thanks for the answer @Sameesunkaria, closing the issue for now!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants