Impact

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

1 decade ago by Aries

Hi,

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
			try{	
				if(AppMobi.multitouch) {
					AppMobi.multitouch.enable();
				}
			}
			catch( e ){}
			
			/**************************************
				appMobi Updates
				Checks for updates on startup
				and also listens for update alerts
				while the app is running
			**************************************/
			updateMobi.init( true );
			
			
			/**************************************
				statMobi 
				Record that the game was loaded
				And what type of OS
			**************************************/
			statMobi.record({
				'appevent':'deviceReady',
				'query':'platform='+AppMobi.device.platform
			});
					
		}
		
		/* This code is used to run as soon as appMobi activates */
		var onDeviceReady = function(){
			// init playmobi object
			playMobi.init();
			
			// 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. http://apphub.appmobi.com

The api docs are here:
http://www.appmobi.com/documentation/gamingAPI/playMobi/index.html

And the playMobi API Cheat Sheet here:
http://www.appmobi.com/documentation/index.php?DOC=CHEAT_PLAYMOBI_API

And the playMobi Developer Manual is here:
http://www.appmobi.com/documentation/index.php?DOC=PLAYMOBI_DEV_MANUAL

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 ken@appmobi.com

1 decade ago by Aries

Hi,

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 »