Which official plugins/features work with phonegap and cr...

Discussion and feedback on Construct 2

Post » Wed Oct 08, 2014 8:09 pm

I'll take a look at logins for various SDKs in PhoneGap in the next beta cycle, but if anyone's figured it out already then sharing code samples would be useful.
Scirra Founder
B
399
S
236
G
89
Posts: 24,541
Reputation: 195,426

Post » Wed Oct 08, 2014 8:36 pm

@Ashley, here is a cut and paste of my Phonegap Facebook login. My code is an adjustment based off of the following website. http://blog.geniuspods.com/2013/10/15/h ... -phonegap/ You do need the 'in app browser' installed for Phonegap in order to utilize this and the domain and web addresses in the Facebook developer app settings need to be set to http://localhost. url_S in this example of course is set to "http://localhost/" while the state variable is user defined.

Acts.prototype.Phonegap_Login = function (url_S,state)
{//if(FB_API["Instance"].uid != this.uid){return;}
if (check_app_Type("Phonegap_Login","PhoneGap") == false) {FB_API["Runtime"].trigger(cr.plugins_.Facebook2_1.prototype.cnds.Con_Phonegap_Login_Fail, FB_API["Instance"]);return;}
ios_url = window.open("https://www.facebook.com/dialog/oauth?client_id="+FB_Properties["App ID"]+"&auth_type=rerequest&scope="+FB_API["scope"]+"&state="+state+"&response_type=token&redirect_uri="+url_S, '_blank', 'location=no,toolbar=no');
ios_url.addEventListener('loadstart', function(e)
{ var url = e.url;
var fburl = url.indexOf("facebook.com/login");
var err = url.indexOf("error");
if (err >= 0 && fburl < 0)
{console.log(url);ios_url.close();
//fbRuntime.trigger(cr.plugins_.Facebook3.prototype.cnds.fail_ios_logged, fbInst);
}
var n = url.indexOf("#access_token=");
if (n >= 1){
var tokensplit = url.split("#");
var token_two = tokensplit[1].split("&");
var accessToken1 = token_two[0].split("=");
User["User AccessToken"] = accessToken1[1];
console.log('InAppBrowser: loadstart event has fired with url: ' + User["User AccessToken"]);
Fetch_User("me",User["User AccessToken"],function(FU_Status)
{if (FU_Status == "success") {FB_API["Runtime"].trigger(cr.plugins_.Facebook2_1.prototype.cnds.CON_USER_SUCCESS, FB_API["Instance"]);}
else{FB_API["Runtime"].trigger(cr.plugins_.Facebook2_1.prototype.cnds.CON_USER_FAIL, FB_API["Instance"]);}
});ios_url.close();FB_API["Runtime"].trigger(cr.plugins_.Facebook2_1.prototype.cnds.CON_USER_LOGIN, FB_API["Instance"]);

}});
};
www.h1k3.tech

We are here for you!
B
87
S
23
G
16
Posts: 715
Reputation: 16,835

Post » Wed Oct 15, 2014 9:19 am

@Ashley Was the above useful?
ImageImageImageImageImage
B
19
S
5
G
1
Posts: 614
Reputation: 2,542

Post » Fri Oct 31, 2014 1:55 pm

Hi guys, I have a project I'm doing and I am using phonegap. I would really love to know how to do this. I have a project that needs to be able to tweet and post to facebook using PhoneGap.

I'm ok with using XDK as well if that turns out to be a better option. @lanceal I went to check out your store but it says it's down for maintenance. Is that going to be resolved soon?
B
59
S
9
G
1
Posts: 946
Reputation: 6,561

Post » Fri Oct 31, 2014 8:31 pm

@part12studios,

The problem is the ssl certificate I had recently purchased is vulnerable to the poodle ssl attack. I have been trying to get my hosting provider to fix this but it is taking them forever. You should be able visit the site with old browsers or by http at http:/lockegames.com
www.h1k3.tech

We are here for you!
B
87
S
23
G
16
Posts: 715
Reputation: 16,835

Post » Sat Nov 01, 2014 1:11 am

@lanceal yea https://lockegames.com/?shopp_product=f ... 2-1-plugin seems broken too. i couldn't get any of those pages to work.

i'm happy to pay for any plugins like this that could help me achieve what i need, the only thing i'm trying to get a clear understanding of is which platform (XDK, PhoneGap or EJecta) can do all of these things:

- tweet a score / screenshot to twitter
- post a screenshot / score to facebook
- support IAP
- ads / interstitial ads

I feel like it's that none of these three options can actually do all of these things.. I hope I'm wrong because I'm going to have to let this client know I can't do the job..

I'm working with someone over at XDK/Intel as I'm having trouble getting XDK to accept my mobileprovision/p12/cer files.. but yea i'm doing this for a client. It's not a big budget game, but if you can help me get a solution here for this, I'll buy/donate to any plugin / solution you can come up with because while I love Construct 2, the publishing options / path is really broken..

Phonegap was going to be this new awesome thing. the future of gaming.. etc.. and yet phonegap won't work with twitter or facebook? how is that progress? two steps forward, one step back. from another thread the answer was "the companies should make plugins for phonegap".. meaning twitter and facebook, but is that really going to happen? i imagine not in the near future, when it matters most. The present.

Ok sorry, i'm done venting.. heh :)
B
59
S
9
G
1
Posts: 946
Reputation: 6,561

Post » Sat Nov 01, 2014 1:36 pm

@part12studios,

I received an email from facebook this morning saying that the API has been upgraded once again to a 2.2 so any apps built as of today will not work with any of the plugins out there. Granted it shouldn't take much to fix that. Long story short I'm home today and I'll be fixing the links on my website so it directs to http rather than https. I will also be working on updating my code. So give it a couple of hours and my website should be functional. :)
www.h1k3.tech

We are here for you!
B
87
S
23
G
16
Posts: 715
Reputation: 16,835

Post » Sat Nov 01, 2014 6:57 pm

awesome thanks for the update @lanceal I can't wait to try it out. Regarding facebook and your plugin, is it meant to work with XDK, PhoneGap or Ejecta? Will I be able to post a screenshot with the "canvas snapshop"?

I'm eager to hit the ground running with this plugin. Thanks for jumping on the update/fix. I know how it is with FB standards changing and depreciating past efforts. :P
B
59
S
9
G
1
Posts: 946
Reputation: 6,561

Post » Sat Nov 01, 2014 10:14 pm

It utilizes a Phonegap function called in-app browser to log a user in. I honestly don't know which version it uses. Here is the info on inapp browser, you should be able to get the info you want from there on compatibility. I've never used Phonegap myself, I had someone proficient in Phonegap walk me through the login. Also I don't believe you can upload anything. Just fetch user data and add a like button to your app for the moment. I'm working on a redsign for the 2.2 API, I'll see if I can add more features to it. I'll just need to find a test user to help me out with Phonegap testing when I get to that portion.

http://cordova.apache.org/docs/en/3.0.0 ... er.md.html
www.h1k3.tech

We are here for you!
B
87
S
23
G
16
Posts: 715
Reputation: 16,835

Post » Sun Nov 02, 2014 1:59 pm

Very cool, I'd love to help test it out if you ever have something you want me to try out.
B
59
S
9
G
1
Posts: 946
Reputation: 6,561

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests