google photo set uploaded album to public - photo

How to set the google photo album to public when creating using java api
I am using AlbumEntry to create album using PicasawebService class

You can use the
AlbumEntry.setAccess(String access)
method
By default the ablum created will be private. To explicity make the album public you can use public as the method parameter.
So you need to call
albumEntryObject.setAccess("public");
before calling the
picasawebService.insert(..)
method.

Related

Google app engine Endpoints, Objectify Register

I start google app engine with endpoints, I use objectify for persistence and I have an little question.(I hope !)
All my apiMethod start like it :
#ApiMethod(path = "getAccount", httpMethod = HttpMethod.GET)
public Account getAccount(#Named("idPlayer") long idPlayer) {
ObjectifyLoader.loadEntity();
ObjectifyLoader.loadEntity(); is just a method like it
public static void loadEntity(){
ObjectifyService.register(Account.class);
ObjectifyService.register(WeaponsAccount.class);
}
I got the impression that I register my class et each call to the api.
A tips for load only one time?
Thanks you for reading.
Fabiitch
You want to use a ServletContextListener. Check out this App Engine oage for an example.

Facebook API 2.0 - Is Profile Public for View

I'm searching and yet cant find a way,
how to check if page is public for view in facebook
example
www.facebook.com/zuck - is public
www.facebook.com/jacek.pietal - is not public
I mean, by public, a page can be observable (for public persons)
I need to check this with PHP API
I know there was SUPPOSED to be a is_published field on /me GET but there isn't
I know accessing /user_id should get this but I can only do this from app-level session and it always can read that because users have accepted my app
Those are not pages, those are user profiles. The is_published field is only available for pages, as you can see in the docs:
https://developers.facebook.com/docs/graph-api/reference/v2.3/user
https://developers.facebook.com/docs/graph-api/reference/v2.3/page

How to use apprequest for send or askfor using OpenGraph API?

I am using Facebook Unity SDK to implement a sample gift module in my game.I am using the method:
**public static void AppRequest(
string message,
OGActionType actionType,
*string objectId*,
string[] to,
string data = "",
string title = "",
FacebookDelegate callback = null)**
Ref: https://developers.facebook.com/docs/games/requests/v2.2
AS the OGAction type refres to the action like askfor or send,the next arguement is object_id which i unable to get properly.
Can anyone tell do the object will be created in the app itself or it must be created in the opengraph section of my app registerd on facebook?Do i need my own sever for this?
I just need to send an item and and recieve it at the reciever's end.Please tell me where i am wrong or what i should i do to get it properly?
This is what I did:
1- On the "Tools & Support" section in the Developers' page, open "Object Browser".
2- Set the "App" and "Object Owner" section to your App.
3- Click "New Object".
4- A new object will be created and you can copy its id in the AppRequest parameters.
I don't know if there is an easier or better way to do it but, so far, I have been getting requests without issues.
Cheers!

Access token error when trying to post a Facebook score in a canvas application

I'm trying to integrate the scoring system in my canvas app with Facebook's, implemented using MVC 3 and the 5.2.1.0 Facebook SDK.
A simplified hello-world variant of my game controller looks like:
public class MyController : Controller
{
[CanvasAuthorize("publish_action" /*And some others*/)]
public ActionResult Index()
{
var fb = new FacebookWebClient();
var scores = fb.Get("/me/scores"); // Works (I think)
fb.Post("/me/scores", new { score = 10 }); // Throws an exception
}
}
The call to get scores looks like it's giving me something sensible; the call to write a score value throws "(OAuthException) (#15) This method must be called with an app access_token."
What've I missed? The application id and secret are correctly set in my web.config - for example, I can successfully post an application apprequest in other parts of the actual application not shown in this stripped down test copy. Rummaging around with the debugger shows me that the FacebookWebClient object contains a non-empty access token field, and that that's included in the URI that fb.Post eventually uses.
The Facebook scores page (that Björn links to) mentions only publish_actions but I've tried including other pertinent sounding permissions, such as offline_access and user_games_activity to no effect.
I am assuming that the CanvasAuthorize attribute does the login correctly - it certainly seems to let me send an application apprequest, so it looks as if it's doing the right thing...
Your app needs the permission to write to the users profile. You can use the Graph API to request the required permissions from the user. If granted, Facebook will give you the required access token that you can then use in your request to Facebook. This practice ensures that you only perform actions, the user allowed you to.
Edit_: After looking at the docs: Are you sure you have the required permissions from the user like described here http://developers.facebook.com/docs/score/ ?
Please see this link. You'll need to get an facebook app. Using the apiId and SecretId, you can then post using the information in the link below. The key is adding &scope=manage_pages,offline_access,publish_stream to the url.
like so:
"https://graph.facebook.com/oauth/access_token?client_id={0}&client_secret={1}&grant_type=client_credentials&scope=manage_pages,offline_access,publish_stream";

Download image via webservice

Hi there
I have an IPhone application that is downloading data from a .net webservice.
The webservice uses the following:-
[System.Web.Script.Services.ScriptService]
public class DownloadHelperService : System.Web.Services.WebService {
public DownloadHelperService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
[System.Web.Script.Services.ScriptMethod(UseHttpGet = false)]
public byte[] Download(string fileName)
{
return Facade.IOHelper.DownloadFileFromServer(fileName);
}
}
This method will in theory download an image file to the client. The issue is that this is being downloaded as Json which is inefficient.
If I take off the scriptmethod attribute and class level script then I cannot make the call from my IPhone application as it says that my method calls require the scriptmethod attributes.
If anyone can advise on the best route to download images from a webservice to an IPhone application using objective-c I would be eternally grateful
Make the webservice return you the image url and then download the image from the url.