more than one app has same URL Identifier for Custom URL Application? - iphone

i have used custom URL scheme in my Application to open it from another Application(which may be my Own).suppose more than one Application in App store may have The URL Identifier i used.if user has two Application with same URL Scheme, what will open? will Custom URL Application be approved by apple?

Custom URL apps are accepted by Apple. However if multiple apps on the device have registered same URL scheme then the behavior is undefined. From iOS Application Programming Guide, "If multiple third-party applications register to handle the same URL scheme, it is undefined as to which of the applications is picked to handle URLs of that type."

Short answer: First app to register URL will sometimes open but it will fail to open often. Other times second app to register will open but fail often. Basically it fails a lot and really is "undefined". Use http://handleopenurl.com/ to avoid.
Long Answer:
I created two apps, FirstApp and SecondApp, and registered the same URL testURL for both.
I loaded FirstApp and the URL worked as expected, opening the app.
I then loaded SecondApp and the dreaded undefined behavior started occurring. Currently, under iOS 7, if two apps have the same custom URL registered it pops up a modal asking
Open this page in "Name of First App"?
When you tap the Open option it fails, and nothing happens. If you tap or enter the link again the first app installed with that URL, in our case FirstApp, will launch.
So in effect, the second app to register never gets opened, and the first app fails every two URL calls. No ideal behavior.
What makes it even worse is I deleted both apps and then switched the order I installed them and the results are not consistent. Sometimes it is one app, then on reloading both apps it is the other. The behavior really is "undefined".
Best practice is to use http://handleopenurl.com/ to see what URLs have been registered and chose one that will not conflict with other apps. You can't "steal" another URL because you can't be sure your app will open and not the other app.

this may be your answer that you are finding
http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
By reading this article It may be possible that apple can reject your application, still you can read the guide line provided by apple.
Thanks

Related

URL scheme in iOS

I have added an URL scheme to my application. The URL scheme is testapp://. While I entered the text testapp:// in Safari and on hitting return, it launched my application.
Then I tested with testapp://placeid=12. This is launching the TestApp in iPad but in iPhone, I am getting Cannot Open Page and I am not able to test.
I could pass the placeid=12 as URL query. But what I would like to know is, why it is not opening in iPhone alone.
Any idea on this?
Note: Irrespective of device types, it seems to be iOS issue. This is the behaviour from iOS 6 and above.
Could it be that each device is running a different iOS version?
If so, please take into account some details depending on the version. For example, if you read the Advanced App Tricks, there is a section that may help you:
Handling URL Requests
An app that has its own custom URL scheme must be able to handle URLs passed to it. All URLs are passed to your app delegate, either at launch time or while your app is running or in the background. To handle incoming URLs, your delegate should implement the following methods:
Use the application:willFinishLaunchingWithOptions: and application:didFinishLaunchingWithOptions: methods to retrieve information about the URL and decide whether you want to open it. If either method returns NO, your app’s URL handling code is not called.
In iOS 4.2 and later, use the application:openURL:sourceApplication:annotation: method to open the file.
In iOS 4.1 and earlier, use the application:handleOpenURL: method to open the file.
Hope this helps. Otherwise, I will really recommend you to stick to the standards. It would make your life easier :)
It is possibly not working because testapp://placeid=12 is not a valid URL. You will need a domain address there too, like testapp://localhost/query?placeid=12. It is possible the '=' character is causing the error.
I am not able to test it right now so let me know.
As mentioned in the question's note, it is iOS 6's Safari browser behaviour. We could not have "=" in the host of the URL while entering in Safari.
Instead, I solved this problem in the following manner.
Sent the URL in mail, and from Mail, if I click the URL, the app was launched. But the important point is, I had to parse the URL host to get the value.

Access the Apps available in iphone

