Terminating a Share Picker app on load complete - windows-phone-7

I've implemented a Share Picker Extender (which lets you share a photo from the Pictures hub to your app via a special token), and would like to close the app once the user has clicked on the button to upload the photo, as the built-in Facebook app does.
I'm aware of the many questions re terminating apps - I'm just wondering if I'm missing something for Share Picker Extenders ... Telling the user "Now press the back button" seems pretty ugly, but perhaps it is the only (certification worthy) way. If you've implemented a Share Picker extender, what have you done?

I wasn't able to figure out a good way to handle this either. I detect that users have gone back to my first page and say "Click here to go to our main app" and "Click back to go pack to Pictures". And if they click the first one, Navigate("MainPage.xaml");. You have to make sure you don't accidentally prevent them from leaving. I asked this question awhile ago in this thread and got no response.

Related

Google Play Games notifications not visible

I've looked through all questions on SO about Google Play Games, but looks like I'm the only one having problems now.
Using new GPG with Games.Achievements.unlock(), the achievement notification isn't showing up. I can see that achievement is unlocked when checking in unlocked achievements list, but that badge - it just doesn't show up!
The app isn't published, but has all the achievements correctly set up in Play Store. other GPG features seem to work fine, but they usually do not show notification (like Leaderboards)
And another issue that might be actually related to this. The initial login popup, the one that allows to pick an account when you have several of them on the device - sometimes it ends up being behind the app screen. And when you quit the app it keeps sitting on the device screen until you close it by picking Cancel. Not sure, this might be a debug issue due to app being force-closed on every next installation, but still.
Any ideas? How Achievement badge can end up being invisible all the time?
You may need to try changing the popup view, depending on which implementation you have used, this is the basegameutils method:
Games.setViewForPopups(getApiClient(), getWindow().getDecorView().findViewById(android.R.id.content));
Depending on your code, you may need to use a different view.
Try this in the activity view in which you want the notifications to be seen : Games.setViewForPopups(getApiClient(), getWindow().getDecorView().findViewById(android.R.id.content));
The issue was that I was calling Games.Achievements.unlock(mGoogleApiClient, context.getResources().getString(R.string.achievement_pro)); from a helper class. The context that I passed was of MainActivity.class, however I actually intended to show the achievements being unlocked in my GameScreen.class and not the MainActivity.class since it would be in the background. GameScreen.class, in my case, is an activity that I invoke through an Intent from MainActivity.class. And I suppose, it is because of this that the context is not set properly for Games.Achievements and it could not show the pop ups in my current activity screen.
When I added that line of code in GameScreen.class, I assume that now Games class knew where it has to popup the alerts. My explanation might sound a bit fussy here but let me know if you have any issue.

WP7: Is it possible to intercept the backstack before the journal thumbnail is created/stored

