Notification on Lock Screen triggered by (remote) Push Notification? - windows-phone-8

is it possible to display something on the Windows Phone Lock Screen triggered by a push notification?
According to this graphic, I understand that's it's only possible via local notifications, or am I getting something wrong? I would like my app to make notifications on the lock screen whenever something important happens, which is triggered via remote push notifications from my server - is this possible?
(image taken from here)

Actually, it is possible. The lock screen just reflects the information of the main pinned tile of your app. So, if you update the tile, for example sending a tile push notification, the lock screen will be updated too.
Note, that you cannot programatically set your app to show notifications in lock screen. User has to manually select it.
You may find this post useful:
http://www.silverlightshow.net/items/Windows-Phone-8-Live-Tiles-and-Lock-Screen.aspx

Related

handle when unlock the screen Windows Phone

I have to make an app that appears when you unlock the screen and then forces you to type Pin code you have set before for authentication exactly the same one that Windows Phone has in Settings.
I already made SetPin page and Pinlogin page, but the only way I can do to make it appear when you unlock the screen is to start the app and make it run under the lock screen and use unobscured event to call it.
But the Assignment requires to only setLock one time and no need to run the app again, it will appear when unlock the screen like the original one in WP, but I have no clue how to do it, how to start navigating to a page in your app when your app is not run and how to get the event when unlock the screen without running an app.
It makes no sense for this assignment because I think we can not stop the start button on device even when I am successful at it.
Not possible with the current API.

Create and maintain a SignalR connection in a WinRT Background Task

I currently have a Windows Phone app that connects to a SignalR service to receive notification data. The service pushes data to the phone, which the app accepts, process etc and it’s all working as expected.
However, I would like the app to continue to receive the notification data when the app is suspended and no longer in the foreground, and display the notification data as a toast message.
From what I can see, the Background Task infrastructure offers no way to do this.
I have access to a Suspending and Resuming event (using Prism) so here I could Register/Unregister my background task.
For the trigger, the only one that comes close to being relevant is the TimeTrigger, but this only has a freshness time of 15 minutes, so assuming I am recreating the connection in the background task, I would end up opening and then instantly closing the connection every 15 minutes which isn't what I want to do.
I could have an “infinite await” that just hangs until a timeout, but this doesn't feel like the right way to go (and the resource usage would be terrible).
Is there a way around this to achieve what I want to do?
No, Windows Phone apps cannot keep a channel open like this. If the goal is only for toasts then you can do the computation on the server and push a toast notification.
Windows Store apps can do this with the ControlChannelTrigger class, but it is not supported on Windows Phone.

Launch application automatically from a push notification on Windows Phone 8

I would like to launch an application using parameters provided from a push notification on Windows Phone 8.
The behaviour I wish to achieve is that as soon as the user receives the notification, the application will be launched with the parameters provided in the notification. I.e. seamlessly present the notification in a more user friendly way.
As far as I understood there are three push notification mechanisms. Toasts, Tiles and Raw.
None of them seems to be able to handle the wanted behaviour.
Toast: The message is shown even if the application hasn't been started. It does not start the application unless clicked on but seems to be closest to the target.
Tile: Message is shown if the application has been pinned. But they may be difficult to notice unless the tile is pinned fairly high on the start screen.
Raw: Works in more power states but requires the application to be running. This doesn't seem to be a match because I want the notification to be received when the application is not running. I couldn't find information about which application states where raw notifications are handled. I would prefer all.
Did I miss something in my research? If anyone has a hint of how to put an application in the foreground from a push notification (without user interaction) it would be greatly appreciated!
My first attempt was to trigger the application start using SMS but that seems to be a no go.
See my post Launch application automatically from an SMS on Windows Phone 8
You can not automatically launch an application on Windows Phone (and neither can you on iOS or Android). What you can do is provide a URI with the Push notification so the user is taken to a page with the needed information
you can not put an application in the foreground from background without user interaction.

Suppress Reminder in Windows Phone and instead Simulate Navigation from within code

In Windows Phone, the reminder is usually used for scheduled notifications. The reminder when popped up, requires user to click the reminder pop up in order to navigate to specific page and do certain action.
Can we simulate or suppress this reminder programatically when occured and instead perform the action it was supposed to execute when actually clicked. This would be of great use to user.
Any help, suggestions or ideas on the same?.
Thanks In Advance.
It isn't possible. A Windows Phone application has very limited interaction with the system when it isn't running in the foreground.
If you're trying to bypass the reminder to display something (for instance, a page of your application) without user interaction, then you have no way of doing that.
If it's just about updating some data or calling a webservice without displaying anything, you should use a background agent instead of a reminder.
Windows Phone was built around the idea of letting the user in control at all time. That's why there is no way of forcing the user to navigate to a page of your application if it wasn't running in first place.

Prevent automatic screen lock on Windows Phone 8

I have written an app that performs some lengthy operations, such as web requests, in a background thread. My problem is that after a while the automatic screen lock turns the screen off and my operations are aborted.
Is there a way to prevent the screen to be automatically turned off during these operations? Or is it in some way possible to keep running while screen is turned off?
I know there are ways to prevent the screen to turn off while debugging, but i need this behavior in the hands of the end user. Therefore I can not rely on some setting being set on the phone, but rather some programmatic solution.
The screen can be forced to stay on using the UserIdleDetectionMode property of the current PhoneApplicationService.
To disable automatic screen lock:
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
To enable it again:
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Enabled;
More information can be found on MSDN
I know this question is about Windows Phone 8, but I had a hard time figuring out the way for Windows Phone 8.1 (Universal XAML Apps).
Use:
var displayRequest = new Windows.System.Display.DisplayRequest();
displayRequest.RequestActive();
Apps that show video or run for extended periods without user input can request that the display remain on by calling DisplayRequest::RequestActive. When a display request is activated, the device's display remains on while the app is visible. When the user moves the app out of the foreground, the system deactivates the app's display requests and reactivates them when the app returns to the foreground.
See: http://msdn.microsoft.com/en-us/library/windows/apps/br241816.aspx