I am trying to implement push notifications in windows phone 7.5
I bind the channelUri in App.xaml when the application starts up.
I can then switch my app to background and receive toast notifications based on the Uri.
But this requires me to first go the app and then make it to background.
Can I receive the toast without the app running? That is when the channelUri is not bound.
Is this a default behaviour in Windows phone 7 or whether I am missing a point here?
If this is the behaviour, how can I send some form of notification/ information to the phone when the app is not running?
I did see this Windows Phone 7.5 - Push Notifications when app is tombstoned.
Update:
I know the Channel is active up to 30 days, is it the same when I use only emulator?
App should be associated with a channel so as to receive notification and even when app is not running, if the notification channel is active, then the application will receive the toast
I think you are missing the point. In order to receive toast notifications you don't have to have the app running in the background. Toasts (and Tile notifications) are meant for when the app is not running at all. So, start the app to get a push-uri and then send that to the service. In theory you won't need one again after 30 days. When it comes to the emulator it will be available as long as the emulator is running. Once you shutdown/close the emulator, the push-uri is gone and you would need to re-request one. (Generally speaking, nothing is saved on the emulator and so closing and opening the emulator is like getting a new device everytime.)
Hopefully this helps
Related
I'm Developing A Xamarin App, I Create A Signalr Notification System That Work Fine In Both Xamarin.Android And Xamarin.IOS But It doesn't work when Xamarin.IOS App close.
Is There a way to fix this without using APN Or FCM?
Is There Way to IOS Let My app Do something even When App is Closed?
It is not possible to keep the signalr connection alive while in the background on iOS. The operating system will kill it, there is nothing you can do to stop that from happening. iOS immediately kills the app (you have 5 seconds) when going into the background, with a few exceptions.
If you are using android, you can create a foreground service to keep the signalr connection alive. Without a foreground service, android will also kill the signalr connection after a while. Android will allow a background app to run for a period of time, then will kill it, so you must have a foreground service to keep signalr connection alive.
Also be aware while in debug, iOS will allow apps to run in the background. But the released version will not allow apps to run in the background. This can make debugging signalr difficult, as it will work in debug, but not in the production version.
You will probably need to use APN for notifications. Be aware that APN requires a HTTP/2 back end server if you want to send the push notifications directly to Apples servers. Or you can use FCM to send APN.
I have a problem on Devices Xiaomi and Lenovo Phones, when i close app from task manager they stop receive GCM messages, the gcm messages receive only at foreground and app on task manager list. How do i to keep app or service running on close at task manager? Obs: samsung phones keep as well on both cases.
As stated in this thread, Lenovo mobiles are using Background task killer to stop background apps. To hide task killer, untick restrict in application menu.
Also, as mentioned by #AL. in this post, it may very well be possible that when an app is stopped from multi-task tray in that device, it is actually killing the app, causing the services and other background processes associated with it to also be destroyed. Suggested action is to make use of the START_STICKY flag.
Another reference which might help.
In Xiaomi phones, they whitelist or blacklist an app based on certain criteria. If you download an app and if it is in their whitelist, they'll permit the app to show notifications. If not, you already know what happens. But the good thing is that you can change these settings. Look for an app named Security. If you revoke the right permissions, even WhatsApp will stop showing notifications.
I have been doing lots of research trying to figure out if it is possible to create wear notifications with custom layouts over the past few months, but am struggling to find a solution.
I have tried to implement the following suggestions to no luck:
https://possiblemobile.com/2014/07/create-custom-ongoing-notification-android-wear/
http://android-wear-docs.readthedocs.org/en/latest/sync.html
Custom UI for Android Wear Notifications
Most of what I have read have instructed that in order to do this, I should create an android wear app with a data listener. The idea being the phone would send certain data to the watch (say a string) based on the type of notification it wants to send. I would disable the automatically generated wear notification. In its place, the Android Wear app listener would know what type of notification it is based on the string and display my custom pages for that notification instead.
My first problem I have run into is I have no idea how to debug code like this. Since in Android studio you can only launch the device app or the wear app, but not both at the same time.
The other question I have is, does the Android Wear app run in the background when the Device App is running? Do you have to open the Android Wear App first for the listener to be even working (if so then I guess this is not a solution to custom notifications)?
Is it actually possible to create custom layout android wear notifications?
If you want to use a custom layout for your notifications, you should create the notification on the watch, following Creating Custom Layouts. You can even make the custom notifications clickable, you can add actions that will open activities on the watch, etc.
For that, you can send a message from your phone to your watch and the listener implemented on your watch will receive it and then, create and display the notification using the correct layout corresponding to the message sent, for example.
In this case, the best way is to implement a WearableListenerService on your wearable. Its lifecycle is handled by the system which binds it only when necessary.
To debug, you install the wear app on the wear emulator or your watch, you install the mobile app on your phone and finally you connect the two following this tutorial if you're using the emulator or via bluetooth if you're using a watch (link in the tutorial).
The Android Wear app connects your phone to your watch, whether it is an emulator or not. So, in order for your message to be received, you must have connected wear and mobile via Android Wear. Then, once the connection is established, you don't necessarily need to keep it open. So yes, the Android Wear app runs in background.
Is there a way to know if the app is sent to background or brought to foreground. I don't mean Suspended and Resuming events.
For example, user leaves the app to check something on Facebook app for a min. And then return to back to my app. So suspention doesn't take effect on this scenario. Then how to know user is back to the app on app.cs level?
As stated in the MSDN documentation:
Your app doesn't receive an activation event when app visibility changes, because the app is still running. Windows simply switches to and from the app as necessary. If your app needs to do something when the user switches away and back, it can handle the visibilitychange event (for HTML) or Window.VisibilityChanged event (for XAML).
I am trying to develop an app for windows phone that will detect calls and send notification to PC through wifi. Similarly it will also send SMS that are received to PC and when an alarm goes off in phone, a notification will be sent to PC. How should I proceed about developing this app?
Thanks in advance.
There is no API exposed to allow you to spy on incoming calls or SMS in Windows Phone (like there was with Windows Mobile). The only option would be to build this as an OEM extension, but unless you work for HTC, Samsung or Nokia, this isn't going to be an option.
See it's not that you cannot but to some extent you can. Like you can use Obscured Event to detect call , lock screen etc. go through this msdn discussion for details
Detect lock and calls msdn
And as far as the alarm or the reminder is concerned you can go ahead and design a reminder system within your app. Limit is 50.
Obscured event Windows phone