Redirect user to Phone Settings windows phone 8 application - redirect

I am trying to make a timer app and I need to prevent the screen from timing out. Since Windows Phone does not allow me to control that, I want to display a pop up to the user, giving him/her the option to be redirected to the phone's Settings page so that he/she can manually set the screen timeout.

All of the available URI schemes for the Settings page are listed here:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662937(v=vs.105).aspx
The URI scheme you're looking for is...
Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings-lock:"));
3rd party apps
Lots of 3rd party app have URI schemes as well, there's a handy list on the Nokia Developer Wiki:
http://developer.nokia.com/Community/Wiki/URI_Association_Schemes_List

Related

How to launch iOS app via custom URL and allow to open a webpage if it's not installed?

I'd like to be able to send invitation in an email to a specific "event" happening inside my iOS app. So I figured I'd need to use custom URL. That's fine.
But I'd also like to be able to handle the user that doesn't have the app installed yet, to be taken to a mobile Safari and to the webpage with installation instructions for the app.
What would be the best way to do it?
I could try the following:
In the email I send a link to a http://www.example.com/joinevent/?id=foo
User is taken to a Safari webpage that sends a redirect to mycustomscheme://joinevent/?id=foo
If the user doesn't have the app installed this redirection won't work and he stays in the Safari - I could then handle the displaying of installation instructions probably.
But this approach doesn't seem "natural" for me. Is there a better/more native way to do it?
Try http://rdrct.it
It is a web service that allows you to achieve exactly this functionality very easily.
Full disclosure - I created rdrct.it
Here's the basics:
Login to the site, create a project for your particular app. Choose a unique code (this could be the name of your app).
You'll then be provided with a URL in the form: http://rdrct.it/uniqueCode
Once you've done that, you need to register the app's ID in the app store, and also details about the custom URL scheme. Tick "Auto-redirect" - what it will then do is try to open the app, and if that fails, it will automatically send the user to the app store.
If the app is opened, then the querystring is also passed to the app, so in your example case, the device will have been served: mycustomscheme://joinevent/?id=foo
It also works across multiple device types, so if you have the app available for Blackberry, Android or Windows Phone, then it will also do the same for those depending on which device type the user is using.
Like I said, I created it, but it should solve your problem.
If you are using Distimo to track you app analytics, they provide a shortlink to your apps that can be used also used to track conversions. It shows a custom page depending on the device used to access. This is especially convenient if you have the same app published in the AppStore, Google Play, Amazon, etc.

When using OpenID login within an iOS app is it better to use Safari for login and then redirect back to app?

I'm building an app that uses OpenID for authentication. I'm giving Google, Yahoo and the general OpenID site as options.
At present, when the user selects a site, I open a UIWebView and the user performs their login with that frame, all within the app.
However, it has struck me that when using UIWebView, you cannot easily show to the user that the connection is over https or that they are indeed at the site I'm claiming they are at. I could be easily harvesting passwords.
Would it be, and I'm looking for opinions on this, be better from a user confidence perspective to actually open Safari when the user selects a login and once they've logged in have Safari direct me back to app?
Thanks
Most people using iOS devices are used to the way Facebook logins work; no URL bar, no nothing. I'd just follow the typical workflow. You could bump out to Safari, and return via a custom URL scheme. However, I think users will think that is more weird. iOS users are not used to being jumped in and out of different apps.
just my 2 cents, it would be also faster if the user has already logged in those services with Safari before.
Prompting out a UIWebView and switching to Safari is using the same amount of steps, so why not?
I thought I'd follow up on this thread to say I'm having difficulties getting the app approved and I think it's because I use the Safari approach. I've had it rejected by Apple twice now because:
"Apps that link to external mechanisms for purchases or subscriptions to be used in the app, such as a “buy" button that goes to a web site to purchase a digital book, will be rejected "
I think it's because I'm launching Safari. I've opened a dispute with Apple and I'll come back with more information once I hear back from them. I really hope a quick change to a UIWebView will help!

Disable Facebook mobile browser detection?

