Facebook instant game login with JS SDK - facebook-javascript-sdk

I am trying to upload my game made with React to Facebook Instant games. I have facebook login implemented with Facebook JS SDK. But facebook instant game runs inside a sandboxed iframe which blocks any popups and I cannot run FB.login(). In instant games docs it says that FB.login should work and it should open a popup in 'async' mode. But it doesn't. Login popup gets blocked and I get the following error:
Blocked opening ... in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set.

You are looking for the wrong documentation, which leads to Legacy Web games.
You need to refer to the Facebook Instant Game SDK to get the user information inside a FB Instant Game. Most importantly FB Instant games don't allow to use of the Facebook Graph API within the FB Instant Game. Although the Graph API offers more capabilities like getting the user gender, the Facebook Instant Game SDK only exposes a limited number of data for developers. The Facebook Login for the Web with the JavaScript SDK is an OAuth login that cannot be used inside a FB Instant Game.
FYI: Facebook Instant GAme SDK v7.0 doesn't provide all the user information about the user. It only provides the following data
Display Name
var playerName = FBInstant.player.getName()
Profile Picture
var playerImage = new Image();
playerImage.crossOrigin = 'anonymous';
playerImage.src = FBInstant.player.getPhoto();
You can only use the above information in your FB instant games.

Related

Is it possible to show Alert or View when rewarded ad is finished? (above rewarded ad)

I'm trying to add to my react-native app ad.
I'm using #react-native-firebase/admob package.
And my question is: when the user is finished watching a rewarded ad is it possible to show Alert (android) or customized View above this finished rewarding ad?
Technically it is possible, but you should NOT do this because it is violation of AdMob policy.
AdMob will stop serving ads in your app and Google Play could reject your app.
AdMob Policy
Content obscuring Google-served ads
We do not allow content that:
fully or partially obscures Google-served ads.
Publishers should avoid site layouts in which the content fully or partially obscures Google ads. These layouts make it hard for users to distinguish between the content and ads.
Also check out AdMob Policies for ads that offer rewards

Facebook Notification Handler with iPhone application

I have little Confusion regarding my iPhone application. So I hope I got solution from here.
Now My Question is:
Currently I am developing an iPhone application with Facebook user integration. User can send application request to his/her friend as a Facebook notification. If receiver accept that request or click on that request then how should I detect that through my iPhone application? Or is there any way to show that notification in my iPhone application?(Functionality is like get Life by Friends in Candy Crush Game)
Some Points
I have created canvas for application integration with Facebook but there is no any kind of functionality on my application's canvas page. It is totally blank. I just want application on iPhone not on Facebook.
On every click on app invitation notification by receiver I want to give some points to notification sender.
If you have any king of link or document related to this topic then please send me.

How do I post in facebook a big image on a friend's timeline without using sdk feed dialog

I have an app that lets the user create a custom-made greeting card (a big image) and send it to a facebook friend who has their birthday / another occasion on that day.
I want to allow my user to post the generated greeting card image on the other friend's timeline.
Since feb 2013, developers are not allowed to post on other user's wall using /feed (stream.publish), the documentation states it is only allowed using the feed dialog (sdk pop-up).
How do I allow a user to post a big image on a friend's timeline from an iOs app without using the sdk's send dialog?
Due to the Recent Changes of Facebook Graph API you can't do this anyway without using the Feed Dialog .

Connect Facebook Social Plugin with FB iOS SDK

In one of our app, our user already logged in using the iOS FB SDK, and in one page is am displaying the comment box social plugin to render comments, but seems it can't use the existing logged session.
Are there any steps required so user don't need to double login?
Comments box social plugin is not designed for iOS. But we can make it work by restricting the user to sign into FB only using WebView popup. To achieve this, set NO for both authorizeWithFBAppAuth and safariAuth in - (void)authorize:(NSArray *)permissions; method of Facebook.m
- (void)authorize:(NSArray *)permissions {
self.permissions = permissions;
[self authorizeWithFBAppAuth:NO safariAuth:NO];
}
This will store all the facebook credentials in sharedHTTPCookieStorage. Now when you load your comments box social plugin using webview, it will recognize the existing session.

Is there anyway to have hangouts outside google+?

Is there any way by which we can have a hangout session within our webapp, say in an iframe ?
I was about to experiment with hangout api, but going by existing apps on hangout, it seems they can only be viewed and used from within Google+.
Is there a work around where I can make the user feel that hangout is a part of my app rather than my app being part of the hangout ?
There's no way to embed a hangout into your web application, but you can use the hangout button to launch a hangout app. This allows you to integrate features and data from your web application into a hangout.
The hangout button is made up of an image and a hangout launching link. It comes in a few sizes. Here's the code for the smallest size (75x19 px)
<a href="https://plus.google.com/hangouts/_?gid=APP_ID" style="text-decoration:none;">
<img src="https://ssl.gstatic.com/s2/oz/images/stars/hangout/1/gplus-hangout-15x79-normal.png"
alt="Start a Hangout"
style="border:0;width:79px;height:15px;"/>
</a>
In this snippet you must substitute APP_ID with your application's ID from the API console. When you are viewing your project you'll find the application ID at the end of the URL.
Currently, there's no way of embedding a Hangout app in your web application. But, there's an opened issue tracker where you can add your comments about the need of this feature and Google might release it in their future API releases.