Here is a Facebook Android Plugin.
https://github.com/ar2rsawseen/GiderosFacebookAndroidPluginIt will probably be included in next versions of Gideros, but for those of you who can't wait and want to try it out now (maybe even find any bugs
) here it is.
I've attached two files, one (FacebookPlugin.zip) for Android exported project other (FacebookGideros.zip) a Gideros sample project.
Installation instructions:
- Download Facebook SDK here: http://developers.facebook.com/android/
- Facebook SDK installation instructions here: http://developers.facebook.com/android/
- Download and unzip
- Import SDK into eclipse (Note you need to import it in workspace and check copy all files)
- Export Gideros project to Android project
- Import Android project to eclipse (Note you need to import it in workspace and check copy all files or Facebook SDK won't work)
- Link Facebook SDK to your project:
- Right click on your project
- Select properties
- Choose Android
- In library section click Add and choose FacebookSDK
- If it's not there or not linking properly, it means that you haven't imported FacebookSDK into eclipse or it's not in your workspace or your project is not in your workspace
- Copy contents of FacebookPlugin.zip into your project:
- Copy .so files to each separate armeabi folder
- Copy facebook folder to src/giderosmobile/android/plugins folder
- Inside your main activity:
- Add lib as System.loadLibrary("facebook");
- Add external class as "com.giderosmobile.android.plugins.facebook.GFacebook"
- Add this line inside onActivityResult method: GFacebook.fb.authorizeCallback(requestCode, resultCode, data); (This step will not be needed, when plugin will be included in Gideros SDK)
- Clean and launch the app, if it does not work, come and complain here, because I may have also screwed something up
EDITAttaching Facebook SDK I used while developing plugin
Comments
https://play.google.com/store/apps/developer?id=My+name+is+Originality
Ultimate Games on Appstore
Ultimate Games on Google Play
https://github.com/ar2rsawseen/GiderosFacebookAndroidPlugin
Like an app which posts to someone's page, or use their profile as a means of identification for a score table? Stuff like that?
http://developers.facebook.com/docs/reference/api/
Additionally it uses Facebook app for authentication or provides Web Dialogs.
And there are also other web dialogs as one that allows user to post something to his wall, etc.
I think I have found one bug:
local score = 10
local paramaters = {
score = score,
fields = "firstname"
}
facebook:graphRequest("me/scores", paramaters,"POST")
This code closes player.
iPhone? https://itunes.apple.com/us/app/save-my-toys/id593292899?l=en&ls=1&mt=8
Andoid? https://play.google.com/store/apps/details?id=cat.acb.savemytoys
https://github.com/ar2rsawseen/GiderosFacebookAndroidPlugin
Another one:
facebook:authorize({"publish_actions"})
In the Java part you have a null in the String [] --> {"publish_actions", null}
iPhone? https://itunes.apple.com/us/app/save-my-toys/id593292899?l=en&ls=1&mt=8
Andoid? https://play.google.com/store/apps/details?id=cat.acb.savemytoys
Fixed and pushed
Export Gideros project as Android project, install plugin into exported project, delete assets folder, which is inside assets folder in exported project, and you have yourself Gideros player for Android with FB plugin.
I assume there are same steps for IOS player
"GFacebook cannot be resolved FacebookActivity.java"
and
"Jar mismatch! Fix your dependencies"
Something goes wrong for me.
And any way to use it on PC?
So only if you can launch android apk on PC, like using BlueStacks or something, but that is usually not so handy.
And about your problem, it looks like something similar to this:
http://stackoverflow.com/questions/14515626/jar-mismatch-fix-your-dependencies-for-the-facebooksdk
usually a problem in Android support library.
I did everything as described, but when I run the app it closes test alone ... what can be the problem?
Result emulator logcat:
05-03 19:07:57.186: W/dalvikvm(1837): JNI WARNING: JNI method called with exception pending
05-03 19:07:57.186: W/dalvikvm(1837): in Lcom/giderosmobile/android/player/GiderosApplication;.nativeDrawFrame:()V (GetStaticMethodID)
05-03 19:07:57.186: W/dalvikvm(1837): Pending exception is:
05-03 19:07:57.186: I/dalvikvm(1837): java.lang.NullPointerException:
05-03 19:07:57.186: I/dalvikvm(1837): at com.giderosmobile.android.plugins.facebook.GFacebook.getFBToken(GFacebook.java:148)
05-03 19:07:57.186: I/dalvikvm(1837): at com.giderosmobile.android.plugins.facebook.GFacebook.setAppId(GFacebook.java:57)
05-03 19:07:57.186: I/dalvikvm(1837): at com.giderosmobile.android.player.GiderosApplication.nativeDrawFrame(Native Method)
05-03 19:07:57.186: I/dalvikvm(1837): at com.giderosmobile.android.player.GiderosApplication.onDrawFrame(GiderosApplication.java:460)
05-03 19:07:57.186: I/dalvikvm(1837): at com.giderosmobile.android.GiderosRenderer.onDrawFrame(FacebookTestActivity.java:220)
05-03 19:07:57.186: I/dalvikvm(1837): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
05-03 19:07:57.186: I/dalvikvm(1837): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
05-03 19:07:57.186: I/dalvikvm(1837): "GLThread 99" prio=5 tid=11 NATIVE
05-03 19:07:57.186: I/dalvikvm(1837): | group="main" sCount=0 dsCount=0 obj=0x40cefd78 self=0x2a1aa890
05-03 19:07:57.186: I/dalvikvm(1837): | sysTid=1851 nice=0 sched=0/0 cgrp=apps handle=705983240
05-03 19:07:57.194: I/dalvikvm(1837): | state=R schedstat=( 1554928830 3867307252 625 ) utm=136 stm=19 core=0
05-03 19:07:57.214: I/dalvikvm(1837): #00 pc 000012a0 /system/lib/libcorkscrew.so (unwind_backtrace_thread+27)
05-03 19:07:57.214: I/dalvikvm(1837): #01 pc 0005faa8 /system/lib/libdvm.so (dvmDumpNativeStack(DebugOutputTarget const*, int)+35)
05-03 19:07:57.214: I/dalvikvm(1837): #02 pc 00053914 /system/lib/libdvm.so (dvmDumpThreadEx(DebugOutputTarget const*, Thread*, bool)+303)
05-03 19:07:57.214: I/dalvikvm(1837): #03 pc 000539ae /system/lib/libdvm.so (dvmDumpThread(Thread*, bool)+25)
05-03 19:07:57.214: I/dalvikvm(1837): #04 pc 00038aba /system/lib/libdvm.so
05-03 19:07:57.214: I/dalvikvm(1837): #05 pc 0003df2e /system/lib/libdvm.so
05-03 19:07:57.214: I/dalvikvm(1837): #06 pc 000095e4 /data/app-lib/com.flipfloplab.facebooktest-2/libfacebook.so (gfacebook_authorize+284)
05-03 19:07:57.214: I/dalvikvm(1837): #07 pc 0000801c /data/app-lib/com.flipfloplab.facebooktest-2/libfacebook.so
05-03 19:07:57.214: I/dalvikvm(1837): #08 pc 0011776c /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #09 pc 00116aac /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #10 pc 001171ba /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #11 pc 00118376 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so (lua_call+13)
05-03 19:07:57.224: I/dalvikvm(1837): #12 pc 00144b3a /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #13 pc 0011776c /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #14 pc 00117190 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #15 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #16 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #17 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #18 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #19 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #20 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #21 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #22 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #23 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #24 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #25 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #26 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #27 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #28 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #29 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.224: I/dalvikvm(1837): #30 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.234: I/dalvikvm(1837): #31 pc 00112ea8 /data/app-lib/com.flipfloplab.facebooktest-2/libgideros.so
05-03 19:07:57.234: I/dalvikvm(1837): at com.giderosmobile.android.player.GiderosApplication.nativeDrawFrame(Native Method)
05-03 19:07:57.234: I/dalvikvm(1837): at com.giderosmobile.android.player.GiderosApplication.onDrawFrame(GiderosApplication.java:460)
05-03 19:07:57.234: I/dalvikvm(1837): at com.giderosmobile.android.GiderosRenderer.onDrawFrame(FacebookTestActivity.java:220)
05-03 19:07:57.234: I/dalvikvm(1837): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1516)
05-03 19:07:57.234: I/dalvikvm(1837): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
05-03 19:07:57.234: E/dalvikvm(1837): VM aborting
05-03 19:07:57.234: A/libc(1837): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 1851 (Thread-99)
thanks
Emanuel
What device are you trying it on? Model, OS version, etc
If you comment out the line 57:
and replace it with this line:
Just so I could check that everything is set up normally?
I've tried your project, but it does not have facebook plugin installed at all.
You need to copy .so files, copy .java files and modify main activity like it's told here:
https://github.com/ar2rsawseen/GiderosFacebookAndroidPlugin