How to clear upload notification after upload is completed in nativescript - nativescript

I'm using nativescript plugin nativescript-background-http to upload files in background.
Writing only for Android.
Plugin works fine. Plugin displays upload progress in the notification, as required in API26+. When upload is completed (success or error), the notification remains in the drawer until dismissed by the user.
I'm looking for a way to clear the upload notification automatically after success or error.
Has anyone done this before? Guidance on how to access the underlying notification manager that the plugin uses would also be helpful as well.
Notes:
I can't hide the notification completely using androidDisplayNotificationProgress = false option of the plugin, as since API26, Android requires developers to use notifications when running background tasks.
I've searched this question, but couldn't find information about dismissing notifications of the plugin.
Thanks

Set androidAutoClearNotification to true.
(Android only) Used to set if notifications should be cleared
automatically upon upload completion. Default is false. Please note
that setting this to true will also disable the ringtones.

Related

Your page did not fire its `load` event within `60000ms` only on Github Actions

I have Cypress tests failing only on Github CI with this error:
Your page did not fire its `load` event within `60000ms`.
I assume this is because the Cypress browser is stuck loading something Github Actions environment is blocking. Tests run fine locally. However, because I do not have access to the browser console, I cannot know what is causing the error.
Based on Cypress the service screenshot the page loaded fine, though.
How can I either
Disable load event check in my Cypress tests, as I assume this is not a real issue
Access JavaScript logs or Network tab logs though Cypress service to confirm what could be the issue in Github Actions run-time environment
This is a SvelteKit based site.
It's not currently possible to opt-out of waiting for the load event: https://github.com/cypress-io/cypress/issues/788

Why Push Notification is not working on Android?

I had push notifications working some time ago, but it is not working anymore.
Is there any issue with Android 8.0?
I did not change the AndroidManifest.xml since the last working version and I checked up the http://docs.gluonhq.com/samples/pushnotes example again.
When sending the message and running the logcat I get the following error message:
No Channel found for pkg=[myPackageName], channelId=null, id=123456, tag=null, opPkg=[myPackageName], callingUid=10298, userId=0, incomingUserId=0, notificationUid=10298, notification=Notification(channel=null pri=2 contentView=null vibrate=default sound=null defaults=0x2 flags=0x10 color=0x00000000 category=event vis=PUBLIC)
This one too:
The Google Play services resources were not found. Check your project configuration to ensure that the resources are included
Any help appreciated!

Chrome.runtime.connect no longer identified?

I have an extension with a background page and a sandbox page where most of the content scripts execute.
Whenever I need to do an Ajax call it has to run in the background environment as otherwise I get a CORS error. Recently as of last week I believe, the chrome.runtime is no longer available in the sandbox environment for some reason. I can't find any notes etc about it and trying to figure out a solution how to communicate with background page now.
I had this in the sandbox environment to initialize a connect port to pass messages from an Ajax request
var ajaxCall = chrome.runtime.connect({name: "ajaxCall"});
Is there any info out there that I'm missing on why this change occurred and what are some possible workarounds?
Here's the output for chrome. 1st is the background page and 2nd is the sandbox. They used to be identical in both.

Chromecast sample sender application CastHelloText-chrome ends with error when trying to get session

I have problem with launching Google-Cast application similar to sample CastHelloText-chrome. I slightly modified example code for my specific purposes. The goal for creating this application is to send and show image data directly in Chromecast device.
Particularly the difference between official sample and my code is in message format and its content, sent by sender application. Sender application took png image coded by base64 and send through message bus with custom namespace. Receiver application get this message and use this as data source for html object <img>.
Error appears when I do this steps:
Reload sender page, checking console if any device found.
Send the form by just pushing enter on input box (text is ignored).
Now a popup from Chromecast extension shows. Next there are two scenarios:
3a) I confirm casting to device by choosing one from the list, then I get this error message in console:
onError: {"code":"channel_error","description":"Error: Timeout","details":null}
3b) I just click somewhere else, I get this error:
onError: {"code":"cancel","description":"User closed popup menu","details":null}
Both of errors are caused by calling function chrome.cast.requestSession in chromehellotext.html at line 161, but what's really wrong I don't know.
When I step sender script I realize that function sessionListener is never called. I know that something go wrong when code try to call chrome.cast.requestSession, where described error raises. So I need help if I missed about right way to use Google-Cast API or If this problem has something to do with networking issues.
Receiver application is registered on Google Cast SDK Developer Console and I'm testing on registered device with some serial number. I'm using Google Chrome in version 42.0.2300.2 canary (64-bit) and Chrome version 40.0.2214.111 (current stable I suppose). For testing I also tried to turn off Windows Firewall entirely but with no luck.
Edit:
There were some syntactic errors that caused error message described above.
It seems like you are trying to use the data/control channel to send an image; please don't do that; that channel is not meant to be used for large data communications; in fact it cannot send anything which approaches or exceeds 64k. If your goal is to send images from your local machine, you would need to run a local web server on your local machine and serve images through the web server.
For and easiest tutorial you can have a look to this tutorial.
It is well explained in this tutorial.
Chromecast Sender application
There is no need to maintain session by yourself.
just add button and enjoy casting
mCastManager.addMediaRouterButton(mediaRoutebtn);
I found a source of my problem. There was something wrong in receiver code - syntactic and runtime errors, so I must admit that my code wasn't functional. Now its working in terms of launching application and getting session.
Unfortunate thing is that the error message generated by Chromecast extension didn't match the actual error - at least it was a bit confusing when I didn't know what's really happening on receiver side without ability to debug the code.

Webkit desktop notification - has no method 'createHTMLNotification'

The webkit html notification (createHTMLNotification) work fine until yesterday. An error is appear (see below), the code has not change -> incompatible with the last version of chrome ?
Error message : Uncaught TypeError: Object #<NotificationCenter> has no method 'createHTMLNotification'
If I use the methode "createNotification", it's work fine but I need to use HTML notification.
The settings of chrome allowed the pop-up and notification for all website (and tests are in the code for check that).
Unfortunate, this feature has removed from chromium ...
see : https://plus.google.com/u/0/+GoogleChromeDevelopers/posts/8vWo8hq4pDm
http://developer.chrome.com/extensions/desktop_notifications.html
Warning: webKitNotifications.createHTMLNotification() in the web notifications API has been deprecated. The new web notifications API only allows text. Chrome notifications API will be promoted to stable soon and web notifications will be updated to use the new rich notifications format.
there is still hope.

Resources