How does new Facebook App integrates App Store page? - objective-c

Since some weeks Facebook displays ads for apps in their iOS client. When you click on them the App Store apps detail page opens as a modal view controller inside the Facebook app.
I only know how do open App Store pages via their URL, but how to show a App Store page from inside your app?

You're looking for the SKStoreProductViewController. Here is a link to the docs :)
https://developer.apple.com/library/ios/documentation/StoreKit/Reference/SKITunesProductViewController_Ref/SKStoreProductViewController.html
I also found this helpful tutorial :)
http://www.techotopia.com/index.php/Making_Store_Purchases_with_the_SKStoreProductViewController_Class

Related

Facebook Deep linking in React Native

hope things going well on your side.
I'm displaying all post of a Facebook page on my app, and now, when I click on it, it should open Facebook app in post detail screen. Is that possible?

How to do FB feed share post without leaving my hybrid app?

I am making mobile app using Sencha touch which will be bundled as native app and installed on devices. In my app on certain pages I want to add "share" functionality which is supposed to post some data to user's feed. While testing on browser I can to do that by opening a window with FB sharing url like "https://m.facebook.com/dialog/feed" or "https://m.facebook.com/sharer.php" and passing all related params as explained in https://developers.facebook.com/docs/reference/dialogs/feed/
But when this app is bundled and I share with this, user is moved to browser and cannot return to app because redirect_uri cannot point to app which is why I wanted to open this dialog within my app, probably in an iFrame. This is also not possible because these dialogs are not allowed to be embedded in iframe by META tags and in order to surpass it I have to do user login which again is another dialog which I cannot open in my app's iFrame.
I also looked at sample sencha app http://blooming-day-7830.herokuapp.com/ but it also takes user to separate login page instead of opening in-app dialog.
So my questions is how does hybrid apps connect with FB without moving out user to browser?
if you decide to use PhoneGap you can try the following two options. You will have to check for the iOS version before you switch your Phonegap call to. . .
Option 1 : for iOS before 6.0
Phonegap has a pretty nifty ChildBrowser plugin that you can use to load the FB share page without leaving the app for iOS 5.0 and below.
Option 2 : for iOS 6.0+
Facebook Share functionality has now been added to iOS. So all you have to do, is call a custom plugin class that you create, and call the standard FB share code using a basic Phonegap plugin call. You won't leave the app, the ChildBrowser doesn't have to show up, instead, you'll get the stock iOS-FB share sheet that will show up, you can add pictures, text, and so on, and post to facebook.

iOS App & jQuery Mobile Site - Include JS file ONLY if page is viewed in native iPhone app

I have a mobile website built using jQuery Mobile. I am currently designing an iOS native app with a single webView to display this mobile website.
PROBLEM:
If the jQuery mobile webpage is viewed in a normal mobile browser, I want all to function normally. BUT if the webpage is viewed using the webView in the iPhone app (not Safari.app) I am designing, I want to include an additional line of code on the webpage to pull in some custom JS.
Here's what I want to be added to the page ONLY IF viewed inside of my iPhone app's webView:
<script type="text/javascript" src="http://www.example.com/mobile/js/custom-jqm-defaults.js"></script>
This code needs to be pulled in (according to the jQuery mobile docs) before jQuery Mobile is loaded. Is this possible? And if so, could you point me in the right direction and give me some code?
EDIT
I found this link whereby Facebook detects if they are being viewed WITHIN an app. Is there another way to do this obviously NOT using the FB API? Here is their code:
if (FB.UA.nativeApp()) {
// Hide your credits stuff
}
You can change the user agent in your NSURLRequest, and then check for that agent on your server.
Changing it app-side is easy.

How do you associate a Page with an App, now that the migration deadline is over?

Here's the situation: I have a native iOS app that had its entry in created Facebook Developers before App Profile Pages were deprecated. There is an automatically created App Profile Page for the app, but when I view it, it has a yellow box saying:
Removing App Profile Pages App Profile Pages are now deprecated. We
recommend updating any links that you have shared to your App Profile
Page to point to your new target Page or app. Please save any content
or Insights that you wish to keep. This content is accessible via the
Graph API with any valid access token. For additional information,
please review this post:
https://developers.facebook.com/blog/post/2012/02/01/how-to--migrate-your-app-profile-page/
Before February 1st, there was a link to migrate this page to a regular Facebook Page, but now there isn't. I've created a new Facebook Page according the the docs, and the page has the same name as the app and the category is set to Products/App. But I see no way to associate this new page with my app.
How are we supposed to associate a new Facebook Page with an existing app?
So I ended up deleting my app on Facebook and creating a new one. This meant changing the App ID strings in my iOS app and in its URL handler, but now it works correctly, and I can create a normal Facebook Page for the app. If you have an existing app that customers are already using, that means you'll break the app unless they've updated it on their iOS device, and you lose everything on the old page.
To associate an existing Facebook Page with an App:
Go to your Facebook Page and click "Edit Page" section
In the Basic Information tab, set Category as "Brands & Products" -> "App Page"
Make sure the Page name is the same as the App name
Go to your Facebook App "Edit App" page, and now you will be able to choose the Page as the App page.

How to launch Facebook with Button

Hey friends
I created a button on my app called: "Find us on Facebook". Right now I ran into a situation where I need the button to launch the Facebook application. I could really use some help such as launching the facebook application, detecting if there is a facebook application, and all the sorts of stuff like that, thanks
Some googling shows that the facebook app apparently registers to receive urls with the fb:// scheme. So you can construct a fb:// url (like, say fb://notes or something) and then ask the UIApplication object if it can open the URL. If it says that it can, then open it.
there is a tutorial and sample app at https://github.com/facebook/facebook-ios-sdk
Basically you need to try to call fb://profile/yourpageid to load the FB app on your page.
The sample app shows you how to do this and fall back to loading in Safari if the app is not installed on the device.