Trying to implement the Facebook Wish List demo in Android - android

The Wishlist Facebook app example is supposed to demonstrate adding custom objects to the Facebook open graph. I have managed to get the application so that it runs and creates a Facebook object with a graph ID. The problem is I don't see any of the custom object information I enter on the Android end of the app appearing at the Open Graph node associated with the returned ID, nor do I see this information appearing anywhere else on the internet.
The Android end the app seems to encode the information into a URL which is then added to a bundle and put in an HTTP post. For example when I entered the product name "baseball" along with some image the bundled URL was:
https://evening-frost-8481.herokuapp.com/Server/product.php?og%3Atitle=baseball&image=4f038f901dc31.jpg
When I examine the resulting Facebook aggregation it contains a link to the url below (note: there is no explicit reference in my app to the extension /Server/product.php which suggests Facebook may be receiving some of the information sent from my Android app.)
http://eveningfrost8481.herokuapp.com/Server/product.phpcode=AQAcvYSQQhesHLoXFHF9NUK2m__2_ye722T8lTfCs_9EKlgWp-ngUKls-fUet7FXUG6Gv8pbEpDuSATVpdsHUE7FcD6TmU
Is there anyone out there who has successfully implemented this demo who can give me some over view of how the custom data is supposed to get to the internet and finally Facebook?

Related

Firebase Dynamic Links not working - DFL parameter

I have searched SO and the web for a similar issue, and while others appear to have encountered this problem, their solutions are not working for me.
DFL parameter in Firebase Dynamic Links Builder
Starting with Android, I'm attempting to implement the Dynamic Links for my app. The app requires additional parameters on the dynamic link, so I'm manually constructing the link based on the information here: https://firebase.google.com/docs/dynamic-links/create-manually.
I have created my link in the following manner (code abbreviated for purposes of this post)
Uri.Builder builder = new Uri.Builder()
.scheme("https")
.authority(AppPrivate.Invitation.APP_CODE + ".app.goo.gl")
.path("/")
.appendQueryParameter("link", link)
.appendQueryParameter("apn", AppPrivate.PACKAGE)
.appendQueryParameter("dfl", desktopLink);
For my use case the link and desktopLink parameters are the same - they are actual working URLs on my website. Regardless of what device the user hits with the dynamic link, it should perform the desired action. Again, for purposes of simply getting this working, I've linked to our primary website (https://www.mytravelerapp.com).
When I send the invitation from my Android device, I generate an intent based on the code sample here: https://github.com/firebase/quickstart-android/blob/master/invites/app/src/main/java/com/google/firebase/quickstart/invites/MainActivity.java
return new AppInviteInvitation.IntentBuilder(context.getString(R.string.content_trip_invitation_title))
.setMessage(message)
.setDeepLink(uri)
.setCustomImage(Uri.parse(AppPrivate.Invitation.TRIP_INVITE_DEEP_LINK_IMAGE))
.setCallToActionText(context.getString(R.string.content_trip_invitation_cta))
.build();
However, when I receive the invitation via email on my desktop, it always goes to the Play Store listing, no matter what I've added to the initial deep link (DFL, AFL). Here's a sample of the link from the "call to action" button from the email:
https://a3d4u.app.goo.gl/i/225742434763-3bd2c2fa-45f0-4ed8-aca3-37760d27d971
I've not yet implemented the receivers in the android app to listen for incoming links, so I cannot confirm whether or not the deep link behaves appropriately on that platform.
Any recommendations or suggestions on what I'm missing with the desktop link are greatly appreciated.
Thanks!
You're actually wrapping a dynamic link in another dynamic link. Invites itself generates a dynamic link, which doesn't have your DFL parameter, so it is redirecting to the store.
You could try shortening the dynamic link you generate, and sharing via the regular share dialog rather than using Invites.

What is Authorization callback URL? Android

I need to use Imgur to upload images online using android eclipse. i created an account and was trying to register my application to get the client id and client secret. i reached here https://api.imgur.com/oauth2/addclient
I entered my Application Name as : com.nyp.assignment (is this just a name to it or we need to follow our package name? pls advise as well)
when i get to the callback url , i have no idea what to write for it. i've refered to here at https://api.imgur.com/oauth2 but still dont get it.
can someone list an example of a callback URL for Android? (Eclipse)