Does anyone know of a way to disable the mobile browser detection and redirect feature of Facebook via querystring parameters?
For example, if I go to www.facebook.com/CraigslistGenie in a mobile browser, I get redirected to http://m.facebook.com/CraigslistGenie. I would like the user to stay on the www version of the page.
you either change the user-agent to achieve that or you add ?m2w to the link i.e. http://www.facebook.com/CraigslistGenie/?m2w does NOT redirect (tested on Android) while http://www.facebook.com/CraigslistGenie does redirect to http://m.facebook.com/CraigslistGenie
For reference see here and here.
The first answer is correct, however if you want it to work on an Android phone (and keep working when you click on links within the site) you need to go into the browser settings (after you've gone to the http://facebook.com?m2w) and check the "Desktop version" setting.
This will prevent the browser from constantly trying to send you to either the mobile version of the site or the FB app.
Method given by Yahia is good. Adding ?m2w to link means converting mobile to web view.
Or,
Change settings of mobile browser i.e. User Agent. Both Steel and Dolphin browsers allow you to change that setting however. Both are free in the market. (I am not doing any marketing of browsers.)
Some of you may have noticed that, despite changing the User-Agent in the browser, you are still sent to a mobile website anyway. Check this patches given.
Check this huge discussion about tricks used for hiding mobile browser.

Is it possible to show a Facebook app as a Page Tab on mobile devices?

For example, the following URL shows the app in a tab:
https://www.facebook.com/just.to.get.a.rep?sk=app_203403406338325
But when on a mobile device it redirects to the mobile site and does not show the tab or even have a link to it:
https://m.facebook.com/just.to.get.a.rep?sk=app_203403406338325
I even have the application tab set as the Default Landing Tab for this page, but cannot get the pap to show for the page. Is there another format we need to develop for the App to support mobile? Ideally we would like to show the tab on iPhone app and other mobile viewing.
If you're in control of the link the user clicks on to reach your fanpage/pagetab-combination, then try adding a GET parameter ref=ts
h++ps://www.facebook.com/just.to.get.a.rep?sk=app_203403406338325&ref=ts
Apparently this prevents the redirect to the mobile version of facebook.
There's not currently any way to see App-provided Page tabs on the m.facebook.com site
Mobile web apps are supported, but they're not tied to the Page and need to be manually linked-to or bookmarked, the tab functionality simply doesn't exist now.
Currently you can develop application functions such as app authorisation but sadly no, you can't display standard iFramed tab apps, I suspect this is because of slow 3G data speeds and the fact that Facebook wouldn't want the mobile experience being any slower than it already is (dependent on external hosting etc).
Many of my larger clients are begging for it. The only workaround I use is to build an external page with the same content used in the iFrame - then you can direct users to the tab or mobile users to an external link.
https://www.facebook.com/pagename/app_000000000000000?ref=page_internal
as of now ref=page_internal is working as a work around.
You can redirect Mobile users to a specific mobile website, and have desktop users redirected to your page tab app.
Detailed instructions for doing this are available here:
https://stackoverflow.com/a/15860533/121285

iPhone: Pass information from web page to app that's downloaded from App Store

I'm trying to glue information from a web page to an iPhone app that said web page suggests to download. I control both the web page and the downloadable app.
Scenario is like this:
User visits my web page, on which I recognize the user (he may have logged in, and I store his info in a cookie). I then present a link to him to an app in the App Store that he should download for "enhanced experience" of this web service of mine.
Now, when the user launches the downloaded app on his iPhone, I like to re-identify the user who previously visited said web page.
All would be easy if an iPhone app could read Safari's cookies. But it can't.
A somewhat lame solution could be that the web server stores the visitor's IP address and uses that to recognize him once he launches the iPhone app. But that's not reliable.
Another one would be to give the user a token (code) that he needs to remember and then re-enter in the app. Still quite awkward, I think.
Any better suggestions?
Simply put, you can't do this.
One thing you could consider is a custom URL scheme to launch the app. You could send the user an email that uses this custom link. However there's a couple of problems with this:
the user may not have the account that they used to register for your site set up on their iPhone. This might seem unlikely, but say the user signed up for your site 5 years ago with their Hotmail account and they have since switched to Gmail.
it's unlikely that the email would fit into their workflow. They would probably download the app and just launch it by touching the icon instead of clicking a link in a received email.
You could also put the custom URL as a link on your web page, but again, this won't fit into the workflow because they have to go to the App Store app to do the download.
Consider this - if you've got some sort of website that has an authentication step, it's probably a fair bet to say that the user is the type of person who already has an application such as Facebook installed on their iPhone. They are already used to the paradigm of having to enter their credentials into an application despite the fact that they may have already done it in Safari.
If you could read the unique iPhone device ID from javascript on your web page, you could look for that again when the application connected...
But I cannot find any means of reading this from Javascript in Mobile Safari, I thought I'd post in case there is a way now to give you another option to consider.
OK, we found a somewhat working solution: The html code can create a cookie. Later, when the app runs, it can't directly read that cookie, of course (due to the sandboxing of iPhone apps). However, it can connect to the server, then open a http URL pointing to the server and including a unique token that it has gotten from the server beforehand. This leads to launching Safari, accessing the server. The server can now read the aforementioned cookie and finally establish the connection with the help of the token.
Just stumbled over this question and I'm curious if you thought about using a UIWebView.
Where the question is - does UIWebView share cookies with safari?
If it does the rest should be easy.
UIWebView's DON'T share cookies with Safari. So unfortunately that is not an option.