[TIMOB-23521] Ti.Facebook - presentShareDialog does not open native app, only webview
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-09-11T16:56:36.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.0.0 |
Components | Android, iOS |
Labels | ti.facebook |
Reporter | Be Rushton |
Assignee | Hans Knöchel |
Created | 2016-06-06T07:55:02.000+0000 |
Updated | 2016-09-16T22:02:48.000+0000 |
Description
The facebook module does not open the native share dialog, it only opens the web version in a webview.
It should open the sharesheet ie. https://developers.facebook.com/docs/sharing/ios
Code to reproduce is standard boilerplate from the docs:
fb.presentShareDialog({
link: 'https://appcelerator.com/',
title: 'great product',
description: 'Titanium is a great product',
picture: 'http://www.appcelerator.com/wp-content/uploads/scale_triangle1.png'
});
Hello, Thanks for reporting. Native share dialog will not be opened if
Facebook
app is not installed in the device. So, please make sure thatFacebook
app is installed in the device and let us know. Thanks in advanceDoesn't matter if native app is installed or not.
Facebook changed the way a lot of their code worked when iOS 9 came out last year. Older versions of the module still open the native app but things changed in the newer Facebook sdk
Similar to the login-process, the native Facebook SDK on iOS 9+ decides internally which behavior to use. Since the app-switching in iOS9+ requires the user to confirm the switch, they (currently) prefer opening the safari-dialog for those operations. We follow their best-practices, so if you see it as an issue, please follow-up with Facebook. Thanks!
Could you give us the option please? Not everyone agrees with the current behaviour. It was available previously and we need to maintain the currently functionality of existing applications.
As said before, we cannot change Facebook's internal decisions and behavior. I am not sure how I can help you while being restricted by the Facebook SDK.
Yeah I can see where you are coming from. There does seem to be some ways around it though like this one http://stackoverflow.com/a/35732372/568754. There is plenty of people that disagree with the change. If these workarounds aren't an option is there a way to use an older Facebook SDK? Will the old ti.facebook versions work or has there been too many bug fixes to get them working on Ti 5.3.1.GA and above?
UPDATE: Actually, I found a way to configure the dialog. There is a property
mode
that we could possibly set. I wrapped up a PR here which I'd like you to test: PR: https://github.com/appcelerator-modules/ti.facebook/pull/58 Release (iOS): https://github.com/appcelerator-modules/ti.facebook/releases/tag/ios-5.2.1 Release (Android): https://github.com/appcelerator-modules/ti.facebook/releases/tag/android-6.0.1 Demo:PR's merged, titanium_mobile updated.
Verified the fix. The
mode
property works fine on android. Environment: Appc Studio : 4.8.0.201608221113 Ti SDK : 6.0.0.v20160901034311 Ti CLI : 5.0.9 Alloy : 1.9.1 MAC El Capitan : 10.11.6 Appc NPM : 4.2.7 Appc CLI : 6.0.0-31 Node: 4.4.4 Nexus 6 - Android 6.0.1 Facebook Module : 6.0.1 On iOS: When I run with facebook iOS module 5.2.1, build fails with:IOS facebook modules 5.2.2 & higher do not seem to have this issue & the
mode
property seems to work fine. Reopening as the fix is in 5.2.1 facebook module. Using: Xcode: 7.3.1 Iphone 6 - 9.3.5 IOS facebook module : 5.2.1 Appc Studio : 4.8.0.201608221113 Ti SDK : 6.0.0.v20160901034311 Appc CLI : 6.0.0-31Thanks Lokesh! I would highly suggest to use MOD-2280 for 6.0.0 which not only includes an important fix but should also fix the above problem. [~cng] to discuss. Otherwise, I will backport it manually.
[~hansknoechel], facebook module 5.2.3 & 5.2.4 for IOS works fine. You can resolve the ticket after your discussion with [~cng].
Verified the fix for IOS with 5.2.6 facebook module. Closing. Environment: Appc Studio : 4.8.0.201609061702 Ti SDK : 6.0.0.v20160915125929 Ti CLI : 5.0.9 Alloy : 1.9.1 MAC El Capitan : 10.11.6 Appc NPM : 4.2.8-6 Appc CLI : 6.0.0-44 Node: 4.4.4 Nexus 6 - Android 6.0.1