Phone Links iPhone SDK - how to return to app - iphone-sdk-3.0

Is it possible to return to my app once a phone link (tel:) has been clicked, and opened using
[[UIApplication sharedApplication] openURL:xyz]
For example, when the user ends the call?
Thanks

No. Although if you store your state using NSUserDefaults (or other means) you can return to the same point where you left; the user will have to relaunch your app to do this. This approach is recommended in the Human Interface Guidelines.

No, unfortunately there is no way to achieve this, since clicking a link will always first terminate your app and then start the new one.

Related

Bring other running app's window to front

What I am trying to achieve: when user presses "buy" in my app, App Store window should appear with my app url in it.
This works fine when App Store is not running: [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:#"macappstore://..."]];
But when App Store is already running and is minimised in the dock it's window doesn't show up. It becomes active, yes, but the window doesn't appear.
What I have already tried: fetched app using NSRunningApplication and trying to unhide, activateWithOptions: it, but this doesn't work.
I don't see more options in NSWorkspace and NSRunningApplication, so if someone have some solutions for this, it would be appreciated.
Mmm I can't think of any approach that does not involve Applescript or Accessibility APIs which then requires the user give your app access permission which is even worse. (I mean, you could quit and relaunch App Store, but that's jarring.) Honestly this is bad behavior in App Store, so you should file a report with Apple noting the window doesn't come to the front. It won't help you now, though.
But doesn't this bring it to the front even if it's minimized?
NSWorkspace.shared.launchApplication("App Store")

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.

IOS - How to create a modal user/password outside the UIApplication?

I am not sure this can be done at all...
Background: I am constructing an in-house application which means it does not get into appstore so i am not limited by the appstore guidelines.
I have a dylib which loads before the main application. It is a kind of augmenting library for applications. I am using the constructor __attribute__ to load my stuff. In there i would like to put an alertview or any kind of popup which will receive a user/password question. If the password is correct than the user is allowed to continue into the original application.
Since this is in the dylib i do not yet have a UIApplication and i do not want to interfere in the original application or sources.
Suggestions, tips are welcome...
Thanks.
This is how i've done very similar thing in my application:
0) Intercept applicationDidFinishLaunching message, add your own code, run original implementation.
1) Make opaque fullscrean UIWindow (for example, black).
2) Set its windowLevel to UIWindowLevelAlert + 1 So it hides every other window in app.
3) Add fields for user and password to this UIWindow.
I'm pretty sure you can't show a UIAlertView without having initialized the UIApplication and UIWindow instance.
Only the iOS itself can show alerts outside the application, for example when it asks for permissions or in case of iTunes or game center login ...
As a workaround you can:
make a login view inside the application
create a web application for the login process. The web app could launch the native app with a custom URL scheme and pass parameters like 'user' and 'password' to the app.
You should create a View for the Login then if you pass the login you can go on using the app otherwise you just make the app shut itself.
You could start a thread when loading your dylib and make it listen for your UIApplication to become available, then display the alert on the main thread.

Current location alert access

What is the class or API used to popup the alert to the user for their current location access permission to the app?
When you are using core-location the app shows automatically the alert for permission. You can't disable/enable that by yourself.
Not quite sure what you're asking ... is this related to a web application? iphone? android? java? fortran? Anyway, i'll go on a limb here and think you're referring to the HTML5 GeoLocation API:
http://html5demos.com/geo
This other question may be of value to you if it's iOS and you don't want to do it once with HTML5 ...
What's the easiest way to get the current location of an iPhone?

disabling the home button on ipad [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Disabling home button on iPhone/iPad
hi developers
i am trying to disable the home button. the reason being my app is designed to be like a convenience store register , the person using the app would be entering the opening and closing balance while loggin in and loggin out of his shift. so when the home button is pressed(accidentally) there is no way of entering the closing balance.i did try some stuff in applicationWillTerminate method in the app delegate , but it did not work. i have put a check mark against "application will not run in background" in the info.plist so that the user has to login again with the password(that takes care of security issue). now , what i was thinking was instead of trying to code in applicationWillTerminate is there anyway i can disable the home button so that the only option left out for the user to logout is the proper logout button.
and last of all , this app will not be in the Appstore , its for a client. i dont have to bother apple rejecting my App for sure.
The only way would be to get a case that covers the home button
IMPOSSIBLE!!! not even an API for a jailbroken phone will have this feature.
try some alternatives:
do allow the app to run in the background,
but log the user out after 2mins of backgrounding [takare of your security], by saving the current time in applicationWillResignActive and checking it against timeIntervalSinceDate in applicationDidBecomeActive
save the closing balance as a variable in NSUserdefaults against that user when logging out due to timeout/terminating and maybe ask him if he wants to enter it in if he logs in again.
Short answer: no. You can't do that.
I'd be very surprised if this was possible, even using private APIs.
In essence, the operation of the home button is controlled by the underlying OS (the "springboard" app launcher in this case), so it's unlikely to be possible for an application to override or somehow block the "button pressed" message.
That said, some alternatives have been discussed within the existing Disabling home button on iPhone/iPad question.