How can actions be implemented in local notifications in Xamarin.Forms - xamarin

I am developing an Xamarin.Forms app for Android and iOS, that requires me to implement local notifications. I have done this using the Local Notifications Plugin for Xamarin and Windows, https://github.com/edsnider/LocalNotificationsPlugin and it works fine. I get the notifications as I am supposed to, but I was wondering if there is a way to add actions/commands to this, type 'buttons' for accept/decline, like you can do in pop-up and dialogs. I don't know if this can be done using the plugin I am currently using, or if there is another plugin or something else that I can use instead.
Any help or advice would be greatly appreciated.
Thanks

On Android, you can custom the notification's layout to achieve your goal.
I have found some links for you, this is about how to Create Custom Notification Layout, and here is creating custom notification with xamarin.android
.
As you can see, on Android, the notification's layout is RemoteViews, it is not a normal view,you need setCustomContentView method for you notification.

Related

How do I know a xamarin application has push notifications?

I have started to work in a xamarin application. It has not been developed by me. How do I know this application has push notifications?
Thanks, in advance.
On Android check the AndroidManifest to see whether C2DM/GCM/FCM has been set up. Usually this would be several permissions having to be added for this to work.
Similarly on iOS the Info.plist/Entitlements.plist will need to include push notifications capabilities and there will also be implementation of the receiving part in the AppDelegate class.

How can I create a method to detect when a notification is clicked using xamarin coss-platform portable?

I´m a bit new to Xamarin Forms development, but not to Android (Java) development. Here´s the scenario:
I´ve developed an app for android, which schedules notifications (NotificationManager) and adds an intent to each notification in order to redirect the user to a specific url inside a webview. The url came from the notification intent.
So, I´m doing exactly the same thing in xamarin, in order to build the iOS version. Since I´m also an ASP.NET, I chose this method.
I´ve done all the basic stuff, so far:
created the webview with the right address;
created the routine which sets the cross-platform notifications using CrossLocalNotifications (Xam.Plugins.Notifier)
This is the problem:
I need to create a method in which the app redirects (webview) the user, once he clicks the notifications, in the portable solution level. I think I can manage to develop the logic to use the webview I currently have. I just can´t seem to find anywhere on the web a tip for creating a method to "listen" to the user click and catch information (or just the ID) of the notification created, so I can build the routine.
Anyone can help or have a better solution?

Push notification in xamarin cross platform

I would like to add a Push Notification to a Xamarin Cross Platform application.
My application has MaterDetailPage on the Portable layer. When a notification comes in, I want it to appear as "Messages (1)" in the menu.
How can I do that?
There is no way to do it in cross platfrom, you'll have to implement some custom renderers, as Google and Apple have different ways to implement that.
A nice component for implementing that is https://components.xamarin.com/view/azure-messaging but rememeber that you'll also have to do some backend work.
Regardless of how you decide to implement push notifications, if you intent to develop for iOS I would recomend reading https://developer.xamarin.com/guides/ios/application_fundamentals/notifications/remote_notifications_in_ios/ as you'll probably have some trouble with the certificates/provisioning.

Xamarin.Forms - Push notification for iOS and Android

Hell. I'm just write my first mobile app and I use XamarinForms
So I try understand to understand how work push notification here....and i'm a little bit confused
So this is what I understand
For android I MUST(!) use google cloud messaging - right?
For iOS - I MUST(!) use Apple Apple Notification Push Service - right?
Now my question:
If I use xamarin forms - i write 1 code to 2 platfoms andoid/iOS - right??
so how i can write 1 code both for gcm and apple notif????
How I think - but not sure - I need write interface in my PCL and then write separate implementation in each platform??
This is write way??
Why I need Push notifications?
I have app and when admin attach task to user - he will get notification about he has new task.
Or when user use app - real time get new data - new task
So if you can give me a tips - thank you.
Sorry for my English grammar)
Thank you.
Take a look to this plugin https://github.com/rdelrosario/xamarin-plugins/tree/master/PushNotification in the description you can find the proper setup for each platform.
Also keep in mind that even if you're using Xamarin.Forms you will need to know how works push notifications on each platform.
Android. https://developers.google.com/cloud-messaging/
iOS. https://developer.apple.com/notifications/
is you have any specific question about it pls let me know
Azure has "push notification hub" that plugs into both iOS and Google
Try that. Once youve set it up it will push stuff to google and to apple.

Toast message in Oracle MAF

Is there any way to generate toast message in Oracle-MAF like in android or IOS ? I gone through some blogs but didn't find any.
You could create this pretty easily with some Javascript and CSS, see Show an Android style toast notification using HTML/CSS/JavaScript
Or you can also use a Cordova plugin, see: https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin

Resources