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.
Related
I am creating a xamarin form app which require user location after every 10 meter.
I am able to get location when app is running in foreground but unable to get location when app get into background.
Any advice will be great.
You need to create a background service in Xamarin.Android and then call that using dependency services. You could also look at Shiny. It is a good plugin built for this purpose.
https://github.com/shinyorg/shiny
Background updates are handled a bit different on each platform. For Android, you will want to integrate a foreground service that subscribes to location changes and the user interface binds to.
You could use the Xamarin.Essentials and MessagingCenter for this.
For more details, please check the code sample in the link below. https://stackoverflow.com/a/63665571/11850033
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.
I need to detect user's inactivity time in NativeScript app.
I tried with few plugins (like ng-idle) but they are not compatible with NativeScript.
I also tried to to emit application level event (in page router outlet) but it is not working either.
Any help will be appreciated.
In the mobile context, you would like to track the inactivity in the native mobile application lifecycle. For Android, you can extend the Application and implement some of the solutions shown here. Following this approach, you can do the same on iOS (overwrite the AppDelegate as shown here and implement some of the native solutions)
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.
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.