You all know the Windows Phone backstack right. If you go through some apps, tap the Home key after starting each app. Now tap and hold the Backkey to see the Backstack. You can now see some small images of your apps, and can pick which one to go to right.
Question:
Is it possible to intercept before the backstack image is created? I have tried to blur my page in various events (include OnNavigatingFrom) to no avail.
My guess is some other event (probably something we don't have access to) is triggered and a bitmap is created, because when you use the Backstack to navigate you can just see a slight transition from the saved image to a real page IMO.
Does anyone know if its possible to intercept or manipulate these images on the backstack?
Example screenshot from WP emulator of the Backstack thumbnails
Following my comment, I've just tried this:
Set a breakpoint anywhere in the code
Start the app with the debugger attached, then let it reach the breakpoint
While the execution is stopped by the debugger, long press on the back button
The task switching UI is displayed even though the managed code execution is stopped
From there, I think we can safely conclude that the task switching and the thumbnail are handled entirely by native code. Therefore, there's nothing you can do.
I recently wrote a blogpost in which I discuss the ways I tried to hide data from the application snapshot. (You can read it here: http://corstianboerman.com/trying-to-hide-crucial-data-from-an-application-snapshot/)
The outcome: You just can't hide it.

How Can I navigate back to home screen in Windows Phone 7.1

I have a created an app which has a Homescreen/landing page,Now whenever user navigates till last page and clicks the device back button he is redirected back to Homescreen. Now the issue is I have written code to clear all the backstack whenever user lands on the Homescreen in Homescreen OnNavigatedTo block. So whenever user clicks device back button of last page he is navigated to homescreen by creating a new instance of HomeScreen page.
On Homescreen the backstack is cleared, so the user can exit the app from homescreen when he clicks the device back button.
But according to Microsoft marketplace policy, backbutton must go back or go to previous page in backstack and not navigate to new page.
So the question here is should I clear all my backstack and go to homescreen or what I am doing is right?
As far as I know, they are not so strict as that. They just want you to handle the back button.
I had blocked the back button in some pages of my application and the certification failed. I changed the behavior of the application, to either close the application when navigating back or jump a couple of pages back, and it passed certification.
Just make sure the back button does something...
The reason they dis-advise you from doing this is because you are using the wrong organisation.
Going deeper usually means you get too more specific data, in a way you can go back up one page.
Going to the side usually means that you get more data, eg. Panorama / Pivot
I can't see a case where going deeper would disallow the user from going back to pages in between, I would not use your application if I had to start it every time again or when it would go deeper when it is actually supposed to let me scroll through the content.
Trying to surround their certification is definitely not the way you should be going, but rather embrace it.
See this page for layout tips and tricks for the Panorama and Pivot controls.
As per the comments, you might find it a lot easier to ditch having to learn all platforms.
A jQuery Mobile application can do that for you.
jQuery mobile framework takes the "write less, do more" mantra to the next level: Instead of writing unique apps for each mobile device or OS, the jQuery mobile framework allows you to design a single highly-branded web site or application that will work on all popular smartphone, tablet, and desktop platforms.

Calling NavigationService.GoBack() fails on the first page of a WP7 app

I have a strange problem with a Windows Phone (7.1/Mango) app.
My understanding is if NavigationService.GoBack() is called on the initial page of an app, then the app should exit. This happens when the user presses the phone's back button, but it does not happen if there's a UI button with the same functionality (because NavigationServive.CanGoBack returns false).
Is this intentional or am I missing something? I haven't messed around with redirecting the initial navigation or anything like that, so I can't account for this difference in functionality.
I know the answer is simply "don't have a UI back button", which is very true, but does anyone know why this happens?
Thanks in advance!
I believe this is because the navigation service is "scoped" to your application. This allows you to deduce a bit more about how the user is using your app.
For instance if CanGoBack is false then this is the first page the user is visiting. This is useful if you're using deep links into your app (from reminders or toast messages) because you may need to act differently on the deep link as opposed to a normal navigation to the page.

How to handle first run and splashes in WP7

I have spent a bit of time rummaging through Stack Overflow to find out how to deterministically close an application based on an action. Most if not all answers say you can't or shouldn't do it. If this is so I would like to phrase my question differently and see how people are handling two issues I am having trouble with.
Just to let you guys know I am using Caliburn.Micro for this project.
Ok so the flow of my app can be broken down into two parts, the initial flow and the standard flow, these are as follows
Splash -> Welcome -> CreateAccount -> MainHub (all other functionality branches from here)
Splash -> MainHub (all other functionality branches from here)
Based on this flow, the feedback from my better (beta) testers is that they expect to exit the app on pressing the back button on the hub, which they see as the entry point. Currently as per navigation they go all the way back to the splash.
I see other apps have this functionality, but without forcing the application to close (Which I read is a no no) how are they achieving this desired functionality.
NOTE: I do not want to put in an exit button as I believe it goes against the natural flow of a WP7 application.
First of all, you cannot add a exit button. The only way to exit a application is to crash it, which will not be approved for marketplace certification.
As for your problem, you simply have to remove views from the navigation stack upon completion of a known navigation.
For this, use NavigationService.RemoveBackEntry.
You can access the NavigationService from anywhere, using this snippet:
(App.Current.RootVisual as PhoneApplicationFrame).RemoveBackEntry()
Regarding EULA / Login screens (and Splash) - don't make them into pages. If you instead make them Popup or Dialog controls you can show or hide them at any time (on first navigation; when the user hits a "protected" part of the app; after a time-out; etc.) and they don't consume a slot in the backstack.
Source: http://blogs.msdn.com/b/ptorr/archive/2010/08/01/exiting-a-windows-phone-application.aspx

Resources