Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Sex Invaders completed! For Android 2.2 or higher, w/ Facebook highscores!
Started by ORBZ Jan 06 2011 05:43 AM

16 replies to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ORBZ

[GLOBAL: userInfoPane.html]
ORBZ
  • Enthusiast

  • 38 posts
  • Corona SDK

Hey everyone,

My first game for Android made with Corona. Sex Invaders, available in the Android Marketplace.

Sorry, no iPhone version. Apple won't allow it.

I was able to create a highscore server and facebook integration too. Let me know if this is interesting to anyone else as I may make the service publicly available if people are interested.

uid: 8741 topic_id: 4871 reply_id: 304871


[TOPIC: post.html]
#2

IgnacioIturra

[GLOBAL: userInfoPane.html]
IgnacioIturra
  • Contributor

  • 359 posts
  • Guests

No link? No worries, I'm at work so I couldn't click on it anyway :(
uid: 10835 topic_id: 4871 reply_id: 15657


[TOPIC: post.html]
#3

MBD

[GLOBAL: userInfoPane.html]
MBD
  • Contributor

  • 387 posts
  • Corona SDK

Can you post your facebook posting method using the android side? There are known issues with it using Corona / Android and myself among others would love to know how you are using the facebook posting over an Android device.
uid: 9046 topic_id: 4871 reply_id: 16312


[TOPIC: post.html]
#4

ORBZ

[GLOBAL: userInfoPane.html]
ORBZ
  • Enthusiast

  • 38 posts
  • Corona SDK

I didn't use the facebook.lua module. instead I just created a web popup and directed it to my own server. All the facebook handling is done through the server and OAuth.

uid: 8741 topic_id: 4871 reply_id: 16328


[TOPIC: post.html]
#5

MBD

[GLOBAL: userInfoPane.html]
MBD
  • Contributor

  • 387 posts
  • Corona SDK

You were ahead of me but I'm not far behind! I think this is the best way to use facebook on Android. I've already built my processing page and it was actually easier than using the Corona api for facebook connect (though it is native and would be a bit more seamless)!
Thanks for the tip.
uid: 9046 topic_id: 4871 reply_id: 16331


[TOPIC: post.html]
#6

MBD

[GLOBAL: userInfoPane.html]
MBD
  • Contributor

  • 387 posts
  • Corona SDK

Say, what trick did you use inside the webpopup to get the OAuth to work? I'm able to pass parameters all the way back to the processing webpage on my webserver but the post doesn't ever "popup" like it does in a webbrowser(tested in browser and the post works)..
uid: 9046 topic_id: 4871 reply_id: 16337


[TOPIC: post.html]
#7

ORBZ

[GLOBAL: userInfoPane.html]
ORBZ
  • Enthusiast

  • 38 posts
  • Corona SDK

no tricks, i just connect to my server. the server then redirects to facebook and does the oauth there between the two servers.
uid: 8741 topic_id: 4871 reply_id: 16338


[TOPIC: post.html]
#8

MBD

[GLOBAL: userInfoPane.html]
MBD
  • Contributor

  • 387 posts
  • Corona SDK

I understand. That's exactly what I'm trying to do but still no luck. I just get a white screen on the Android device when posting. Would you care to share your web code that posts to Facebook from your web server?
uid: 9046 topic_id: 4871 reply_id: 16339


[TOPIC: post.html]
#9

ORBZ

[GLOBAL: userInfoPane.html]
ORBZ
  • Enthusiast

  • 38 posts
  • Corona SDK

Hope you like Python ;)

class LoginHandler(BaseHandler):
    def get(self):
        args = dict(client_id=FACEBOOK_APP_ID, 
                    redirect_uri=self.request.path_url, 
                    scope="publish_stream", # extended permissions so that the game can publish to the users stream
                    display="touch")
        
        verification_code = self.request.get("code") # fyi, this code is also the facebook session id
        if not verification_code:
            logging.info("redirecting to facebook for authorization")
            self.redirect("https://graph.facebook.com/oauth/authorize?" + urllib.urlencode(args))
            return
            
        args["client_secret"] = FACEBOOK_APP_SECRET
        args["code"] = verification_code

        page = urllib.urlopen("https://graph.facebook.com/oauth/access_token?" + urllib.urlencode(args)).read()
        result = cgi.parse_qs(page)
        
        if "access_token" not in result:
            self.response.out.write("access token not recieved from facebook")
            logging.error(page)
            if "error_reason" in result:
                self.response.out.write(result["error_reason"])
                logging.error(result["error_reason"])
            return

        logging.info("access_token recieved")
        access_token = result["access_token"][-1]

        profile = json.load(urllib.urlopen("https://graph.facebook.com/me?" + urllib.urlencode(dict(access_token=access_token))))

        set_cookie(self.response, "fb_user", str(profile["id"]), expires=time.time() + 30 * 86400)
        self.redirect("/")

uid: 8741 topic_id: 4871 reply_id: 16356


[TOPIC: post.html]
#10

MBD

[GLOBAL: userInfoPane.html]
MBD
  • Contributor

  • 387 posts
  • Corona SDK

Got it, works perfect!
Thanks for your assistance -
uid: 9046 topic_id: 4871 reply_id: 16396


[TOPIC: post.html]
#11

IgnacioIturra

[GLOBAL: userInfoPane.html]
IgnacioIturra
  • Contributor

  • 359 posts
  • Guests

Still no link? I'm not at work now ;)

I shudder at the prospect of googling Sex Invaders, so I think I'll wait for a link from you to check out the game.
uid: 10835 topic_id: 4871 reply_id: 16696


[TOPIC: post.html]
#12

ORBZ

[GLOBAL: userInfoPane.html]
ORBZ
  • Enthusiast

  • 38 posts
  • Corona SDK

Here's the link

http://www.androidzoom.com/android_applications/adult/sex-invaders_pyug.html
uid: 8741 topic_id: 4871 reply_id: 16783


[TOPIC: post.html]
#13

amigoni

[GLOBAL: userInfoPane.html]
amigoni
  • Contributor

  • 542 posts
  • Corona SDK

Hi ORBZ, I am trying to implement something similar to yours but getting back a JSON file to the app. I was wondering if you had any advice that I could use. I am using this

http://ideveloper.kodingen.com/2010/facebook-friends-leaderboard/

Everything is setup and works I modified the PHP to get the JSON file sent, but I am having a hard time reading it into a table. I am a complete beginner at both PHP and any sort of communication protocol.

Any tip would be appreciated. Thanks
uid: 8192 topic_id: 4871 reply_id: 16792


[TOPIC: post.html]
#14

ciaphuas

[GLOBAL: userInfoPane.html]
ciaphuas
  • Enthusiast

  • 96 posts
  • Corona SDK

Could we get a tutorial on how to implement this on the server and the app side? That would be awesome!
uid: 12716 topic_id: 4871 reply_id: 21208


[TOPIC: post.html]
#15

FireSoft

[GLOBAL: userInfoPane.html]
FireSoft
  • Contributor

  • 125 posts
  • Corona SDK

I tested your game and high score system is very good and i would like to include it to my game. So ORBZ, could you share your code or teach me how to make it? I am quite new in coding, so i dont understand fully how to do that. And could your facebook friends high score system change someway to global facebook users high score system? Please help me. :)
uid: 18445 topic_id: 4871 reply_id: 39139


[TOPIC: post.html]
#16

arung

[GLOBAL: userInfoPane.html]
arung
  • Observer

  • 3 posts
  • Guests

come on make it published, I'll be the one of many people interested in your application.
vimax
uid: 9726 topic_id: 4871 reply_id: 41145


[TOPIC: post.html]
#17

MiClosStudio

[GLOBAL: userInfoPane.html]
MiClosStudio
  • Contributor

  • 118 posts
  • Corona SDK

Looks like a funny game :) but don't have an Android phone :(
Congrats!
uid: 25327 topic_id: 4871 reply_id: 41162



[topic_controls]
[/topic_controls]