New Android Export Experiences

Discussion and feedback on Construct 2

Post » Tue Jan 14, 2014 4:50 pm

@Ashley

Yes the same thing happens inside Chrome. It is technically not a bug, it is doing the right job, inside the Facebook Developer Console, I have Web as my Platform, and I have a redirect URL to my index.html page for my app. So whenever Facebook login comes up, put my credentials in, and login it redirects me to the index.html page on my web server.

I know this is pointing to my index.html page instead of the Crosswalk export is because I tried to use the action-

On Mobile Back button pressed -> set Text to "It works!!"

When I would export and get my .apk file, I would try it, login through Facebook, and come to the layout where I can press the back button, the text does not change. This is why I know it would go to my index.html page, because the Chrome browser does not support back button.

Now after I have seen it not work that away, I tried a new project inside C2 this time, no Facebook login, and use the same back button action as above, and it worked. The text did change correctly, because I was still running on the export, and not a web page.

So basically taking the Crosswalk app, and ignoring it. I think this is because there is no Native support for Facebook integration with any mobile devices that run C2 apps. CocoonJS, Crosswalk to be the two major ones without native support.

In the developers console on Facebook, you can distinguish the platform, and if you choose Android, you have to give a few things for the Android Facebook login to work natively, these are in this screenshot:



However, even if you added these credentials to the Facebook developers console, there is no way for C2 to use native Facebook integration.

That would be a great addition in my opinion, you open the doors to many new potential projects.GameThirsty2014-01-14 16:50:48
B
17
S
6
Posts: 348
Reputation: 2,608

Post » Tue Jan 14, 2014 4:57 pm

@GameThirsty - if the same thing happens in Chrome it's most likely working correctly and is not a Crosswalk bug. Since this thread is about Crosswalk you probably shouldn't discuss it further here, maybe start a new thread about that.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,454

Post » Tue Jan 14, 2014 4:59 pm

@Ashley, wouldn't this be part of Crosswalk to add Native support for Facebook on their ends?

Edit: and on the C2 end.
GameThirsty2014-01-14 17:02:23
B
17
S
6
Posts: 348
Reputation: 2,608

Post » Tue Jan 14, 2014 5:36 pm

@GameThirsty - I don't know what you mean by "native" support for Facebook. Crosswalk is basically the same as Chrome for Android, so there's nothing for them to change, the Facebook plugin should work just the same in Crosswalk as it does in Chrome, which you have reported it does.
Scirra Founder
B
387
S
230
G
88
Posts: 24,251
Reputation: 192,454

Post » Tue Jan 14, 2014 5:52 pm

@Ashley

How can I prevent the app from being redirected to the index.html page on my web server then? I have to give the Facebook plugin a redirect url and also inside the Facebook dev console.

I don't want to redirect anywhere after login, I want to stay on the app, not the external web page it redirects to.

The back button wont work after I had logged in, due to this problem.

You can't just redirect back to the app, how would you do that? You have to give a valid http or https address. It redirects to the index file on my web server because thats where I pointed it, as its a valid http address, it redirects with an authentication code so I can use some of Facebooks Graph API's such as getting friends photos, which requires an authentication token.GameThirsty2014-01-14 18:04:34
B
17
S
6
Posts: 348
Reputation: 2,608

Post » Tue Jan 14, 2014 9:43 pm

Also, the Facebook plugin you have implemented for C2, does not work for Crosswalk. @Ashley @IntelRobert

The default one, I tested that.GameThirsty2014-01-14 21:43:40
B
17
S
6
Posts: 348
Reputation: 2,608

Post » Tue Jan 14, 2014 10:46 pm

If anyone has the issue of the XDK hanging like I did, open command prompt and type java -version
if you get the error saying the command is not recognized, make sure java is installed. If it is not, then make sure your path and classpath are set in your environment variables.
That fixed it for me, XDK opens no problem now


My apps seem to run pretty good!

I am having issues with geolocation, although i see GPS light up on my android, the app comes back with a fail.

I also wonder, anyone know a good way to implement cross origin talk? So if I want to get data from my server, any good ways except using ajax and opening up cross origin?humanescape2014-01-15 01:27:32
B
41
S
17
G
8
Posts: 484
Reputation: 8,261

Post » Wed Jan 15, 2014 3:49 pm

If you are seeing messages about java, then you are using the old version of XDK. Please try the new one which replaced java with node-webkit:

http://xdk-software.intel.com/



[QUOTE=humanescape] If anyone has the issue of the XDK hanging like I did, open command prompt and type java -version
if you get the error saying the command is not recognized, make sure java is installed. If it is not, then make sure your path and classpath are set in your environment variables.
That fixed it for me, XDK opens no problem now


My apps seem to run pretty good!

I am having issues with geolocation, although i see GPS light up on my android, the app comes back with a fail.

I also wonder, anyone know a good way to implement cross origin talk? So if I want to get data from my server, any good ways except using ajax and opening up cross origin?[/QUOTE]
Intel Corporation
B
15
S
3
Posts: 193
Reputation: 1,552

Post » Wed Jan 15, 2014 4:01 pm

@GameThirsty

Cordova/phonegap provides inappbrowser for oauth and crosswalk includes cordova. You catch the redirect and then kill the window. I haven't done it myself so I am not sure about the details. Here is a description: http://phonegap-tips.com/articles/google-api-oauth-with-phonegaps-inappbrowser.html

[QUOTE=GameThirsty] @Ashley

How can I prevent the app from being redirected to the index.html page on my web server then? I have to give the Facebook plugin a redirect url and also inside the Facebook dev console.

I don't want to redirect anywhere after login, I want to stay on the app, not the external web page it redirects to.

The back button wont work after I had logged in, due to this problem.

You can't just redirect back to the app, how would you do that? You have to give a valid http or https address. It redirects to the index file on my web server because thats where I pointed it, as its a valid http address, it redirects with an authentication code so I can use some of Facebooks Graph API's such as getting friends photos, which requires an authentication token.[/QUOTE]
Intel Corporation
B
15
S
3
Posts: 193
Reputation: 1,552

Post » Wed Jan 15, 2014 5:34 pm

This is incorrect.
I AM using the new XDK. It even says "New XDK" for the program name.

I also used it for crosswalk build, does the old XDK do that :S (I could not find information on it)

I see the new XDK does state it removes dependence on java and chrome. But for some reason, java still effective the new XDK on my machine.

[QUOTE=IntelRobert] If you are seeing messages about java, then you are using the old version of XDK. Please try the new one which replaced java with node-webkit:

http://xdk-software.intel.com/

B
41
S
17
G
8
Posts: 484
Reputation: 8,261

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: tarek2, wmnjunior and 7 guests