Twitter android integration. How to show tweet without authentication

I have folowing scenario.
My client (local tv publisher) publishes some article and embeds tweet in it. ID of embeded tweet is sent through api to android application.
On android side i have integrated Fabric/TwitterKit and by following steps on twitter developers page i managed to show tweet in my android app on (i admit) easy way (Show tweet exp).
Now i have published application to Alpha and noticed one "little" problem :-). TwitterKit was using my local twitter account to authenticate and to show tweets. If you dont have Twitter application installed or signed out of it, my show tweet functionality wont work..
This is TwitterLogin explanation for obtaining TwitterKit auth token:
"When attempting to obtain an authentication token, the Kit will use the locally installed Twitter app to offer a single sign-on experience. If the Kit is unable to access the authentication token through the Twitter app, it falls back to using a web view to finish the OAuth process.
The simplest way to authenticate a user is using TwitterLoginButton, inside your layout..."
What i want is to simply show content of tweet by given tweetID. No sending tweets, or any other action with it. Just show data from given url. Is it possible without authentication, or what should i do now, so that current implementation works without user authentication (or with some non-single-signon-inside-app authentication)
Thank you.
UPDATE 1:
I have created MyApp extends Application class, and placed code below inside onCreate method. In application tag inside AndroidManifest file, added line:
AndroidManifest.xml
android:name=".MyApp"
onCreate:
TwitterAuthConfig authConfig =
new TwitterAuthConfig(DeveloperKey.TWITTER_CONSUMER_KEY, DeveloperKey.TWITTER_CONSUMER_SECRET_KEY);
Fabric.with(this, new TwitterCore(authConfig),
new TweetUi());
It works so far, but i am not sure if this implementations is valid.
DeveloperKey.TWITTER_CONSUMER_KEY and DeveloperKey.TWITTER_CONSUMER_SECRET_KEY are static values obtained from application created at apps.twitter.com.
You need to use Application Only authentication.
That will generate a set of keys which can be used by the application. It won't be able to post messages to Twitter (because no user is associated with it) but you will be able to read Tweets.
If you build the keys into the app, your user won't have to sign in.
All the documentation is at https://dev.twitter.com/oauth/application-only

Open Facebook app with specific post from Android app

I created an app that gets the news feed from Facebook and displays it. I want to enable users to comment and like from within my app, but I couldn't find any API for that. I did find a custom URL scheme for Facebook: fb://post/{postId} which I'm trying to use. For each post, I get the post Id and create a link in a textview on Android pointing to that URL. I printed out the URL and this is an example: fb://post/47526370263_10152072729085264
likes is a TextView in my Facebook adapter with the text being the number of likes a post got. I want this view to contain a link to Facebook's app which will open that specific post.
String linkToPost = "fb://post/" + status.getId();
likes.setText(Html.fromHtml("" + status.getLikeCount() + " like"));
When I click on the link in my app nothing gets opened. How do I enable people to view/post comments/likes from within my Facebook News Feed app?
I saw a related answer after I posted this. The solution is to do:
likes.setMovementMethod(LinkMovementMethod.getInstance());

How to get a friends user wall from facebook?

I want to read my friends posts (feeds?, all posts but for a specific user only) from his user wall.
I need all (posts, feeds, statuses) that i see when i look at his page directly from the website.
I use the android sdk and i tried the graph api and rest method.
My app is registered and i have logged in facebook to get the access token (permission: read_stream)
but i dont get that infos that want to.
Please help.
Thx.
How about testing your Graph API call in the Graph API Explorer?
https://developers.facebook.com/tools/explorer/
In my case, I could get my first 10 friends' feed (wall) with the url https://graph.facebook.com/me?fields=friends.limit(10).fields(feed)
Note that I used field expansion of the Graph API.
http://developers.facebook.com/docs/reference/api/field_expansion/
You need them to actually use your app and grant full permissions via the graph API.
You cannot simply 'grab a friends wall'. You must do that via your app and it needs the permissions to do so from the user in question.

Categories

Resources