Opening Another Application From My App - facebook

this is my first question on the site so if i don't cover anything please let me know and i'll try and fix it :P
I'm trying to make my application load another app from inside the app. An example which i can use to make what I'm trying to do more clear is, I want to load FaceBook from my application without it loading a UIWebView. I would like to do this for Facebook, YouTube, Twitter & Instagram. Also if possible all going to specific areas on the site, so the Facebook profile, YouTube channel, Twitter Page & Instagram profile!
Also I know i would have to write an if statement for it to be, if the user has set application on their device then load in that application else if they don't then load in the web view

You want to use the URL schemes of the other apps. If you know the URL scheme of an app then you can use openUrl: to send a message to another application and bring it to the foreground.
After a quick search you can find some popular app url schemes here along with some examples.

You need to use URL Schemes, this wiki has the major ones listed
http://wiki.akosma.com/IPhone_URL_Schemes

Related

codename one. How to share a link to your app.

What I want to achieve here is similar to what most apps do, specifically like Youtube. If I share a video on youtube the user gets a link to the video. When the link is clicked the user is automatically taken to the video in the Youtube app (if the user has the app). I want that sort of functionality. My app has different stores on it and information about the store. I want the user to be able to "Share" a store via Whatsapp, sms etc so then when the receiver clicks on the shared link they are automatically taken to that specific store's page INSIDE my app. And if they do not have the app the link must take them to my app's page in the app store to allow them to download it. How do I achieve this in codename one. I looked at the share functionality in the developer doc and the How To section and that only shows me how to share text or images. Not a link to my app.
You can use the ShareButton or it's underlying native share API call (notice this behaves differently on devices as this relies on native functionality).
To share one URL that works on all platforms you need server side code as we have no way of knowing if the guy who will click the link has the same device as you have.
How to make QR code for BOTH Android Market and App Store answers that although it discusses QR codes this is applicable to links as well e.g. http://onelink.to/ looks like it could solve that although I haven't tried their service.
The correct answer to this question was actually URL intercepting. http://www.codenameone.com/blog/intercepting-urls-on-ios-android.html You share a url from your app to an external application. When the user opens that lick in an external application the user is automatically taken to your app if your app intercepts it.

Detecting installed apps on iPhone with javascript or url

I am building a HTML5 based mobile web app for iPhone. I need to check whether user has specific application that I suggest. I heard that each iPhone application has unique URL scheme to detect their app indentity.
Therefore, I've read this article to get an idea.
Is it possible to register a http+domain-based URL Scheme for iPhone apps, like YouTube and Maps?
However, this is not perfect answer to make what I am trying to make.
here is what might happen
User clicks a recommendation app on mobile web browser.
Check with application iTunes URL and URL scheme.
If the user has the installed application, it returns 'installed'
==> In this case, the screen returns back to mobile browser.
If the user does not have the installed application, it returns 'uninstalled'
==> In this case, the screen moves to App Store.
I am running mobile web app with PHP language.
Thank you.
this is not possible I'm afraid. To be honest I'm glad, as there are real privacy concerns if any old web page can detect which apps I have installed.
That's definitely not a good thing!
UPDATE: If you're happy to go native, this library will do what you want.. http://www.cocoacontrols.com/platforms/ios/controls/ihasapp
If you know that a url scheme for the app exists then you can open it via a web link like this, "myapp://". With this there are some round about ways you can effectively check if a certain app exists.
See this related stackoverflow post

Facebook Integration in iOS app

I need to post a user-specific text, determined by him, on his wall/timeline when he presses a button (in facebook's tutorial, they make the user login when the app launches, and then it does nothing).
There is a lot of information on the internet but every site does it in other way.
Just wanted to know if there's a specific way to do it.
Thanks!
A quick easy way to add facebook to your app is ShareKit (http://www.getsharekit.com/). This also allows you to add other social network site to your app.
You might want to try Socialize: http://www.GetSocialize.com. It'll allow app users to comment & like within the app, with the option of also sharing out to a social network (Facebook currently live; Twitter coming). Full feature list at http://go.GetSocialize.com/features
DROdio

iPhone: launch app with YouTube URL?

I want to register a custom URL scheme that will enable my app to be launched whenever the user goes to a YouTube URL (http://www.youtube.com/watch?v=VIDEO_IDENTIFIER) in the browser.
Is this possible?
Edit:
After poking around I realized that YouTube's URL scheme is simply youtube://. What I want to do is that whenever there is a call to YouTube with the URL scheme, I want my app to be launched instead of the YouTube app - is this possible? What happens when there are conflicting URL schemes?
URL scheme is the thing preceding ://. It means you can't assign your app to handle youtube urls or any other http urls.
Update
Although Apple mentions YouTube URL Scheme in the docs, in the context of implementing custom URL schemes only the part before :// can be specified.
Update 2
Regarding your updated question. I'm pretty sure Apple wants YouTube app launched for youtube:// URLs. Since I haven't found an explicit note about conflicting URL schemes, I can't tell how the OS chooses an app to launch in general for a custom URL scheme.
As for the URLs handled by the built-in apps, they are very likely to remain so, i.e. it's impossible to override a built-in app and handle an http:// or a youtube:// URL with your own app.
You can do that and it will work on the simulator but the app will never get past the App review process.
On a side note, why would you want to do such thing as redirect youtube urls to your app, it's at least confusing to the user.

How can I add a link to my app on the homescreen

On iphone my native app has an URL, so that if you type an url starting with myapp:// it will open my app and it will handle the URL and go to the relevant place.
Is there a way to get these urls as a web app bookmark on the iphone's homescreen?
EDIT: To put it another way, I want add a webapp to link to my native app.
This is not possible. Never will be, as duplicates may occur then, e.g. two web apps with goatse://…, as Apple cannot check web apps.
It is possible to add Web Clips without going into Safari, and to specify a custom URL. But the Apple docs say that Web Clips will only work if the protocol is http or https (i.e. not my app://)