Social Plugin Answers for the blog post

This is to take discussion from the Social Plugin blog post and move it to the forums where it’s easier to answer complex questions that may involve back and forth.

@Greg wrote:

Hi Rob – can I ask:

a) could you drop in a few screen snapshots to show what the end result looks like?

Sure:

socialphoto.PNG

socialphoto2.PNG

just as an FYI, I’m using iOS 7 Beta on my phone that I snapped these on, ergo the odd looking keyboard.

b) re your comment confirming you do not need to use any of the other
facebook functions (e.g. login) besides this: “if all you want to do is
have the app user post something to their timeline”. Can I ask then
would this plugin alone allow you to have the user able to:

– click a single button and then
– post would be auto-created for them
– post could include words you pre-populate for them (e.g. “playing game XXX and loving it”
– post could include an image (or a link to an image on a webserver)
– post could include links to app store/google play for your app

Yes, with the exception that the app user will get the above dialog and can change the text, and potentially remove the images and links.  This is all done without ever “requiring” facebook or calling facebook.*.  But like SMS and email, Apple wants to give the app user final approval over what they send. 

c) so if you build it how you’ve suggested as people upgrade they
should automatically get the feature as their device OS is supported
correct?

This is a feature of the operating system that we are exposing for you.  If your app user is on iOS 5 and upgrades to iOS 6 they will magically get this feature with no additional work on you (besides supporting it in the first place)

d) is the interface rendered from the plugin generating the UI? or

does facebook send the plugin the UI definition so to speak? I assume
the former?

This is rendered by the Operating System.

e) I assume it includes it own login screens also then? (i.e. as you don’t need to use the facebook.login api)

The login screens are under the Setup App and scroll down to the Twitter and Facebook entries.  These are accounts set up and managed by the operating system.

f) actually typing this out now (admit I haven’t gone looking) but is
there a sample app in our Corona download that gives a demo?

There is: https://github.com/coronalabs/plugins-sample-native-popup-social

as listed on the Plugin’s Documents page: http://docs.coronalabs.com/plugin/CoronaProvider_native_popup_social/index.html

@haakon asked: Seems to not be working for iOS 7 – even though the twitter account is
set up and logged in in system settings, all I get is “there are no
twitter accounts configured”.

Both Danny and I’ve tested it under iOS 7 and it works.  However I was playing around with trying to make Twitter’s double login system work today and the native login for Twitter wasn’t letting me authenticate.  Something about needing to generate a temporary password (which I did and it still didn’t work).  I didn’t try the Social plugin while I was in this state, but it definitely broke using twitter until I killed the dual auth stuff and things seem happy now.  I wonder if that’s what you’re running into.

@kerem wrote:  What I would love to see is a simple list of functionality open to
mobile apps in Facebook, Twitter etc and then a check mark or X mark
next to each showing whether Corona Supports it or not. Then check mark
should be clickable to take us to further detail telling us more about
how to make that functionality work etc. Can we have a simple document, a
jump board like this? Thanks

The problem with this request is that the Facebook OpenGraph API is huge and ever growing.  We could spend our energy trying to document everything you could do with Facebook and we would never get any other work done. 

For both Twitter and Facebook, their API is base around RESTful type web services.  So even if we didn’t have a facebook API, you could pretty much do everything with network.request().  Now Facebook is requiring native apps to use their native login before using their REST services going forward (which we already support).  While we don’t have a twitter.* API like Facebook , we do offer an oAuth.lua module in the sample app with examples on how to reach their RESTful API. 

Now sometimes Facebook adds new things that are not part of their OpenGraph API (or more likely take things away), like thier advertising based publishInstall call that required some things we had to add to make work.

Thanks for that clarification. I understand. Most appreciated. 

Hi Rob,

First of all, thank you and thanks to the corona team for this awesome works.

I have a question about adding image to posts :

 post could include an image (or a link to an image on a webserver)

how can add a link to a remote image ? Is it even possible ?

[...] image = { -- image needed : http://www.mywebsite.com/myimage.jpg { filename = "world.jpg", baseDir = system.ResourceDirectory }, }, [...]

Thank you,

Hi Sunny,

How about downloading the image to your temporary directory, then pointing the “image” table info to access that image via the social plugin? Would that work for you?

Thanks,

Brent

A couple questions:

  1. How common is it for a user to not be logged into fb or twitter on their device (i.e. via the Settings menu)?  In the case that they are not logged in, is there a way to provide a link in the error message that will open up the FB settings in the main Settings screen?   Or at least the Settings screen alone?

  2. Is there a way to confirm (i.e. something gets returned) that the user actually submitted the share?  For example, if I want to reward the player with 10 coins for sharing the post, I would need to make sure the user actually clicked “Post” and not “Cancel”.   Is there a way to differentiate? 

Found the answer for #2 in event.action (returned either “cancelled” or “sent”)

Will there be any plans to include Google+ in this too (apart from Apple including it) ?

I’ve not heard any rumblings about G+ from the Apple side.  The API that we used on iOS uses what iOS gives us.  On the Android side I’m not sure what the engineering plans are.  However, the best place to make these wishes known is at:

http://feedback.coronalabs.com

and add the request or vote up an existing one.

Hi Rob,

Is there a way to test that a given service for the social plugin is “potentially” available if the user sets up there account?  

From what I’m seeing the “local canFacebook = native.canShowPopup( “social”, “facebook” )” type check basically needs the platform (e.g. IOS/Android) to support the plugin plus the account to be there.   What I’d like to do is be able to do a check that highlight which category the user is in:

E.g. Check for Facebook, either:

* not available (e.g. on Android) so don’t show button

* available on platform but account not setup - show button but give “setup your account” if they click on it

* available on platform + account setup - show button and sent message when they click

How could I do this?  

You could check to see if they are on iOS5 and if so, enable a twitter button using the “twitter” popup.  If they are on iOS6 or later, then you know the OS  supports Facebook, twitter and sinaWeibo.  If your on iOS6 and the check fails, then you can prompt them to add it.  There is probably some URL scheme to launch the settings app, but you would have to research that on Google.

@Greg wrote:

Hi Rob – can I ask:

a) could you drop in a few screen snapshots to show what the end result looks like?

Sure:

socialphoto.PNG

socialphoto2.PNG

just as an FYI, I’m using iOS 7 Beta on my phone that I snapped these on, ergo the odd looking keyboard.

b) re your comment confirming you do not need to use any of the other
facebook functions (e.g. login) besides this: “if all you want to do is
have the app user post something to their timeline”. Can I ask then
would this plugin alone allow you to have the user able to:

– click a single button and then
– post would be auto-created for them
– post could include words you pre-populate for them (e.g. “playing game XXX and loving it”
– post could include an image (or a link to an image on a webserver)
– post could include links to app store/google play for your app

Yes, with the exception that the app user will get the above dialog and can change the text, and potentially remove the images and links.  This is all done without ever “requiring” facebook or calling facebook.*.  But like SMS and email, Apple wants to give the app user final approval over what they send. 

c) so if you build it how you’ve suggested as people upgrade they
should automatically get the feature as their device OS is supported
correct?

This is a feature of the operating system that we are exposing for you.  If your app user is on iOS 5 and upgrades to iOS 6 they will magically get this feature with no additional work on you (besides supporting it in the first place)

d) is the interface rendered from the plugin generating the UI? or

does facebook send the plugin the UI definition so to speak? I assume
the former?

This is rendered by the Operating System.

e) I assume it includes it own login screens also then? (i.e. as you don’t need to use the facebook.login api)

The login screens are under the Setup App and scroll down to the Twitter and Facebook entries.  These are accounts set up and managed by the operating system.

f) actually typing this out now (admit I haven’t gone looking) but is
there a sample app in our Corona download that gives a demo?

There is: https://github.com/coronalabs/plugins-sample-native-popup-social

as listed on the Plugin’s Documents page: http://docs.coronalabs.com/plugin/CoronaProvider_native_popup_social/index.html

@haakon asked: Seems to not be working for iOS 7 – even though the twitter account is
set up and logged in in system settings, all I get is “there are no
twitter accounts configured”.

Both Danny and I’ve tested it under iOS 7 and it works.  However I was playing around with trying to make Twitter’s double login system work today and the native login for Twitter wasn’t letting me authenticate.  Something about needing to generate a temporary password (which I did and it still didn’t work).  I didn’t try the Social plugin while I was in this state, but it definitely broke using twitter until I killed the dual auth stuff and things seem happy now.  I wonder if that’s what you’re running into.

@kerem wrote:  What I would love to see is a simple list of functionality open to
mobile apps in Facebook, Twitter etc and then a check mark or X mark
next to each showing whether Corona Supports it or not. Then check mark
should be clickable to take us to further detail telling us more about
how to make that functionality work etc. Can we have a simple document, a
jump board like this? Thanks

The problem with this request is that the Facebook OpenGraph API is huge and ever growing.  We could spend our energy trying to document everything you could do with Facebook and we would never get any other work done. 

For both Twitter and Facebook, their API is base around RESTful type web services.  So even if we didn’t have a facebook API, you could pretty much do everything with network.request().  Now Facebook is requiring native apps to use their native login before using their REST services going forward (which we already support).  While we don’t have a twitter.* API like Facebook , we do offer an oAuth.lua module in the sample app with examples on how to reach their RESTful API. 

Now sometimes Facebook adds new things that are not part of their OpenGraph API (or more likely take things away), like thier advertising based publishInstall call that required some things we had to add to make work.

Thanks for that clarification. I understand. Most appreciated. 

Hi Rob,

First of all, thank you and thanks to the corona team for this awesome works.

I have a question about adding image to posts :

 post could include an image (or a link to an image on a webserver)

how can add a link to a remote image ? Is it even possible ?

[...] image = { -- image needed : http://www.mywebsite.com/myimage.jpg { filename = "world.jpg", baseDir = system.ResourceDirectory }, }, [...]

Thank you,

Is there any way to get an idea of when the plugin will be available for Android?  Is it like weeks/months?  This is an important feature in my app and the only one preventing it from being truly cross-platform.

No promises. No warranties expressed or implied.  No one is allowed to say “But Rob said…” in the future.  There are too many variables in the way, but if the cards fall just right,  probably weeks and not months.

Did I disclaim that enough?