We upgraded the SDK from 2.2.1 to 2.3.2, but did not change anything in our js application (we did not find updates of the documentation).
We had no issues with the previous SDK and we are still using it in production.
When i connect to the application, I get connected and instantly disconnected from the websocket as you can see the logs
We end up with a websocket closing with this reason The decoded text message was too big for the output buffer and the endpoint does not support partial messages
Are there any updates we have to do (front or server side) ?
Furthermore, screen share does not seem to work anymore.
Additionnal question, are you planning to publish a npm package for the SDK, anytime soon ?
Related
I followed the instructions in the Rocket.chat documentation:
Removed the check mark from the gateway
added GCM keys from firebase
rebooted the server
Pushs seem to come, but the listener "pushnotificationreceived" is triggered only if I open the application immediately after the push should come or I am in the application during the push, if I have minimized the application and send myself a message, then there is no push.
If I throw the push myself through the firebase API, then the push works out as needed.
There is a suspicion that this is due to the fact that Rocket.chat sends push data in the data key, not notification (https://github.com/RocketChat/Rocket.Chat/blob/develop/app/push/server/gcm.js).
I also have an error in the Rocket logs.Chat:
"For devices running Android 8.0 or later, you need to specify the android_channel_id identifier. See https://github.com/raix/push/issues/341 for more information", but even with this error, push writes that it was sent successfully.
Please, checkout this post:
https://forums.rocket.chat/t/apple-push-notification-service-update-from-legacy-binary-protocol/12425/4
Also, consider asking dev questions at:
https://open.rocket.chat/channel/dev
Recently, i had to updated crashlytic dependency which requires firebase core dependency.
this leads to a strange remote config failure on devices without google play services support (Huawei devices and emulators).
Exception happens when i try to fetch remote config values :
await remoteConfig.fetch(expiration: const Duration(hours: x));
Exception: Unable to complete fetch. Reason is unknown but this could be due to lack of connectivity.
when i revert back changes for firebase_core initialisation, that line goes through and remote config successfully fetched.
tried updated all related dependencies to the latest versions with no success:
firebase_core: ^0.5.0+1
firebase_remote_config: ^0.4.0+2
regarding to this post and documentation remote config should not depend on google play services and it should fetch without any problem , also as in some other threads mentioned about restricted api key i did not restrict firebase api key. any help and insight would be highly appreciated.
Huawei devices run without Google Mobile Services (https://www.android.com/intl/en_uk/gms/) this means they don't have Google Play Services, some Firebase libraries depend on these and some don't, but because Firebase Remote Config is not open source, you can't know if it is using now or if it will in the future.
Your best bet would be to create an abstraction for yourself around Firebase Remote Config. Think of it as "Your App Remote Config". You can have an interface YourAppRemoteConfig that you implement to use Firebase, then when you either detect an error or you detect you are running on a Huawei device, you can implement another version of your interface using Huawei Remote Configuration.
Huawei Remote Configuration is as easy to use as Firebase Remote Config.
After signing up for the console and entering your data etc (here)
Add the dependencies:
implementation 'com.huawei.agconnect:agconnect-core:1.5.2.300'
implementation 'com.huawei.agconnect:agconnect-remoteconfig:1.5.2.300'
implementation 'com.huawei.hms:hianalytics:6.0.0.300'
And fetch, just like your question does with Remote Config:
config = AGConnectConfig.getInstance()
config.fetch(0) // a value of 0 here is for DEBUGGING ONLY, delete for prod (giving a 12 hour refresh period)
.addOnSuccessListener {
config.apply(it)
Log.d(TAG, "Applied")
//update based on RemoteConfig
}
Reference: https://blog.blundellapps.co.uk/remote-configuration-using-appgallery-connect/
Firebase Remote config:
Firebase did not rely on GMS at the beginning, but later versions used AAID of GMS, which led to dependency for GMS, but the new version in the 2nd half of this year cancelled the dependency on GMS, so currently the latest version does not depend on GMS.
Firebase Crashlytics: Depend on GMS. (tested on Huawei Mate 30 which doesn’t have GMS)
The crash log and crash information can be uploaded, but because there is no GMS, it is impossible to count the crash rate and other information.
Tested on Huawei Mate30 mobile phone(No Google GMS service), the crash log and related log events can be obtained,
but there is no information such as the crash rate.
I am looking for a solution to fetch geolocation periodically (every 1 minute) on mobile browser. I did some research and came to know that fetching geolocation in background (when phone is locked or webapp not active) is impossible. In foreground it works ok.
I am making a web app where I fetch user location and send it to my server. All works ok, until the point where user locks his/her phone. I tried many things for workarounds:
setInterval to get geolocation, works fine in foreground but fails in background
converted my web app into Android using cordova, but same problem existed
used https://github.com/mauron85/cordova-plugin-background-geolocation this plugin for android
works good in both foreground and background
but the same plugin does not work in iPhone (I did not tested it, I searched in Google before moving ahead)
Its not good to release my app with just one platform (android) support, thus this workaround also failed for me.
I also considered using serviceworkers for my web app but it seems issue persist for background
https://github.com/w3c/ServiceWorker/issues/745
I have another solution in mind, but before investing time in it, I wish to know if someone has tried it already.
I learnt about Push notifications:
Web app client registers to Push notification
It sends
subscriber object to my server
My server using this object sends
message to Push notification server
Push notification server
sends messages to my web app client
My web app client wakes up my
service worker for a brief period to show the notification message
As per google documentation:
Note: In the current implementation
of Chrome, whenever we receive a push message and we don't have our
site visible in the browser we must display a notification. That is,
we can't do it silently without the user knowing. If we don't
display a notification the browser automatically creates one to let
the user know that the app is doing work in the background.
I won't mind showing a permanent notification to users until my app is running. I am ready for this trade-off.
Now, my question is, at step 5, when I wake up the service worker **is there a chance I call my main.js (main web app) which might be running in background **, will fetch the geolocation and update it to my server?
Has someone tried this solution already with success or failure, please inform.
Can you try Page visibility Api, which listens for visibilitychange of a browser tab is hidden or switched to other tab (in case of browser). For mobiles, it's just a try.
src : https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API
or You can look into this answer too..
Detecting when screen is locked
The message counter in Worklight console(Check the screen shot) does not increase if Send Message (POST) from REST API Runtime Services is used to send push. What is an issue with that, do I need to do any configuration modification to make this work?
You may have found a defect in the product, to have it investigated you will need to open a service call (PMR) and await a responsive from the development team, whether this is indeed a defect.
If you say that when using the REST API, the 'messages' counter does not increase, but if using the adapter API it does increase, then that would be a defect...
I am having a problem under the following circumstances:
1. Running a webapp with both firebase sdk and angularfire initiated connections
2. App has been running in background. Meaning user has launched other apps. During that time, internet connectivity could have come and gone.
3. User brings webapp back into foreground as active app. Firebase connectivity via angularfire has been lost and updates have been lost as well. Hence "2way" binds to existing views/controllers are not longer current and will not re-establish/sync. Only recovery is to actively kill the app and restart.
This is obviously undesirable. I have currently attempted a bruit force method where I am issuing a goOnline() call at the beginning of each of my controllers in an attempt to always try to re-establish a connection but for services that expect a 2way bind, I am not sure that everything will sync up?
Any thought or guidance on this would be very helpful as this is a serious issue.