-
Notifications
You must be signed in to change notification settings - Fork 1.6k
shouldEstablishDirectChannel not establishing connection on first app launch #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
+1 |
Anyone have a hunch as to why this might be occurring? Are there any steps that should definitely be taken before setting |
@rsattar Any word on this or if you guys will have a chance to take a look at this? |
Hmm, what you're doing makes sense, and that's what I'm doing too, but I'm connection on first launch also:
Where I've got:
And I'm being called on the first launch:
I'm also breakpointing in As a quick check, can you try explicitly setting your |
Okay, I've managed to reproduce the issue, and it is related to the bug in FirebaseInstanceID 2.0.2. A fix for this has already been made and should be getting released in the next release of Firebase. For now, a quick workaround is to simply add:
to your App Delegate. NOTE: This is safe to call on app startup, as it does not show the user notifications permissions dialog to the user. The dialog is only shown when you call |
Setting
What is the best way to stay up to date on Firebase releases so I can update when this issue is fixed in next release? Thanks for the help @rsattar ! |
Hmm, that is strange that it didn't fix the issue when you added We have a release notes page that shows the current releases and all the fixes/updates in them. Hope that helps! |
It actually worked when I "Allow" pushes. But if I deny pushes - I do not get the FCM connection on first launch. Though, in 2.0.0, if I deny pushes, my FCM connection does work on initial launch - which is what I was looking for. |
Hmm, thanks for the extra info @alanscarpa. I think I've found another issue which might be causing this! |
FYI, I've added a bug fix in #290. Unfortunately it's half of the fix, and the other half is in the Instance ID SDK. These should be available in the release after next, as I missed the window for the next launch. |
Fix released today in Firebase 4.3.0, FirebaseMessaging 2.0.4, and FirebaseInstanceID 2.0.4 |
Uh oh!
There was an error while loading. Please reload this page.
Describe your environment
Describe the problem
When launching an app for the first time, or after deleting and re-installing,
Messaging.messaging().shouldEstablishDirectChannel
does not establish the socket connection. If I shut down the app, and re-open it, then the socket connection is established.Steps to reproduce:
Messaging.messaging().isDirectChannelEstablished
This always returns false.
That is the problem in a nutshell. If I simply kill the app, and re-launch it, everything works as expected. The socket connection is made and the
MessagingConnectionStateChanged
notification is fired.Why is
Messaging.messaging().shouldEstablishDirectChannel
not connecting on my initial app launch?Relevant Code:
The text was updated successfully, but these errors were encountered: