How to invite friends in windows 8 facebook app? - c#

I'm porting Unity3D game to windows 8. And it's use a facebook requests to invite friends. I tried to use facebook C# sdk to send invites via facebook graph api:
dynamic id = await client.PostTaskAsync(String.Format("{0}/apprequests", friend.id), parameters);
but it only can send requests to users, which already have the game installed.
Is it possible to send request or message to invite friends to my windows 8 game?
And how did microsoft do it on the facebook for win 8 app?

It looks like you have to open browser window (embedded WebView) and navigate to URI like https://www.facebook.com/dialog/apprequests?
app_id=APP_ID&
message=Facebook%20Dialogs%20are%20so%20easy!&
redirect_uri=http://www.example.com/response

You can only send notifications programatically like this for users who have already installed and authorized your application. Imagine how much spam we would get if any application could send anyone a request! (shudder)
What you are referring to is an invite request. You want to allow your users to invite new users to your application. For this you need to use the request dialog. I haven't got any experience with win8 or with Unity, but the Facebook API is pretty consistent across platforms.
You can use this JS code to prompt your users with the request dialog and allow them to select the friends to invite.
FB.ui({method: 'apprequests',
message: 'My Great Request'
}, requestCallback);
Note that the only real difference is that I'm not specifying any user id's so Facebook simply displays the multi-friend selector dialog.
Reference - Requests Dialog

Did you try with this sdk? it is specific to windows 8 and windows phone.

Related

Is there a way to detect whether a user is typing from teams mobile app or desktop app?

I am developing a bot which can send files to user. Users ask for reports with report name, and bot generates the file and sends it. This is working like expected within Microsoft Teams desktop app and web app. And Microsoft Teams mobile app does not support to receive files.
If there is a way to detect the application that user is typing to bot, i want to inform users when they ask a file from bot with mobile app, like "use desktop or web app, file transfer is not supported on mobile app".
Is there a way to detect the application that Microsft Teams user is using to type to bot?
Yes, you could get the platform from which the message was sent. Could you please check activity.Entity. Please find the screenshots below:
Desktop:
Mobile:

Facebook login via application or webview if app is not installed in Windows phone 8

Basically I want to achieve the same fucntionality which you normally see in android or ios devices. So if I click on login it should open facebook application(not webview) if facebook is installed but in case app is not installed it should open webview.
Currently it shows me a message do you want to search on store which I don't want.
Any help will be highly appreciated.
Thanks
Vinod
Windows Phone SDK only has the API to launch an app from another app which wouldn't work in your case since you would not be able to share session tokens.
Your best approach to achieving this would be to try out the third party Facebook SDK for .NET. Take a look at the Login API which seems to provide the ability to invoke the facebook application on the app and if not available would take the user to the store (LoginBehaviorApplicationOnly - Windows Phone 8.1).
I understand you would like to bring up the WebView if app isn't available but this SDK doesn't seem to have that functionality. You could contribute to the project or request a feature addition.
Hope this gives you a good start?

Invite Facebook friends to mobile app that is not a game

I have a mobile app (on WinPhone 8.1) that uses Facebook credentials for Azure authed login.
What I'm trying to do:
Provide users an organic way to invite facebook friends to use the app. Important to note, users gain no advantage by inviting friends, however it will enhance their experience as you can compare your progress in the app with the progress of friends (it is not a game).
Where I'm stuck:
I can't use the apprequests dialog, as it is not a game. I would like to use the 'send' dialog, but it is not available in mobile browsers. It is not a website, so using the POST publish API has no valid href to link (other than the app's download page, but that is not what the publish API is meant for).
What should I do?
This post explains how to do it.
Otherwise, I would suggest you to market your app like a game, a bit of gamification should not hurt ! ;)

C# Facebook WP7 - display=touch being read as display=wap by facebook

I'm using the Facebook C# SDK 6.0.20 to allow users using my app to log onto facebook. I'm using the display=touch parameter so that the fb login page renders for mobile devices with smaller screens. The problem is, fb keeps reading it as display=wap which is being deprecated. As a consequence, users are receiving an error message when logging on. Is there a solution to this other than forcing users to see the ugly full screen display on a mobile device screen?
Facebook has been unhelpful and unwilling to accept this as a bug but rather says it is a "feature by design", but everyone else seems to think it is a bug. (https://developers.facebook.com/bugs/355102764525510) Why would facebook try to discourage WP7 developers like this when they apparently have a good relationship with Microsoft, which provides them with map services for fb places?
Facebook display=touch for WP7 is now directing properly after recent facebook updates on July 5th. This should no longer be a problem.

Uploading a c# application to a facebook application

I have created a Windows application using C# and would like to know how to upload it to Facebook application.
I have set up the Facebook application, all I need to do is add the application. I can't seem to find out how.
Facebook applications are not true applications in the sense of the word. You do not download or install Facebook apps... they are more like web applications that you log in to with your Facebook account. When you "add" a Facebook application to your Facebook account, all you are really doing is setting some permission flags to give that application access to your Facebook data. Once you've "added" it, each time you load a page from the app, Facebook sends it your Facebook id, which lets the app interact with you and work with your social data. There's no concept of downloading involved.
If your C# app is a desktop application, then you can still integrate it with Facebook, but you're going to need to do a bit more work. You'll need Facebook Connect in order to establish the proper communication. You might want to start with Authorizing and Authentication for Desktop Applications, and do a bit of poking around in that wiki to find out more.

Categories