NativeScript / nativescript-background-http

Background Upload plugin for the NativeScript framework
Apache License 2.0
101 stars 50 forks source link

Update to create a notification channel for SDK 26 and up #140

Closed pauly815 closed 6 years ago

pauly815 commented 6 years ago

PR Checklist

What is the current behavior?

#136 #124

What is the new behavior?

Updated background-http.android.ts to check the current SDK version. If SDK 26 or higher, a default notification channel is created and set in the notification config.

This update has been tested on a Samsung S8 emulator running Android 8 and a Samsung S6 running Android 7.

One thing to note, I tried to use the Build.VERSION_CODES.O constant but it didn't seem to work when running on a Samsung S6 with Android 7.

Fixes/Implements/Closes #[136].

pauly815 commented 6 years ago

Just realized that this is like Pull Request #126. I am using nativescript angular. Is there any update on a resolution cause my app won't work in Android 8 without these changes.

pauly815 commented 6 years ago

@lini I made updates per your suggestions. I re-tested on the same emulator and device as before to confirm the fix still works with the new changes.

zbranzov commented 6 years ago

Hi @pauly815 , Can you send an app so we can reproduce the issue? Currently, using the demo-angular sample from the repository, we are unable to reproduce your case. We are testing on Nexus 5x and Pixel 2 (both Android 8.1) and latest plugin version. Additionally, the fix seems to duplicate a native code from the native library that plugin is using https://github.com/gotev/android-upload-service/blob/e1528d3b5049a10817fdfb8745d35e7ba580a37f/uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java#L126

pauly815 commented 6 years ago

@zbranzov I can't send the app that I'm having the issue with but I'll see if I can replicate the problem with the demo-angular app. Maybe it's a plugin conflict issue.

pauly815 commented 6 years ago

@zbranzov Looks like the latest 3.2.6 update resolved the issue. I was able to upload in my app without the fix in this pull request.