Hi i would like to access the apps which are available in iphone means downloaded apps and inbuild apps.But here issue is if i access any app which is available in iphone using [[UIapplication sharedapplication]openurl:[NSURl url urlwithstring:#"http://www.skype.com"]] like this i can able to access that iphone app succesfully but if i want to come back to my app i did not find any way only i have to hit homebutton. So is there anyway to come back to my app at any point of time. if anyone know please let me know. Thanking you.
So is there anyway to come back to my app at any point of time.
Not unless the other app supports returning back to the calling app (by responding to a special specifier in the URL, for example).
Note that there is also -[UIApplication canOpenURL:] which will tell you if a particular URL scheme is supported. This is useful to check whether a particular app is installed without attempting to launch it.
That is default behavior of the iOS application. Once your application is in background there is no way to come back to your application programatically.
User has to manually open your application.
You can navigate to some other apps on the phone using the URL method, however you cannot return to your app.
Once you navigate to the other app, it takes over and your app is no longer running. Therefore, the other app would need to navigate back to you. That obviously is not possible, unless you had access to the code of the other app.

Does iTunes pass referral parameters on iPhone once app is installed?

Is there any provision in iOS wherein the referral parameters used to start the iTunes application are passed on to the application on its first run?
For example in Android, if I use a link such as http://market.an......com.company.pany&referrer=heythere to download an app on Android and actually install the app, the Market app passes the "referrer" parameter and its value to the app on its first run, which the app can use to any extent.
Is there a similar provision in iOS?
We also struggled with this when we built our last mobile app, Kindred Photobooks. The best way we found is to basically bundle that information in the link and use fingerprinting to make that data available after install, which is working really well.
You can try to build fingerprinting in in house. Basically the steps would be the following:
1. When a link gets created, appending parameters to the link, or create a link reference in some backend database if you want shortened links
2. When a user clicks on that link, collect a fingerprint of their device from everything you can read in the browser (for example: IP, OS, screen size, etc) and redirect that user to the app store.
3. When the app opens, create a similar fingerprint from the same parameters collected in app, and match it up in your database to the outstanding fingerprint.
4. If there is a match, you can return those link parameters to the app through install.
Alternatively, if you don't want to build all that infrastructure and handle the many edge cases, we bundled it up into a free service called Branch. Check it out at http://branch.io
No, there is no such thing on iOS. But you can and should file a feature request at bugreport.apple.com, if you really need this feature.
As of iOS6, if someone installs your applications via a smart banner, you can pass a url to your app on startup. You do this by using the app-argument parameter:
A URL that provides context to your native app. If you include this, and the user has your app installed, she can jump from your website to the corresponding position in your iOS app. Typically, it is beneficial to retain navigational context because:
It should work on install:
When the app finishes downloading [after clicking install on an app banner], the View button changes to an Open button, and tapping the banner will open the app while preserving the user’s context from your website.
More here: http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html
I think this will work (but the jury is still out: Does app-argument on Apple Smart Banner get passed to app on install? ), but testing this is tough: How to test Smart App Banner Urls on in Dev environment
No, AppStore doesn't pass any parameters to application - it just unzips ipa to application folder (container).

How to automatically update an iPhone app from within the app itself?

This link shows a video where an app upgrade is "forced" from within the app itself:
http://buzzworks.de/blog/update-ios-beta-apps-from-within-the-app
The App Store is not called in and it's said to work only for AdHoc
apps.
Anyone knows how is this possible?
edit: please give a look to the video before answering. AdHoc apps are signed by the developer and they do not come from the App Store. This sort of forced update is useful when doing beta testing and in enterprise applications.
I've found that it's all explained here:
http://developer.apple.com/iphone/library/featuredarticles/FA_Wireless_Enterprise_App_Distribution/Introduction/Introduction.html
The developer should create an .ipa with the app and a manifest in plist format with the URL to the .ipa and a few other things.
The app can optionally implement its own way to find if an update is available and open
the URL to the manifest.
I didn't it's really possible because the app has to somehow sign itself. The best I can think of right now is that the app is not signed?
You can always force people to go to the app store when a new version is out. Simply make the app connect to a webservice first. Other solutions are not accepted by Apple, or will quite simply not work because of other issues (signing is one of many).
You could also design your app in such a way that forced updates are never a requirement. You can load your user interfaces from the web (Apple has presented some valuable information about that during the previous WWDC), your data can come from the web, and if there is any other correction to do just ensure your app is backwards compatible.
That's how the app store works. And it never requires a 'forced update' ... Well, almost never ;-)

How do I make iPhone SpringBoard show two or more icons for one application bundle?

It seems like Info.plist file has an ability to declare different roles for the same application bundle through the UIRoleInfo key. SpringBoard can recognize these roles after installing an app and may display separate icons for each application role.
For instance, iPhone shows MobileSlideShow.app as 2 different programs: Photos and Camera.
Unfortunately, there is no official Apple documentation about the subject at the moment. Would anybody advise how to organize the same behavior in a custom app?
This feature is going to be used in the Enterprise product for ad hoc distribution.
This isn't a supported feature, so if you do this you might have a hard time getting your app through the approval process. I wouldn't recommend using it.
Have you tried it to see if it works? If it doesn't work, you could create a second app that does nothing but launch the first one, with a custom URL scheme. The first app can recognize when it is being launched with that URL. This is not ideal as you will see the second app launch & quit (though it should be really fast).