Google Notifications fail sometimes with LinkageError, but work other times - xamarin

I am using Azure Notification Hubs to send a notification to my Xamarin Forms app.
Sometimes (normally works the first time, then fails the second time) I am getting a Linker Error that the setVisibility method cannot be found.
java.lang.NoSuchMethodError: no method with name='setVisibility' signature='(I)Landroid/app/Notification$Builder;' in class Landroid/app/Notification$Builder;
I am at a loss as to what could be causing this, especially given that it finds the setVisibility method about 50% of the time.
This seems to be reproducable on a KitKat phone (API Level 19)
Update:
What is interesting is that if I include the NotificationCompat.Builder from the NotificationCompat, but do not use it the problem seems to go away.

The reason why this happens is because this was introduced in API 21. In the Android documentation you can see in the top right corner of this method of when this was introduced:
https://developer.android.com/reference/android/app/Notification.Builder.html#setVisibility(int)
Added in API level 21
Thus if you used this method on anything < API 21, it would crash because it does not exist. This is where you should be using NotificationCompat.Builder instead inside the Support.v4 library:
https://developer.android.com/reference/android/support/v4/app/NotificationCompat.Builder.html

Related

Quickblox.sdk GetBaseSession() method throws "nonce is required" error

I have used quickblox chat sdk in my old xamarin.forms project. I know that quickblox is not supporting xamarin now, but old sdk was working fine till now, but from last week I am getting this error.
Code:
var baseSesionResult = await Provider.QbProvider.GetBaseSession();
When I am calling QbProvider.GetBaseSession() it throws below error:
CONTENT: {"errors":{"base":["nonce is required"]}}
I have tried different methods available in sdk but none is working. Any one know how to fix this error?
This is Nikolay from QuickBlox support.
Please add "" symbols around nonce and timestamp values and check if the issue is resolved.
The same information is mentioned in our documentation: https://docs.quickblox.com/reference/authentication#create-session
We released a patch for authentication that improves validation according to our documentation.
Hence, the issue is caused by incorrect implementation in the application that is why the server has started showing errors for submitted requests.

Dialogflow CX - Form Parameter FINAL and UPDATED Event Not working

The DialogFlow CX with Page Form Parameters was working well in the test simulator and recently, my chat bots are not responding after user inputs.
When i tried to troubleshoot the issue i realized that the $page.params.status='FINAL' or the $page.params.someparameter.status='UPDATED' events are not firing properly. Due to this the routes are getting failed.
Initially i thought the issue is in my Project. Then i tried the prebuilt agent (travel-baggage claim) in another project. Even that behaves the same without any response after the user inputs are collected.
I also reported this issue to the Developer Advocates in Twitter and updating here as well to get some response from the community.
I’ve tried to replicate your use case but I was able to successfully trigger the condition routes $page.params.status = "FINAL" and $page.params.parameter-name.status = "UPDATED" as expected and transition to the defined page from my end.
See the following for reference:
$page.params.status = "FINAL"
$page.params.parameter-name.status = "UPDATED"
To troubleshoot the issue, you may check if all the conditions defined in your condition route are fulfilled. Also, you may need to check if the condition rules applied is OR or AND. If AND, make sure that all conditions are fulfilled in order to transition to the defined page or flow.
As for the prebuilt agent Travel: baggage claim, I was also able to replicate the same behavior. However, I noticed that this is a different issue since the issue is caused by the webhook being unable to provide a response and not caused by triggering the condition route. I was able to verify this by adding a static response on the condition route and by checking the logs from the simulator. See screenshots below for more information.
Static response
Log snippet from simulator
I tried creating a new flow and migrated all the pages and it works well. I suspect the flow got corrupted when i programmatically tried to update via API.

S4 SDK call takes long time and stopped without error

I encountered a strange issue. The execute call to get S/4 Business role authorization details, made by using S/4 SDK takes long time, then stopped without throwing an exception. the code used is shown below. The url is https://my300470-api.s4hana.ondemand.com/sap/opu/odata/SAP/APS_IAM_SIAG_BROLE_SRV/getAuthDetails?ID=%27SAP_BR_INVOICING_SPEC_CINV%27&$format=json&sap-client=100&saml2=disabled
The call works for some roles, but for some other roles, it takes long time, then stopped without throwing exception.
List<IagprivilegeauthDetails> authDataList = new
DefaultS4cBusinessRoleMetadataService()
.getAuthDetails(bRoleId).execute(configContext);
After some investigation and other reports of issues like this we found the problem:
A library that we use did not close all HTTP resources properly.
After upgrading the library this should be fixed with version 2.19.0.

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.

Calling DisplayRequest.RequestRelease function in windows 8 app

I want to turn off the display at a particular point using DisplayRequest.RequestRelease but im getting various exception. When i tried for desktop im getting "Arithmetic result exceeded 32 bits" error. In phone im getting system.excecutionEngine exception. I need to know the correct usage of this function.
There are two things wrong here.
DisplayRequest.RequestRelease is used to release a previous request to keep the display alive. If you haven't called RequestActive before, then it won't work and will throw the exception.
If you are doing it to release a previous call, then it's possible that things are going wrong after a suspend operation, because you may have inadvertently called RequestRelease in your OnNavigatingFrom member. Please see my blog for full details at Most of my Windows 8 Apps are broken. Yours probably are too

Resources