This forum is read only and just serves as an archive. If you have any questions, please post them on

1 decade ago by Aries


I'm having problem with playMobi.player.facebookConnect( "init" ); when testing in my device( Android ). I will get a facebook error page.

But when im test on the xdk, its works just fine.

Below if the code fragment

               // init the game
		var init = function() {
			AppMobi.display.useViewport( 320, 480 );
			document.getElementsByTagName('body')[0].style.visibility = "visible";
			AppMobi.device.setRotateOrientation( "portrait" );
			AppMobi.device.managePower( true, false );
			AppMobi.canvas.load( "index.js" );
			AppMobi.device.setAutoRotate( false );
			// turn on multiTouch for Android
				if(AppMobi.multitouch) {
			catch( e ){}
				appMobi Updates
				Checks for updates on startup
				and also listens for update alerts
				while the app is running
			updateMobi.init( true );
				Record that the game was loaded
				And what type of OS
		/* This code is used to run as soon as appMobi activates */
		var onDeviceReady = function(){
			// init playmobi object
			// login player with their facebook account
			playMobi.player.facebookConnect( "init" );
		document.addEventListener( "appMobi.device.ready", onDeviceReady, false );

1 decade ago by Ken

Hey Aries,

I take it you are trying to test the game in appLab, correct? If so, unfortunately you can not login with the Facebook api when testing in appLab. There are some credentials that can not be set while running in appLab. The only way to test is in the XDK or doing a "build test" in appHub installing the bundle on your device. After that you can update and test as needed.

Also I noticed that in your facebookConnect call, you are passing a string. This is incorrect. You actually need to pass an object like so:
playMobi.player.facebookConnect( { 'callback':'init' } );

I hope that helps.

1 decade ago by SlouchCouch

so wait is playmobi out of beta now yet?

1 decade ago by Ken

Yep. The playMobi is accessible via appHub.

The api docs are here:

And the playMobi API Cheat Sheet here:

And the playMobi Developer Manual is here:

Let me know if you have any question regarding the api or how to integrate with it.

1 decade ago by Aries

Hi Ken, Thanks for the help.

The facebook login works well after i build and test on the Android device.

But nw I got a problem with a white blank screen after I login via Facebook.

Anything that I done wrong?

1 decade ago by Ken

Well its hard to say without seeing the bundle but some initial thoughts:

1. Did you change the parameter from a string to object like I mentioned earlier?

2. I would call facebookConnect AFTER all of the setup in the init function.

If neither of those work, just upload the latest bundle and send me the appMobi app name and I'll have a look at the code to see if I can spot anything obvious. Just send the info to

1 decade ago by Aries


Finally i got it solve by calling the facebookConnect after the init function.

Thank you very much.
Page 1 of 1
« first « previous next › last »