iOS SDK: Custom open graph story with "Feelings" - ios

I'm successfully publishing a custom Open Graph story, with a custom FBSDKShareOpenGraphAction and a custom FBSDKShareOpenGraphObject.
However, I can't find the documentation for assigning a "feeling" to the story. There are a few questions here on SO but the answers say it's not possible, although the Runtastic iOS app does it (see the "feeling awesome" part):
I'm not using the standard Share Dialog (FBSDKShareDialog) but am implementing my own custom interface as advised in their docs
Has anyone had any success with this? Any thoughts/ideas are greatly appreciated.

Related

Swift - NSURLSession downloading in background?

I'm creating an iOS app by swift that is as same as the AliExpress iOS app.
This App has ability that connect to our site and download all of data from JSON api online.
Now, I wanna download the images of the icons and banner slider from our site by JSON api in main page. But I don't know how i can do it. Do I use queues or background functions like in android? Also, I'm an android developer and i know how i can do this in android. You can guide me by this way ,too. please guide me by sample codes or description of its logic.
Please refer following link for tutorial
http://www.raywenderlich.com/51127/nsurlsession-tutorial
Apple documentation can be found on following link
https://developer.apple.com/library/prerelease/ios/documentation/Foundation/Reference/NSURLSession_class/
Swift example can be found here
http://jamesonquave.com/blog/making-a-post-request-in-swift/
I have also created a demo for the same
https://github.com/Gagan5278/SessionDownload
Let me know if you want more on this.
You have the seed of your answer in the title of your question. You want to create an NSURLSession and add NSURLDownloadTasks to it. That class does all the work for you.
A quick search on Github reveals this repository that claims to offer an async download queue in Swift:
https://github.com/Gurpartap/Cheapjack
(I haven't used that one. You can either build it into your project or look at the code and use it to implement your own download sessions.)
There is also AlamoFire, another swift library that has built-in JSON support.

ios facebook sdk v3.11 share dialog post button disabled

I was following the tutorial for facebook sdk for ios, specially using open graph to attach an image and tag friends (which social framework can't do directly).
So I was following this tutorial and this sample app, FBOGSampleSD. https://developers.facebook.com/docs/ios/open-graph#sharedialog
However my post button in the share dialog is always disabled. (grey out)
Has anyone encountered this before?
I am working with Xcode 5 and testing on ios7 device.
Regards,
Jin
I think I figure this out.
Your share button might be disabled because you didn't finish the Facebook app configuration, or it doesn't match what you are sharing through xcode/ios app.
- on Facebook Developer
In the settings of your app, you need to have iOS AND website added as platforms.
in the website platform you need to declare the website url or mobile site url: this is going to be used when someone click on your post from a computer. It needs to be a real site you can access, possibly the website of your app or a webpage about your app included on a website. For this example I'll be using
http://www.yourappwebsite.com
Once you do this, in the "Add Domains" field (in the section where you set namespace Display name and such), you need to put the SAME domain you declare as a website.
This will be the only domain(s) allowed to host links and image of your OGStory.
In this example is
yourappwebsite.com
- Back to Xcode
You should have some code that define the object you are posting an the action, something like:
[FBGraphObject openGraphObjectForPostWithType:#"yourapp:yourobject"
title:#"Roasted pumpkin seeds"
image:#"http://www.yourappwebsite.com/yourpic.png"
url:#"http://www.yourappwebsite.com"
description:#"Crunchy pumpkin seeds roasted in butter and lightly salted."];
As you can notice, the domain used for both the link AND the image is the one previously specified.
Now your share button should appear enabled.
I hope it helps,
ciao.
I was struggling with the disabled POST button myself and it turned out that my App's plist information was not set correctly for Facebook integration. Specially the FacebookDisplayName must match the name you entered in your Fcb App settings.
This SO answer pointed me to right direction, hope it helps!
[FBGraphObject openGraphObjectForPostWithType:#"namespace:yourobject"
title:#"Roasted pumpkin seeds"
image:#"http://www.yourappwebsite.com/yourpic.png"
url:#"http://www.yourappwebsite.com"
description:#"Crunchy pumpkin seeds roasted in butter and lightly salted."]
namespace is the one you have to set it in your setting->basic->namespace

FBRequestConnection does not provide UI while FBDialog Does

I am using FBRequestConnetion to post[only text] on the wall. But, the problem there is deprecated class in latest FacebookSDK , which is FBDialog.
So, Is there any other UIComponent in latest FacebookSDK, through which I can achieve the FBDialog Behaviour to post on the wall.
Or I have to design my own UI and use FBRequestConnection.
I'm confused about this too. Looking at the HelloFacebookSample sample from the SDK, that's what I understand:
In the previous SDK, we could display a dialog where the user can customise the message, and choose to post or cancel. I think this didn't require any special Facebook permissions.
Now iOS6 has a nice native dialog, but the iOS5 fallback is to post directly using FBRequestConnection - which just posts directly without any dialog, and also requires the "publish_action" permission.
I guess I arrived at the same conclusion, if we want a nice dialog on iOS5, we have to:
create the UI ourselves (maybe imitating the IOS6 popup) and ask for the new permission
or use the deprecated headers in the SDK folder (not sure I'd go there...)
Take a look at SDK that was just released + this link for a a native UI built on top of iOS6:
https://developers.facebook.com/docs/howtos/ios-6/
You can also look at the updated sample HelloFacebookSample that's included in the SDK that shows how you can post a status update for a user.

iOS: Adding a Facebook Like button to a native iPhone app

I would like to know whether it is possible to add a Facebook Like button to a native iPhone app. In the app, the user browses a business directory or deals. When they tap on an item to view the details, it would be nice to have a Facebook Like button that can be used to post the item to the user's Facebook page.
Facebook writes: "Currently, the Like button is only available in mobile web apps".
My app is a native app and not a web app, so therefore I assume it's not possible. However, I do assume that it is possible to mix native UI components on a screen along with web components and therefore it might be possible to implement the Like button, although I am not sure how you pass data from the native portion to the web portion.
If the only solution is a hack, then I won't implement it because at some point the hack will fail when Facebook alters their API.
read around SO a little, you get many leads. Here's one:
Like button in iOS application
And a comment points to github.com/brow/FacebookLikeView
It has same caveats, but it seems there aren't any magic solutions.
There are these blogposts as well:
http://angelolloqui.blogspot.com/2010/11/facebook-like-button-on-ios.html
http://petersteinberger.com/2010/06/add-facebook-like-button-with-facebook-connect-iphone-sdk/
But not sure you get a native UIButton. Maybe you can open a webview in the background and emulate a click on it...
GL, update if you have some findings,
Oded.
Now you can use the FBlike button using the following code but it need to download latest sdk and it is the beta version :(
Here is the code:
[FBSettings enableBetaFeature:FBBetaFeaturesLikeButton];
[FBSettings enablePlatformCompatibility:NO];
FBLikeControl *like = [[FBLikeControl alloc] init];
like.objectID = #"http://shareitexampleapp.parseapp.com/photo1/";
like.likeControlHorizontalAlignment=FBLikeControlHorizontalAlignmentRight;
like.likeControlStyle=FBLikeControlStyleBoxCount;
[self.view addSubview like];
It looks like Facebook finally decided to allow this, more directly, via the Open Graph API.
See documentation here
Check this out, FB just made it possible through their SDK. Only for testing and ios for now
https://developers.facebook.com/docs/ios/like-button/

Smaato and iAds combined

i am willing to implement iAds by default in my application which is now correctly showing, and also I have properly implemented Smaato's SDK.
Is there any method to show by default iAds and when this don't serves me an ad, then pull from Smaato?
Thank you
There is an example for this within the Smaato Ad SDK. When you open the folder iSomaDemoApp/iPhone you will see the files
SOMAiAdBannerView.h and
SOMAiAdBannerView.m
which implement the behavior you are looking for.
The usage is the same as a default SOMABannerView, but you can have a look at iAdViewController.m in the same directory to see an example.

Resources