I'm able to create Interactive post by using sample example, as below.
Intent shareIntent = new PlusShare.Builder()
.setType("text/plain")
.setText("Welcome to the G+ platform.")
.getIntent();
startActivityForResult(shareIntent, 0);
when the activity starts it shows up window where user have to press share button manually.
Is there any way to post directly to Google plus stream by adding default recipients(Public/to circle) without asking user to press Share button.
For content that appears in a user's stream, that user must explicitly share it. Put another way, posting to the user's stream is to do something that the platform does not support. This is done by design because users want to be in control of what appears in their stream. Deceiving the user and posting to their stream or sharing without consent puts you in violation of the Google+ developer policy and your API client can be banned until you are compliant should you even find a way to do this.
More information and several related questions are:
Sharing on Google+ Stream covers passively writing to Google with app activities.
How do I post to Google+ from PHP?
How to post to Google wall
Google+ API for posting
Please post the feature request in the Google+ platform issue tracker and let the Google+ platform team know why you feel you should be able to do this.
Related
I just need to post some text and Image on the Facebook wall of my app's user.
The Facebook app registered in developers.facebook.com doesn't have "publish_actions" permission by default. I already have submitted request for this permission but its taking long to get approved.
Meanwhile seeing my friend doing this post operation thorugh ios app without this "publish_action" permission I am curious do i need this permission to post some text and image on users wall at all? Please help me..
You dont, if you are using open graph:
Reference: The Share dialog lets people publish stories from your app without Facebook Login or the publish_actions permission. However you still have to send your app for review.
The best part is that a user can tag people in a post built upon graph API. As a sample app I would suggest you check how Scrumptious works, it comes prepackaged in the FB SDK.
You can check this link: Android: How to share image with text on facebook via intent?
Use intent sharing for normal text and image post
Publishing
You can publish posts by using the /{user-id}/feed, /{page-id}/feed,
/{event-id}/feed, or /{group-id}/feed edges.
When creating a Post for a Page if you use a user access token the
post will be in the voice of the user that posted it. If you use a
page access token, the post will be in the voice of the page.
Source.
Upload Photos to a User's Profile
This example covers uploading a photo to the current User's profile
using the Graph API and the Facebook SDK for PHP.
It assumes that you've already set your default app id and secret, and
acquired a FacebookSession using an access token or one of the login
helper classes found here. You must have requested the publish_actions
scope when logging in the user for this to work.
For more information, see the documentation for GraphObject,
FacebookRequest, and FacebookRequestException.
Source.
As you can see, you need the publish_actions privilege to post to wall a post with picture and text. You need a review as well.
The location field no longer appears in the share to G+ dialog on Android. This is the code I'm using:
Intent shareIntent = new PlusShare.Builder(this.getActivity())
.setType("text/plain")
.setText("Test")
.getIntent();
startActivityForResult(shareIntent, 0);
Previously, in the share dialog, you could add the location (similar to the "Write" dialog in the G+ app). With a recent update to play services, that location field is no longer there.
Am I missing something?
This is a screenshot of the current share dialog.
And this is a screenshot of the write dialog in the G+ app.
The sharing actually moved from the Google+ app to Google Play Services, and they are slightly different sharing experiences - for example the new contacts first sharing is only in the Google Play services sharebox. If its a feature you're keen on, probably the best bet is to file a request in the Platform issue tracker: https://code.google.com/p/google-plus-platform/issues/list
I want to upload pics to G+ and Pintrest without user intervention in background without using INTENT or any kind of user interaction.
I have found the api's for Facebook and twitter.
For G+ i found those API's to be read only. Are there any such available for G+ and Pintrest?
Any help will be appreciated.
Google+ already supports uploads of photos for auto backup if enabled, for Pinterest you will have to check out their API documentation about uploading photo's. further more you might want to investigate if users truly want to upload there photo's with out user interaction.
BTW facebook also uploads all photo's taken on the device if this option is enabled, same Google+
Check Android Pin It SDK given by Pinterest.
Regarding G+, you won't be able upload anything from Android app because currently API is only READ ONLY. Yes you can integrate Share plugin which would help user to share rich content from app into the Google+ stream, including links, photos and location.
Need to share our application in all social site like Facebook,Twitter,google+ ..Using Share auth api we can share in Facebook and Twitter.
Share Auth API:
http://code.google.com/p/socialauth-android/wiki/GettingStarted
Not able to share in google+ ,is there any plugin available?
Now am using this sample program,not able to share using this.
https://github.com/imellon/Google-Plus-Android-Sample
Please help..
Google plus does not have a publicly available API yet although there are some options available at https://developers.google.com/+/mobile/android/
I would highly recommend not to use a unique SDK for each social network since they contain a lot of bugs, and are not very reliable.
If you just want to share simple text from your app to Facebook,Twitter,Google+ and so on... I would recommend to create a chooser to let the user pick which app from his phone he wants to user for sharing. It is simple, reliable and this is how it's usually done in android.
Sample code :
Intent shareIntent=new Intent(Intent.ACTION_SEND);
shareIntent.setType("text/plain");
shareIntent.putExtra(Intent.EXTRA_TEXT,"your text here");
shareIntent.putExtra(Intent.EXTRA_SUBJECT, "post title");
startActivity(Intent.createChooser(shareIntent, "Share..."));
This will display to the user, all the apps that are capable of sharing a text post. If the user has facebook, twitter and google+ apps in his/her phone, then it will show all of them and the user can choose which ones to share to.
You might be looking for Google plus sdk for android.
Sign in
Sharing
Write moments to your user's Google+ history
+1 content in your app
I'm adding social integration to my app, and am looking for general advice how to go about it.
At the moment the app is showing feed of particular Facebook wall (authentication handled by Facebook's Android SDK) and feed for particular Twitter hashtag. That's a start, but I want these feeds to do a bit more. For Facebook:
For long feed items, user should be able to "see more", including linked pictures
Links inside feed items should work and open in browser
Like/unlike feed items
Comment on feed items
Post on the wall (create another item in feed)
Similarly, for Twitter:
Links inside tweets should work and open in browser
Reply to, and retweet tweets
Create tweets that contain the specific hashtag
Since Facebook and Twitter both have comprehensive APIs and there are enough code samples floating around, this is all technically doable, but seems a lot like reimplementing Facebook and Twitter clients. That's a lot of work to get all the little details right, maintain code for API changes,
and not really in the scope of my app.
So I'm thinking how to avoid reimplementing Facebook and Twitter clients.
Idea one: direct user to mobile versions of the respective sites and be done with it. Downside is that user will have to go through cumbersome authentication, even if there are dedicated client apps already installed and authenticated on user's device.
Idea two: plug into existing apps using intents system: if official Twitter app is installed, use that to do hashtag search. If Seesmic or Twidroid or some other twitter client is installed, use that. As a fallback, open Twitter's mobile website in browser. Similar for Facebook. Downside here is that intents for "show facebook stream" or "search tweets for X" are not standartized. Most current apps don't even have documented ways to plug into them. Using undocumented entry points in those apps is possible but would make my app hacky and brittle.
So, this question, how you've been dealing with integrating bits of Facebook and Twitter functionality in your apps, or seen done by others?
Here is a good tip about how to implement twitter/facebook oauth:
Create new activity and name it OAuthActivity.
Create new class that extends WebView.
Follow the facebook developer guide for WEB applications (not mobile ones!) and implement oauth calls inside of your WebView. For Twitter use Signpost-core with signpost-commonshttp4 to get oauth (facebook uses its own variation of oauth so you need to do it yourself).
Override WebView so it closes itself when facebook redirects your WebView subclass to your callback url.
Use OAuthActivity to return OAuth key / secret to your main activity via RunActivityForResult.
This way screen orientation change will work; you will have same architecture for FB and TW.
I have implemented it this way, yet I can not share my code (it is licensed for my company).
When I added Facebook and Twitter integration into my app (shameless plug: Secret Message), I attempted to invoke an installed Twitter client app via Intent. It wasn't fun, because there is no such thing as a "facebook/text" or "twitter/text" Intent. I know some Twitter apps create their own, but they're not universally used or even known.
So the other option is to get a list of all installed apps and filter on those you want to display in a chooser for the user to select. But retrieving a list of packages and their user-friendly names takes forever. So I hated that option.
I ended up integrating a very simple GUI for both Facebook and Twitter into my own app, and just used OAuth to authenticate users.
I hope this helps you pick your direction.
implementing Twitter integration is pretty easy on Android (you can use Twitter4J which is a pretty nice Twitter Java Library to access the public web services).
To integrate tweeting/retwreeting is basic stuff once you have authenticated your twitter user (just have a text box to allow users to enter thei 140 characters and a button to submit it - creating tweets, retweeting, replying etc is all a matter of 1 or 2 lines of code using twitter4J). The link stuff requires formating your listview to handle weblinks and open as appropriate.
The toughest part of the whole twitter integration thing is getting the OAuth stuff done - there is a tutorial on how to implement twitter and the OAuth authentication stuff here
Unfortunately, I have never tried facebook integration, but hopefully someone will be able to help out with that.