fbsamples / fbinstant-samples Goto Github PK
View Code? Open in Web Editor NEWSample projects for the Facebook Instant Games platform
License: Other
Sample projects for the Facebook Instant Games platform
License: Other
I need email in my game for further communication like rewards, notification, etc
but as per document I didn't see any way to get email I tried with javascript sdk using
FB.login(function (response) {
if (response.authResponse) {
FB.api('/me?fields=email', function (userInfo) {
console.log(userInfo.email);
});
} else {
console.log('Auth cancelled.')
}
}, {
scope: 'email'
});
but i always got Blocked opening error ="in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set"
Please let me know How i can get user email id
yarn run-mock
works perfect for me
but i've got "Sorry, this game can't be played right now." error when yarn dist
I checked chrome dev tools console but no error found..
The command not replacing the production js with the mock js script. To fix this, you need to enter the task-name in the html file as below:
<!-- build:js -->
<script src="https://connect.facebook.net/en_US/fbinstant.6.2.js"></script>
<!-- endbuild -->
so it will replace that block properly into this:
<script src="js/mock/fbinstant.6.2.mock.js"></script>
I use FBInstant.payments.purchaseAsync and this error occurs
The version used is https://connect.facebook.net/en_US/fbinstant.6.2.js
The demo used is the code provided in GitHub
How can I resolve startGamesAsync function?
Also, if it is, would you care to upgrade it to 6.3?
thanks!
I have added pod file's to my project
pod 'FBSDKShareKit'
pod 'FacebookSDK'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
I want to use this function of FBInstant
var connectedPlayers = FBInstant.player.getConnectedPlayersAsync()
.then(function(players) {
console.log(players.map(function(player) {
return {
id: player.getID(),
name: player.getName(),
}
}));
});
I tried to import packages but didn't find FBInstant package it gives error
Use of unresolved identifier 'FBInstant' (error)
Its propably not the right place to ask this question but i couldnt find better.
hi, im trying to implement facebook login in my "fb-insant" game, but when i click on the login button i get following error : Blocked opening [huge link here] in a new window because the request was made in a sandboxed frame whose 'allow-popups' permission is not set.
My code responsible for auth:
<div id="fb-root"></div>
<script
async
defer
crossorigin="anonymous"
src="https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v3.3&appId=myID&autoLogAppEvents=1"
></script>
<div
class="fb-login-button"
data-width=""
data-size="large"
data-button-type="continue_with"
data-auto-logout-link="false"
data-use-continue-as="true"
></div>
Thanks in andvance
Those libs should be updated
In the secure-backend
example an XMLHttpRequest
is used to communicate with the backend (https://github.com/fbsamples/fbinstant-samples/blob/master/examples/secure-backend/js/data.js#L11).
I've run few tests but due CORS issues I can't make it work. Has this been deprecated?
After Facebook removed the non-contextual leader board we need to store values in the leader board using context ID but if a player starts fresh context ID is returning null I am not able to call the leader board with the null context ID.
Is there any other way to store user values in the leader board
Thanks in Advance
I was getting this error when running scripts until I downgraded from node-v10.15.3 to node-v8.16.0
PS C:\Users\Yo\Desktop\fbinstant-samples-master> yarn run-mock --project hello-world
yarn run v1.15.2
$ gulp run-mock --project hello-world
gulp run-mock --project hello-world[10808]: c:\ws\src\node_contextify.cc:626: Assertion `args[1]->IsString()' failed.
1: 00007FF7E62FF04A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+5114
2: 00007FF7E62DA0C6 node::MakeCallback+4518
3: 00007FF7E62DA17F node::MakeCallback+4703
4: 00007FF7E62AF630 node::DecodeWrite+13024
5: 00007FF7E6ADC122 v8::internal::OptimizingCompileDispatcher::Unblock+59890
6: 00007FF7E6ADD289 v8::internal::OptimizingCompileDispatcher::Unblock+64345
7: 00007FF7E6ADC5CC v8::internal::OptimizingCompileDispatcher::Unblock+61084
8: 00007FF7E6ADC4EB v8::internal::OptimizingCompileDispatcher::Unblock+60859
9: 000001585CBDC5C1
error Command failed with exit code 134.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I have a problem with run hello-world project
After config project and run
yarn run-mock --project hello-world
, my screen only display
If I run, yarn run-dist --project hello-world
. It open embedded player
browser correctly
I am using Mac Sierra 10.12.6 with node version (v11.10.1
) and Chrome browser.
Any help or suggestion would be great appreciated.
Hi,
I'm not sure what going wrong, the basic sample app keep showing loading screen.
it's neither working on local nor in production.
I've tried adding console.log
at different place and it seems the script is not coming inside FBInstant.initializeAsync().then
I'm not sure why.
i use command yarn upload --project hello-world
to upload the hello-world code zip file.
I'm attaching more details here please help me what's wrong I'm doing.
This is zip of codebase 1ce706e0-f4fc-11ea-80c6-b160fcafe6a2.zip
This is index.html content
https://gist.github.com/LabN36/eaf0b95ef17f7a2216d5869740fea142
FBInstant.setLoadingProgress not show loading process
I created new app in facebook and try to test helloworld sample through my app. I use this command
yarn run-mock --project hello-world
with url https://www.facebook.com/embed/instantgames/GAME_ID/player?game_url=https://localhost:8000
. But the game stuck loading in 0% without showing any error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.