Pages

Tuesday, May 3, 2011

Achievement Log 03-05-2011

1. Decided on developing a game and finishing it in a month's time - One of the hardest decision I've made, was to make a game within a month... or simply: make a complete game. Well, anyway I joined the 1 Month Game initiative, created a post for my upcoming game which I called "SuperRed", a stealth,
adventure game similar to Hitman and MGS, just not as violent as theirs. It'll be designed and developed by me using Unity3D, with tracks compose by, if possible my old composer for my previous mini-games. Well, good luck to me then~ 

2. Failing on my Facebook integration in Unity Android attempt - I never had any experience with Android development (except a printing "Hello World" project I did a while back), don't even have to mention Facebook integration, so I plan to use the WWW and WWWForm thingy (as described in my previous log) to do it. After about 4 days of working on it, without using the AndroidUI or AndroidJNI or Java, I failed to do it. But failure is not always bad, like Thomas Edison once said: "I have not failed. I've just found 10,000 ways that won't work", I found a wrong way to work on this integration attempt. 

And here's what I did that failed (I'm not gonna go into detail about the codes and stuff, just a summary of what I did):
1. I first started by sending an authentication message with infos about the Facebook apps address and its apps ID using the WWWForm, then load the result using WWW.

e.g.: https://www.facebook.com/dialog/oauth?client_id=YOUR_APP_ID&redirect_uri=YOUR_CANVAS_PAGE

2. As soon as the WWW was loaded, it returns me a bunch of HTML stuff in its WWW.text. 

3. What I did next was to extract the website's address which was stored inside the HTML source, and then load it up again to get Facebook login page's HTML source. 

4. Then use the Facebook login pages's HTML source and extract its address again while adding some extra component, like placing in the email address and password inside the required field and then login into the Facebook, and thus being able to access the apps.

5. Which was where everything went wrong, I could pass the email address into the Facebook login page's "email" field (by adding: &email=my_mail@gmail.com), but I couldn't pass in the one for "password" (by adding: &pass=my_password),... and I just stop from there, not knowing what I should do next... 

But seriously if you think about it, the failed method which I was using was kinda wrong in every way. It was the only solution I could come out with at that time, due to the fact that I'm not an Android developer or a Java (not JavaScript!) programmer...

Anyway if you are having a hard time understanding what I meant, try to imagine that you're trying get someone on the Facebook to access your apps, but they need to allow the apps to have access into your profile and posts on your news feed (that you've beat someone's highscore, earned a new item, harvested a special plant etc), that's when the Facebook authentication came in. 

However since we're doing it on Android (using Unity), it's very obvious that your friend has not login into Facebook yet, and you're trying to pass in his email and password (typed on a GUI.textfield) as soon as he hits a submit button (which you generated using OnGUI and GUI.Button)... Well, passing in the password part was the part that I fail at... not sure why... 

Maybe I should just go and learn Java and Android development after all...

No comments: