How to find out user is at desktop instead of start screen or another store app UI at Windows 8 - windows-8

As we know, at windows 8 if user is at start screen or another store app (metro app) UI, the dialog at the desktop won't be visible to user. We are adding some toast notification capability at our application by following Sending toast notifications from desktop apps sample. I am able to get it working. However if user is already at the desktop, we don't want to send out the toast notification. So it would mean that we need to be able to detect if user is current at desktop or not. Somehow I didn't find any API by searching on internet. Could someone let me know how to do so? Thanks very much.

A toast notification can't know in what context the user is located, so this is not possible.

Related

How to open the apple app store internally using a modal segue

I am currently making an app that recommends other apps to download on the apple app store. I assumed that the only way for users to download these linked apps was to call the iTunes URL of the particular app -> the apple app store would then open pushing the original calling app into the background -> then the user would press the download button here as per normal.
Then I was playing with the app "App Hero" and they do something I thought wasn't possible. You can actually download another app to your device without ever leaving the "App Hero" application. I thought this was impossible due to sandboxing. They have a modal segue to what appears to be an embedded app store where you can commence installation of another app. This "embedded" app store doesn't have the usual UITabBar running along the bottom but everything else is basically the same.
Does anyone have any idea how they would have achieved this? It doesn't appear to be a UIWebView, perhaps I am wrong. And is this against any of the apple regulations?
*This is no way an advertisement for "App Hero". I am genuinely impressed/confused how they are able to do this and would love this functionality in my own app if it is allowed.
The class you are looking for is called SKStoreProductViewController. Docs here.

RemoteNotification TOKEN not received if push notifications are not allowed

Really confused with this one!
I have an Adobe AIR iOS app and I am using the RemoteNotifier to subscribe for PushNotifications. More details http://www.adobe.com/devnet/air/articles/ios-push-notifications.html
I have the following listeners.
remoteNotifier.addEventListener(RemoteNotificationEvent.TOKEN, onToken);
After I reset my iPod to factory settings and reinstall my app (using the adhoc distribution), I click "Don't allow" for the pushnotifications when I get prompted.
I find that I then don't receive any RemoteNotificationEvent.TOKEN, so my app basically hangs waiting for that.
If I go to my Settings, Notifications and have a play with
Toggle Alert Style from the None to Alerts AND
Then back to None again (as it was)
I find that I can go back and launch my app with not problems. It's just that on the very first time user flow, I don't seem to get any TOKEN back.
Any ideas? Has anybody else seen this behaviour?
Or knows how I should handle this?
Thanks!
Hopefully I am correct, someone please correct me if I'm wrong.
From what I am able to find out, you won't get a RemoteNotificationEvent.TOKEN when the user clicks on "Don't Allow".
For some reasons that I am still unclear about, how after you play with the Settings and relaunch the app, you get the RemoteNotificationEvent.TOKEN, regardless of the notification settings you have set. But maybe that's the way it's meant to be?
So, really I have to change the flow such that I don't wait on that RemoteNotificationEvent.TOKEN before loading my first screen. If the TOKEN comes back, it comes back, otherwise if it doesn't, it's not a big deal as that means the user clicked on "Don't allow" and we don't need to send PUSH notifications anyway.
Everytime I relaunch my app, I do make the call to subscribe and get the TOKEN though, such that if the user was to enable the Notifications in the phone's Settings, I do have a TOKEN ID to send the push notification too.
The only problem I see with this though, is that should the user change the Notification to ON via the phone Settings and doesn't relaunch the app (to retrieve the TOKEN) then the device doesn't get push notifications.
Not sure how to handle this?

ToastNotification during Quiet Time

I have developed a desktop application which displays ToastNotifications while the user is in Metro Mode. When clicked it will bring the user back to the desktop mode where a standard desktop notification is presented.
This all works fine except when Windows is in QUNS_QUIET_TIME. The desktop notifications do not get displayed as expected, but the ToastNotfications still get displayed. My client wishes for the ToastNotifications to not display during Quiet Time.
The code calls SHQueryUserNotificationState which returns a QUERY_USER_NOTIFICATION_STATE enumeration. The provided link says the following:
Note that during quiet time, if the user is in one of the other blocked modes (QUNS_NOT_PRESENT, QUNS_BUSY, QUNS_PRESENTATION_MODE, or QUNS_RUNNING_D3D_FULL_SCREEN) SHQueryUserNotificationState returns only that value, and does not report QUNS_QUIET_TIME.
This is what I am experiencing. The call to SHQueryUserNotificationState is returning QUNS_APP (A Windows Store app is running.) and not QUNS_QUIET_TIME.
Does anyone know of another way to determine if QUNS_QUIET_TIME is in effect or a way to force the toast to respect quiet time?
Desktop notifications use different settings than toast notifications. You can find toast notification settings here. When a user sets notifications to one hour from Windows 8 Settings | Notifications, the app will not be able set toast notification. Try the example "sending toast notifications from a desktop" here (either C++ code or C# code).

Need a way to alert users when building spotify app

I'm building a spotify app that does some work in the background and should then alert the user if it finds a match. I can't find a way to notify the user on the main plane when I have found something of interest.
I'd like to have something like a counter on my app name or some form of notification in order to alert the user that something has changed in my app and that they should come to the app.
Does anyone know if this is possible ?
thanks,
Sean
You would need to notify them via Facebook, Spotify doesn't allow you to identify the individual users on the Spotify platform through the api.
Also there is the issue of that your App unloads after 60seconds of the user not being on the App Pane (off in a playlist etc).
So whilst a counter icon that you suggest would be wonderful.
The App Unload-er needs to go away first.

iOS 5 remote notification when launching app from dashboard

since iOS 5, notifications are no more intrusive as previous. This is nice, but it seems that users prefer to tap directly on app icon from the Dashboard instead of the (small) banner area or notification center.
In such case, my app cannot get payload from notifications.. Even the 'application didReceiveRemoteNotification' method is not able to get the notification.
Has anyone got the same issue? Do you have any advice?
Thanks
The intention of the push payload is just to display something useful/informative to the user in the alert. Not to actually send data to your app.
So you will need your own web service to provide the data your app needs. Your app should refresh/sync to that service when it launches to get the data.
Example: Instagram. It can push notify you that someone commented on your photo. But it's not actually sending the comment data in the push to display in the app. The comment data is downloaded when you launch Instagram and attempt to view the comment.