Multi Line Notification Content with Xamarin Forms & an Azure Notification Hub - xamarin

I have a Xamarin Forms App where you can post content to an Azure Function which sends to an Azure Notification hub.
This works fine on Android and iOS for single line messages.
However on iOS if there is a new line character "\n" - the notification fails to trigger.
However, if I take the payload (which is a newline message) and output that via a debug statement in my Azure Function and use that content to carry out a test send on the Azure notification Hub it works fine - it just doesn't work from the app.
As I say, single line messages work 100% on both Android and iOS and newline messages work fine on Android, but just not on iOS.
Has anyone come across this before?

Related

Xamarin Forms Push notifications not received properly when the app is closed in android

We have configured push notifications in our Xamarin Application for both android and iOS. In iOS notifications are being received properly. But in Android, specifically when the app is closed the notifications are not being received properly.
When the app is open, push notification is triggered and displayed properly as expected, can be observed in the screenshot attached.
When the app is closed, push notification is triggered and displayed as "body", can be observed in the screenshot attached.
Note* Notifications are being sent from ASP.net core with Azure Notifications hub.
The payload looks like below : new JObject(new JProperty("notification", pushMessage)).ToString(Formatting.None);
Andoid Notifications
I tried changing notification payload in different ways but still result didn't change.

MS Teams submitTask fails to submit to bot in IOS Teams app

I open a web/html dialog from an adaptive card with the task/fetch Action.Submit.
Once the user is done with the work in the web dialog, I call microsoftTeams.tasks.submitTask with a resulting javascript object.
This works perfectly fine in the web and the desktop client. The dialog is closed and the bot on the server is triggered with the resulting object.
However in the IOS app, only the dialog is closed but the bot is never notified.
I have tried all variations of the submitTask (with botId or appId as second parameter or without second parameter). Nothing is successful on the IOS app.
Is there anything I can do to further debug that behaviour? Or is this a known bug?

MS Teams Message Extension submitTask not working in iPhone Teams App

I have created a message extension with the custom web form, it fails to send any data back to the bot on microsoftTeams.tasks.submitTask. It just closes the form, and the bot submit action method does not receive any data. No issues with other clients like web, windows, or mac. Any way to debug or look into log files on the mobile?
Event tried with this sample code for message extension and used the compiled TaskModule.zip package, it's also not working in the Teams iOS application.
try sending only one parameter into submitTask.You could do something like this.
microsoftTeams.tasks.submitTask(yourObj);

Azure bot - show chat notifications in notification bar in cross platform moobile app (Xamarin)

i wanted to show azure's chat bots responses as notifications in the notification bar like PUSH notifications.
I've came across that i need to use xamarin webview to integrate bot in Android app. So, can webview capable of showing chat responses as push notifications ?
Note:-
I'm using Bot Framework SDK V4
and .Net Core
Xamarin for cross platform development
The WebChat control (webview in your questions) is used as a UX display control within your app. Messages from your bot to your app goes through a dedicated channel that has nothing to do with a mobile Push Notification. So in short, the answer to your question is no, this functionality is currently not supported by the client Webview control (WebChat).
With that said, you can create a custom middleware component for your bot that can send a Push Notification message using Azure Notification Hub. Or you can create custom functionality (sample showing a standard web app) in your bot that sends a push notification. Or your bot can drop a message to a queue and have an Azure Function pick the queue message and send the push notification. Note the last option is an implementation detail.

Azure Notification Hub losing the subscribe when app is reinstalled

I have a problem with Azure Notification Hub.
When my app is started in first time, the notifications working correctly, but when did a rebuild the app by Visual Studio, the notifications stop working and the Android Services with IntentFilters do not are called.
For the notifications works again, I need to uninstall the App in Android and run by Visual Studio again.
Have someone some idea about that problem?
My worry is: if I send the app to GooglePlay, the notifications would continue working after a update?
If someone know how to call the service to get the new InstallationId, always that the app to be started I will know how I can resolve the problem.
Can someone help me?
I did follow that tutorial:
https://www.youtube.com/watch?v=le2lDY22xwM&t=3312s
if I send the app to GooglePlay, the notifications would continue working after a update?
There is no need to worry about that, referring to this document, when you use Azure Notification Hub, it's using Android GCM to send the push notificcation. You could see my answer about Android using Firebase Cloud Messaging not receiving message.
As the Official document said :
On initial startup of your app, the FCM SDK generates a registration token for the client app instance. If you want to target single devices or create device groups, you'll need to access this token.
Explanation about Token :
An ID issued by the GCM connection servers to the client app that allows it to receive messages.
When you did a rebuild the app by Visual Studio your token is changed, but it didn't trigger the OnTokenRefresh method, so at this time the Token in your application is invalid. That's why your application cannot receiving message.
For more information, you could refer to Sending Push Notifications from Azure Mobile Apps and Implement the Firebase Instance ID Service.
When your app get a update, it will trigger the OnTokenRefresh method automatically, so your application can still receive the message.

Resources