Posting emoticon from iOS to Facebook via WebAPI - c#

I am facing a problem that I cannot seem to overcome.
Context
I have an iOS application running on iOS7.0 and greater. In this application, you have the possibility to post pictures with comments. These pictures and comments are then sent to a .NET C# MVC WebAPI, which itself sends the content to Facebook using the Facebook SDK.
Problem
When I post comments with emoticons on the iOS app, I am able to successfully store the comments in the database through the Web API and to retrieve them. It shows properly as emoticons on the iOS app. However, once the comment is sent to Facebook, it shows the actual text stored in the database (normal, I guess).
I would like however to have Facebook display the emoticon I am sending from the emoji keyboard on iOS.
Comments with emoticon !! \ud83d\ude04\ud83d\ude0d
Additional Information
On iOS, I take the string containing the comment, I first encode it using UTF8 and I return a new string using NonLossyASCII.
To display it on iOS, I take the string shown above and I do the opposite; I encode it using NonLossyASCII and return a new string using UTF8.
Any hint or help would be highly appreciated.

Related

How to upload video thumbnail to Facebook graph API (.NET)?

I'm POSTing a video using the Facebook graph API video endpoint, everything working fine. But I can't figure out how to provide a custom thumbnail. The API says to provide a thumb parameter:
The video thumbnail raw data to be uploaded and associated with a video.
But what exactly does 'raw data' mean? I've tried encoding it as base 64 (with and without data:image/jpeg;base64, prepended, but always get the error:
OAuthException
(#100) Invalid image format. It should be an image file data.
I get the same using the graph API explorer.
I'm using C# (via ASP.NET Web API).
I see similar questions online about other languages, but no .NET friendly solution.
API version 2.9.
Thanks

C# - Edit OneNote Notebook on SharePoint using REST API

I would like to edit a OneNote NoteBook which is stored in a SharePoint Document Libary via a C# Console Application (because i want to use it to batch input pages into a notebook form a Windows 7 machine).
Url looks like this:
http_s://COMPANY.sharepoint.com/sites/SITE_ID/Documents/_New%20Tool/NOTEBOOK_NAME?d=SOME_ID
So i found this documentation for the OneNote REST API: One Note Api, and i have two questions:
How do i get/request the Bearer Token? SDKs for this seem to be only available for Universal Windows Applications
How do i get the correct API URI? As it states here i need some IDs for the URI, but i do not know which ones to use.
If anyone has any "quick start code" to begin with or a blog post, that would be great. The official examples on GitHub do not seem to be fitting my needs...
If you want to get a Bearer token from a console app, here are your options:
Get a token from somewhere else (e.g. another app that gets tokens) and temporarily copy it to your console app
Display (via a web control/browser) the sign in flow and extract the token from it into the console app. The user has to see the sign in UI at least once - there is no way around this unfortunately. The best example I can find of this is the following: https://github.com/googlesamples/oauth-apps-for-windows/tree/master/OAuthConsoleApp. You'd just have to change the URLs/scopes/AppId.
I'd suggest going with (1) or a different route (windows universal app), but if you do need it to be a console app... you'll need to essentially show a web control/browser with the sign in URL, then parse the code out of it once the user has signed in (or have the user paste it in).
Once you have the bearer token, you can read our blog post on how to use FromUrl to extract/edit content from a site.

Detect Twitter submit Android

I am currently writing an android app.
I intend to run my application in the background of my phone and I want to be able to detect when I submit a post using the Twitter app on the same device.
Is this even possible?
When you create the OAuth customer key in the Twitter Application Management (url https://apps.twitter.com/),
- that is one of the preliminary steps to implement the authentication-
you'll define there the source field (look for instance at the documentation from https://dev.twitter.com/overview/api/tweets) that will be reported in all the tweets posted by the API of your newly created Twitter app.
So when you get your tweets, you'll detect the ones posted by that specific app (on your phone).
More generally I have published an open source Twitter app for Android on github: https://github.com/giuliohome/TweetSearch just look at the API call where I retrieve the source of a Tweet for more details, basically a simple
jsonObject.getString("source")
By the same field you can detect the tweets posted by the official Twitter app for Android on the same device - assuming it is the only Android device from where your username is twitting with the target app, otherwise I'm not aware of any legitimate and standard way to detect the physical device

WP8 Facebook send message app-to-app

My question is simple, but I cannot seem to find the answer with Google. I'm working on a Windows Phone 8 app and I would like to offer the possibility to share content with certain people in private. I will add a feature to send by SMS, but I would also like to offer the possibility to send a private message in Facebook.
There is a Facebook app for Windows Phone 8 and I wanted to know if there is a way with "App-to-app" communication to have the Facebook app send the message for me. This way, the user could edit the message and choose who to send it to, without my app having to manage this for him. I think it would be a better user experience than using the Facebook API since it would be consistent.
I looked online and there is a way to make a post. However, that's not what I want since my app handles a financial matters. Is there a simple way to do that ?
It depends not on your App but the Facebook App - if it supports such a feature.
In Windows Phone you can for example associate files and Uri's with certain Apps - MSDN source. By this it is possible (I think somehow) to pass a file (message) to other App (if that App supports it). Other problem may be where to save that file - maybe some webservice as IsolatedStorage is a bad idea.
It will be hard workaround, but surely depend mostly not on your App.
In this case I think it will be better to use Facebook API in your App.
Use Facebook to do post function like below
await Launcher.LaunchUriAsync(new Uri("fb:post?text=foo"));
Or you need implement an OAuth flow to get Facebook token then do Post by Facebook post API
https://graph.facebook.com//v2.0/me/feed?message=foo&access_token={TOKEN}
I think these are the possible ways to achieve what you want.

integrate facebook comment box to xaml (windows 8 store apps) C#

I am trying to embed Facebook comment box in a windows 8 store app. Is it possible to directly integrate the comment box or are there any other alternative solutions?
What I am trying now >>>> create a web page and add the Facebook comment box to webpage. Then access the webpage that I created through a Webview control. But when I try to login to Facebook using the comment box's link, it will not open the login dialogue inside the webview but it opens the browser where my windows 8 Store app pulled to the background.
I would recommend that you use the Facebook API, as recommended by another SO user answering a similar question
There is a Facebook API for Windows 8
You can find an example on Github here
I haven't tried this API, but did a WPF app using a similar API and it's usually straight forward.
If you would like to, and I know you didn't ask about that - this is just a tip, there is a web authentication broker in the WinRT API's to enable single sign on (SSO) connections to OAuth providers like Facebook etc.
You can find a sample here
Hope this helps, best of luck.

Categories

Resources