question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Customize UploadNotificationConfig

See original GitHub issue

Hello,

I’m writing an android application and I need to customize the behavior of upload notifications. My app does several small uploads in a short moment so i would like to disable the ringtone sound and to hide the notifications on upload success.

These options can be managed in UploadNotificationConfig object of android-upload-service library (here the docs), but are not customizable during creation of new background-http task.

here, the lines involved in task creation:

background-http.android.ts

130. request.setNotificationConfig(new (<any>net).gotev.uploadservice.UploadNotificationConfig());
...
186. request.setNotificationConfig(new (<any>net).gotev.uploadservice.UploadNotificationConfig());

Do you have any suggestion on how to modify nativescript-background-http to enable these options without breaking too much the compatibility with ios platform? or maybe another way to get the same result?

thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
tomshabtaycommented, Nov 15, 2017

I edited the the background-http.android.ts file once again and made the notification disappear completely.

Please consider adding this functionally to your plugin in your next update.

Thanks!

The change that i made was to comment this section: var displayNotificationProgress = typeof options.androidDisplayNotificationProgress === "boolean" ? options.androidDisplayNotificationProgress : true; if (displayNotificationProgress) { request.setNotificationConfig(new (<any>net).gotev.uploadservice.UploadNotificationConfig()); }

0reactions
zbranzovcommented, Sep 10, 2019

Released in nativescript-background-http@4.1.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Bad notification for startForeground" error when using ...
So, in order to fix, you must create UploadNotificationConfig, set a notification channel then, you can set it to the upload request. Start...
Read more >
MultipartUploadRequest (Android Upload Service 3.0.1 ...
Sets the custom user agent to use for this upload request. ... public MultipartUploadRequest setNotificationConfig(UploadNotificationConfig config).
Read more >
Uploading image with MultiuploadRequest - Mobile
<uses-permission android:name=… ... setNotificationConfig(new UploadNotificationConfig()) .setMaxRetries(2) .startUpload(); //Starting the ...
Read more >
Android Upload Image using Android Upload Service
So its working absolutely fine. Now lets move ahead and create a android project. ... setNotificationConfig(new UploadNotificationConfig()).
Read more >
net.gotev.uploadservice.UploadRequest.self java code ...
origin: gotev/android-upload-service ... be displayed * @return self instance */ public B setNotificationConfig(UploadNotificationConfig config) { params.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found