Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect with Android devices #101

Closed
cordechasse opened this issue Oct 28, 2013 · 32 comments
Closed

Can't connect with Android devices #101

cordechasse opened this issue Oct 28, 2013 · 32 comments

Comments

@cordechasse
Copy link

Hi,

I'm trying to connect on a few Android devices and I'm not able to connect to facebook.
When turning on the log, I get:

[Facebook] INFO - InitFunction, session={Session state:CREATED, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[]}, appId:570287986354141}

My as3 code:
_facebookConnect = Facebook.getInstance();
_facebookConnect.logEnabled = true;
_facebookConnect.init(ConfigManager.getConstant("facebook-id"));
_facebookConnect.openSessionWithReadPermissions(["read_stream", "email"], _onSessionOpened);

private function _onSessionOpened(success:Boolean, userCancelled:Boolean, error:String = null) : void {
trace(this, "_onSessionOpened", success, userCancelled, error);
}

I've created the facebook app following the guidelines found on :
http://afterisk.wordpress.com/2013/02/26/first-free-facebook-single-sign-on-sso-adobe-air-native-extension-for-android/

image

I've set the manifestAdditions in the application-descriptor.xml as described in the documentation.

Is there something I forgot?

BTW: the ANE works perfectly on iOS.

@kobydo
Copy link

kobydo commented Oct 28, 2013

You did everything right.
The problem is in the ANE and no one fixes it for some reason.

@EdPS
Copy link

EdPS commented Oct 28, 2013

I found there is a problem when when passing permissions in the request. Try instead:

_facebookConnect.openSessionWithReadPermissions([], _onSessionOpened);

See if you get a different behavior.

@cordechasse
Copy link
Author

Hi EdPS,

Unfortunately, I've got quite the same result:

[trace] [Facebook] INFO - InitFunction, appID=570287986354141
[trace] [Facebook] INFO - InitFunction, session={Session state:CREATED, token:{AccessToken token:ACCESS_TOKEN_REMOVED permissions:[]}, appId:570287986354141}
[trace] [Facebook] INFO - IsSessionOpenedFunction
[trace] [Facebook] INFO - IsSessionOpenedFunction, AirFacebookExtensionContext=com.freshplanet.ane.AirFacebook.AirFacebookExtensionContext@40627c90
[trace] [Facebook] INFO - IsSessionOpenedFunction: session.isOpened false

@EdPS
Copy link

EdPS commented Oct 28, 2013

Try clearing the session before opening a new one, between Init and OpenSession

_facebookConnect.closeSessionAndClearTokenInformation();

@cordechasse
Copy link
Author

Yep, I've seen in a previous post, someone who was talking about that.
I tried it, and got the same result.

Do you think it may come from the key hashes?

@EdPS
Copy link

EdPS commented Oct 28, 2013

Well you could unzip your .apk and make sure the hash you computed belong to the certificate used to package the app. Which tutorial you followed to compute the hash? Are you developing in Flash Builder?

@kobydo
Copy link

kobydo commented Oct 28, 2013

It has nothing to do with the hash keys. The ANE is buggy and connecting
via Android doesn't work.

Regards,
Koby Douek

‫ב-28 באוק 2013, בשעה 17:13, ‏EdPS notifications@github.com כתב/ה:‬

Well you could unzip your .apk and make sure the hash you computed belong
to the certificate used to package the app. Which tutorial you followed to
compute the hash? Are you developing in Flash Builder?


Reply to this email directly or view it on
GitHubhttps://github.com//issues/101#issuecomment-27220139
.

@EdPS
Copy link

EdPS commented Oct 28, 2013

Well I could connect on Android (sort of, because I could not request specific permissions) but definitely this ANE as some issues. Has somebody tried GoViral Social ANE? Is it worth the $90?

@kobydo
Copy link

kobydo commented Oct 28, 2013

If you plan earning more than 900$ ...

As long as iOS is working and android is working with some workarounds I
see no point in spending this amount.

Regards,
Koby Douek

‫ב-28 באוק 2013, בשעה 17:23, ‏EdPS notifications@github.com כתב/ה:‬

Well I could connect on Android (sort of, because I could not request
specific permissions) but definitely this ANE as some issues. Has somebody
tried GoViral Social ANE? Is it worth the $90?


Reply to this email directly or view it on
GitHubhttps://github.com//issues/101#issuecomment-27221262
.

@cordechasse
Copy link
Author

Where can I find the hash in the unzipped apk?
When I search for it in the directory, I can't find it (using Sublime Text).
It seems that there is some SHA1-Digest in the files META-INF/CERT.SF and META-INF/MANIFEST.MF. Which one should I use? And within those files, there's plenty of SHA1-Digest : which one should I select?

To generate the hash, I followed this tutorial : http://afterisk.wordpress.com/2013/02/26/first-free-facebook-single-sign-on-sso-adobe-air-native-extension-for-android/

I'm developping on IntellijIDEA.
The .p12 was generated with FlashBuilder.

@kobydo
Copy link

kobydo commented Oct 28, 2013

Don't waste your time with the hash.
The ANE is not working dude.

Regards,
Koby Douek

‫ב-28 באוק 2013, בשעה 17:28, ‏Nicolas Bush notifications@github.com
כתב/ה:‬

Where can I find the hash in the unzipped apk?
When I search for it in the directory, I can't find it (using Sublime Text).
It seems that there is some SHA1-Digest in the files META-INF/CERT.SF and
META-INF/MANIFEST.MF. Which one should I use? And within those files,
there's plenty of SHA1-Digest : which one should I select?

To generate the hash, I followed this tutorial :
http://afterisk.wordpress.com/2013/02/26/first-free-facebook-single-sign-on-sso-adobe-air-native-extension-for-android/

I'm developping on IntellijIDEA.
The .p12 was generated with FlashBuilder.


Reply to this email directly or view it on
GitHubhttps://github.com//issues/101#issuecomment-27221704
.

@EdPS
Copy link

EdPS commented Oct 28, 2013

copy META-INF/CERT.SF out of the apk and run

keytool -v -list -keystore {path}/CERT.SF -storetype pkcs12

copy the Sha1 displayed and convert it to Base64 using this website:
http://tomeko.net/online_tools/hex_to_base64.php

If you get the same hash you are using then is not the hash

@cordechasse
Copy link
Author

Arg, I've got an error :
java.io.IOException: toDerInputStream rejects tag type 83

@EdPS
Copy link

EdPS commented Oct 28, 2013

Sorry, there was probably another step involved. I remember I found a tutorial once about this because flash builder uses a default debug certificate when building apps, you can look for it, and I think it was the .RSA file where you got the hash from. If intelliJ uses the .p12 you generated then this not must be the issue.

@cordechasse
Copy link
Author

Yep, with Intellij Idea, when testing in debug mode I can choose to use a local p12 or an auto-generated one.
So, as Kobydo said, it's certainly the ANE which isn't working.

Maybe, we can ask someone at freshplanet to give a quick look?

@ataugeron
Copy link
Contributor

I'll be working on this ANE this week ;-)

On Tue, Oct 29, 2013 at 7:19 AM, Nicolas Bush notifications@github.comwrote:

Yep, with Intellij Idea, when testing in debug mode I can choose to use a
local p12 or an auto-generated one.
So, as Kobydo said, it's certainly the ANE which isn't working.

Maybe, we can ask someone at freshplanet to give a quick look?


Reply to this email directly or view it on GitHubhttps://github.com//issues/101#issuecomment-27294826
.

@anhtran1989
Copy link

thanks @ataugeron :D i wait new version ANE

@messi89
Copy link

messi89 commented Nov 6, 2013

@ataugeron any news about a new version ?

@ataugeron
Copy link
Contributor

I pushed a number of fixes last week in the branch feature/review-android.
There were indeed a number of bugs that I fixed, and I updated to the
latest version of the Facebook SDK at the same time. I will merge these
changes in master in the near future, and provide a sample app for
everybody to be able to test the ANE easily and understand how to use it.
In the meantime, feel free to test this feature branch.

Here are the configurations I tested:

  • Galaxy S2 w/ Android 2.3
  • Galaxy S3 w/ Android 4.1
  • Without Facebook app (web view)
  • With Facebook app

Here are the features I tested:

  • login with read permissions ["user_birthday"] when permissions not
    already granted
  • login with read permissions ["user_birthday"] when permissions already
    granted
  • reauthorize with publish permissions ["publish_actions"] when permissions
    not already granted
  • reauthorize with publish permissions ["publish_actions"] when permissions
    already granted
  • logout
  • login after logout
  • all the above after sending app to background and brining it back to
    foreground
  • login, kill the app, start the app, the user should still be logged in

On Wed, Nov 6, 2013 at 9:43 AM, Messi89 notifications@github.com wrote:

@ataugeron https://github.com/ataugeron any news about a new version ?


Reply to this email directly or view it on GitHubhttps://github.com//issues/101#issuecomment-27878433
.

@loonychewy
Copy link

Many thanks @ataugeron ! It works for me now too (tested on Galaxy Note 3 Android 4.3 & Facebook app: login/out with app kill, sending apprequests)

@kobydo
Copy link

kobydo commented Nov 7, 2013

Fix working, verified on both iOS and Android devices.
Thanks !

@kobydo
Copy link

kobydo commented Nov 7, 2013

I'm getting a new error on Android: "The proxied app cannot request publish permissions without having being installed previously"
Can anyone help with this ?

@ataugeron
Copy link
Contributor

Do you have specific steps/config to reproduce this error?

On Thu, Nov 7, 2013 at 4:45 AM, kobydo notifications@github.com wrote:

I'm getting a new error on Android: "The proxied app cannot request
publish permissions without having being installed previously"
Can anyone help with this ?


Reply to this email directly or view it on GitHubhttps://github.com//issues/101#issuecomment-27949344
.

@messi89
Copy link

messi89 commented Nov 7, 2013

tested on android (samsung tab 2) read_stream work +1

@messi89
Copy link

messi89 commented Nov 7, 2013

I share with you my example #103

@NB13
Copy link

NB13 commented Nov 10, 2013

I have tested example of messi89 with ane on feature/review-android branch and have same issue.
Asus Transformer Android 4.0.3 Facebook installed
Turn on logging but got only
[Facebook] Initializing with application ID 259182507563533
openSessionWithReadPermissions - do nothing, no window, callback, error or log. Tested with permissions of example and empty permissions.
What additional information I can provide?
I read some other issues and don't understand: is app_id must start from 'fb' symbols or have only digits? (tested both variants)

@messi89
Copy link

messi89 commented Nov 11, 2013

Hello

do you have add the hash in your facebook app ?

@NB13
Copy link

NB13 commented Nov 11, 2013

Hello, @messi89. Yes, I added hash as described @cordechasse ( http://afterisk.wordpress.com/2013/02/26/first-free-facebook-single-sign-on-sso-adobe-air-native-extension-for-android/ ).
Today, I tried to add some logs to extension, but latest version I could compile contains some strange bugs.
Has anyone succeeded in building extension without ios part?

@messi89
Copy link

messi89 commented Nov 12, 2013

with ios i don't know but i tried the ane extension on android...it's ok with me

can you share your code (part of social) ?

@devotionsolutions
Copy link

Hello everyone, I cannot publish with publish_actions permissions instead of publish_stream.
Do you know if I also need to make any additional change on my FB App Settings, etc?

@tantanix
Copy link

tantanix commented Oct 5, 2014

Hello
I've been banging my head with this issue for three weeks now. ANE works fine with one project but fails with another one. All settings are the same except package name, app id, etc. Project A works perfectly but Project B loops when requesting read permissions. Tried creating a new project and still fails. Only Project A works but I don't see any other setting that I have missed.

  • Nexus 7 Android 4.2.2, Facebook app v18.0.0.23.14

@AdamFP
Copy link
Contributor

AdamFP commented Mar 6, 2017

deprecated

@AdamFP AdamFP closed this as completed Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests