-
-
Notifications
You must be signed in to change notification settings - Fork 50
Does not work with Android 8.0.0? #124
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
Related to #117, but the name of the issue is not correct, it's the name of the channel of notification that is null and not the namespace. It looks like it is only happening with nativescript-angular. |
It looks like for Android 8.0 we have to create a NotificationChannel. The code to do it in Java is located at https://github.com/gotev/android-upload-service/blob/master/uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java in the function init() protected void init(UploadService service, Intent intent) throws IOException {
this.notificationManager = (NotificationManager) service.getSystemService(Context.NOTIFICATION_SERVICE);
this.params = intent.getParcelableExtra(UploadService.PARAM_TASK_PARAMETERS);
this.service = service;
this.mainThreadHandler = new Handler(service.getMainLooper());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && params.notificationConfig != null) {
String notificationChannelId = params.notificationConfig.getNotificationChannelId();
if (notificationChannelId == null) {
params.notificationConfig.setNotificationChannelId(UploadService.NAMESPACE);
notificationChannelId = UploadService.NAMESPACE;
}
if (notificationManager.getNotificationChannel(notificationChannelId) == null) {
NotificationChannel channel = new NotificationChannel(notificationChannelId, "Upload Service channel", NotificationManager.IMPORTANCE_LOW);
notificationManager.createNotificationChannel(channel);
}
}
} But it looks like this part is never called. A quick fix is to modify in
There is a missing check for the API version but I don't know if a real fix in a pull request would not be better. |
@fthuin iPR fixing the issue in the source code would be great! We are welcoming all contributors so if you have the time feel free to join the community by creating your PR! |
@NickIliev It's here #126 😄 |
@NickIliev DO we know when this PR will get accepted? I have an app that i upgraded and its dead with 3.2.2. I would rather see the update than roll back to 3.2.0 I have tested the PR in my project and it appears to be working |
The issue is fixed in version 3.2.3, which is already released. |
@DimitarTachev Just tested 3.2.3 and it's not fixed. The version is 3.2.3. The error I get is the same as with 3.2.2. {"eventName":"error","object":{"_observers":{"progress":[{}],"error":[{}],"complete":[{}]},"_session":{"_id":"image-upload"},"_id":"image-upload{1}","_description":"{ 'uploading': NSIMG_20180415_211128.jpg }","_upload":0,"_totalUpload":1,"_status":"error"}} Altering the code as per @fthuin's comment gets it working. But as per my testing the 3.2.3 is not working on 8.0.0. Please reopen. |
@FranciZ, we are not able to reproduce any errors with the latest version. I suggest you test it with some of the Demo apps of the plugin and if you are still getting an exception, please open a new issue with exact steps to reproduce or a sample application. |
@DimitarTachev, interesting. As I said, the fix mentioned here fixes the issue. Without this, using the version 3.2.3 the error is the same as mentioned in the original issue without this fix applied. |
@FranciZ, the reason I closed this one was that the issues of @fthuin and @LorenDorez were resolved and their apps are working as expected with the latest version of the plugin. I already had a discussion with them in the Pull Requests and the community slack. Without providing us with a sample application or any steps to reproduce the error in one of the Demo apps, I can only suggest you try removing your platforms folder and rebuilding your app as everything is working as expected on our side. |
I confirm that everything is working well on my side. Do not hesitate to force the last version by updating your |
@fthuin Thanks for the feedback! Must be something wrong on my end. |
Tks, saved my day. |
Hello,
I have a Sony Xperia X with Android 8.0.0 and I just get an error with I call the function
uploadFile()
. The code works fine on Samsung S6 Android 7.0 and on iOS.Note that no request ever arrives to the server so it's not a network error. It does not work on http nor https server.
Here is the portion of code if it helps
Here is the error log I have.
The text was updated successfully, but these errors were encountered: