[RESOLVED] Facebook on HTC Desire C vs Sony Xperia

Hey Forum,

I am having a very localised issue with Facebook in Corona for android.

First the basic need-to know:

I am using the latest Corona Enterprise Edition 2013.1170.

The code is simple:

facebook.login("appID", loggedInHandler, {"publish\_stream"});  

The application we have created requires you to use facebook to continue. 

When I build my app for iOS everything works fine.

When I build my app for android and test the app on my Sony Xperia S LT26i there is no problem as well, I can connect to facebook without any problems, thus I know that my settings on Facebook as well as the settings in the app are correct.

When I build my APK and run it on a HTC Desire C I get an error and I cannot continue in my app!

The facebook popup page shows me the error that the request page is currently not able to be displayed.

Has this something to do with the device model or default installed facebook application? Since it obviously works on android, as the Sony Xperia shows.

Thanks in advance,

Philippe Creytens

Bazookas

Philippe @Bazookas, does your HTC Desire C have Facebook app installed while Sony Xperia S LT26i doesn’t?  If that’s the case, you may be interested in these threads:

Post by Joel_DGS on page 2:

http://forums.coronalabs.com/topic/36515-facebookshowdialog-doesnt-return-a-response-on-android-but-does-in-ios/page-2

Not so well written as Joel_DGS, but I posted my finding here and filed a bug report:

http://forums.coronalabs.com/topic/37400-facebook-login-flow-on-android-broken-since-daily-build-1141/

Naomi

Edit:  And more details on why Facebook app causes issues, read posts by Rob Miracle and beckslash:

http://forums.coronalabs.com/topic/36635-android-facebook-after-build-coronasdk-20131076/page-2

Hey Naomi,

both devices have Facebook installed but thanks for the links, I’ll check them and see if there is a solution in them somewhere!

The mystery is getting bigger and bigger!

On the Sony Xperia I have run some tests, and everything works fine until I remove the app from the device and use

./adb install myapklocation.apk

in my terminal to reinstall the app. Then all of a sudden Facebook throws the same error as I see on my HTC Desire!
I have tested this with the sample code provided in the samplecode folder to make sure there wasn’t a glitch in my code causing the error, adding to the AndroidManifest these tags:

\<activity android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:configChanges="keyboardHidden|screenSize|orientation"/\>\<activity android:name="com.ansca.corona.facebook.FacebookFragmentActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:configChanges="keyboardHidden|screenSize|orientation"/\>

And the same error is thrown after I delete the app and reinstall the app using the terminal window.
If I logout of the facebook native app on the device and login once more, this issue is resolved! Until I delete the app and reinstall the app of course, then, unless I have signed off facebook and signed on again, it throws that error.

Is this a facebook app caching problem? And what will happen when there is an update from this app or users delete it and reinstall the app from the google play store? Will they encounter the same issue?

Also regarding the HTC Desire, this signing off and on does not affect the behaviour on the HTC, it keeps on giving me the notification that the requested page cannot be shown.

Update: I have checked previous app we already pushed to the google play store and there I experience the same issue with the Sony Xperia!! Even though the apps are in the Google Play store for several months now, and the used Corona Version was 2013.1075, long before the facebook sdk was updated! This makes me believe that it must be because facebook has updated either their settings on the server or native app on the device or both which cause these troubles.

Ah, that’s good to know, Philippe @Bazookas.  So, it sounds like this is something to do with changes that Facebook made (which affects apps regardless of what Facebook SDK version was used to build it.)  How horrid.  I hope Corona team can find the way to handle this…

Naomi

Edit:  I sent a followup email to Corona support for the bug report I filed, pointing to this thread too so that they’d be aware of your finding.

Philippe @Bazookas, does your HTC Desire C have Facebook app installed while Sony Xperia S LT26i doesn’t?  If that’s the case, you may be interested in these threads:

Post by Joel_DGS on page 2:

http://forums.coronalabs.com/topic/36515-facebookshowdialog-doesnt-return-a-response-on-android-but-does-in-ios/page-2

Not so well written as Joel_DGS, but I posted my finding here and filed a bug report:

http://forums.coronalabs.com/topic/37400-facebook-login-flow-on-android-broken-since-daily-build-1141/

Naomi

Edit:  And more details on why Facebook app causes issues, read posts by Rob Miracle and beckslash:

http://forums.coronalabs.com/topic/36635-android-facebook-after-build-coronasdk-20131076/page-2

Hey Naomi,

both devices have Facebook installed but thanks for the links, I’ll check them and see if there is a solution in them somewhere!

The mystery is getting bigger and bigger!

On the Sony Xperia I have run some tests, and everything works fine until I remove the app from the device and use

./adb install myapklocation.apk

in my terminal to reinstall the app. Then all of a sudden Facebook throws the same error as I see on my HTC Desire!
I have tested this with the sample code provided in the samplecode folder to make sure there wasn’t a glitch in my code causing the error, adding to the AndroidManifest these tags:

\<activity android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:configChanges="keyboardHidden|screenSize|orientation"/\>\<activity android:name="com.ansca.corona.facebook.FacebookFragmentActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:configChanges="keyboardHidden|screenSize|orientation"/\>

And the same error is thrown after I delete the app and reinstall the app using the terminal window.
If I logout of the facebook native app on the device and login once more, this issue is resolved! Until I delete the app and reinstall the app of course, then, unless I have signed off facebook and signed on again, it throws that error.

Is this a facebook app caching problem? And what will happen when there is an update from this app or users delete it and reinstall the app from the google play store? Will they encounter the same issue?

Also regarding the HTC Desire, this signing off and on does not affect the behaviour on the HTC, it keeps on giving me the notification that the requested page cannot be shown.

Update: I have checked previous app we already pushed to the google play store and there I experience the same issue with the Sony Xperia!! Even though the apps are in the Google Play store for several months now, and the used Corona Version was 2013.1075, long before the facebook sdk was updated! This makes me believe that it must be because facebook has updated either their settings on the server or native app on the device or both which cause these troubles.

Ah, that’s good to know, Philippe @Bazookas.  So, it sounds like this is something to do with changes that Facebook made (which affects apps regardless of what Facebook SDK version was used to build it.)  How horrid.  I hope Corona team can find the way to handle this…

Naomi

Edit:  I sent a followup email to Corona support for the bug report I filed, pointing to this thread too so that they’d be aware of your finding.

Found the issue.

I have used the latest enterprise version and their examples but they did not seem to work.

After some more googeling and searching I came to find that the app’s on the devices needed to be updated to 3.0.

Once i had updated all the devices and their facebook app I retested the apps and everything worked like a charm! Seems to be a facebook app issue.

So to anyone that experiences these problems, update the facebook app on your device to make sure it isn’t a facebook app related issue.

Found the issue.

I have used the latest enterprise version and their examples but they did not seem to work.

After some more googeling and searching I came to find that the app’s on the devices needed to be updated to 3.0.

Once i had updated all the devices and their facebook app I retested the apps and everything worked like a charm! Seems to be a facebook app issue.

So to anyone that experiences these problems, update the facebook app on your device to make sure it isn’t a facebook app related issue.