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

Sharesheet - share to Facebook blank share #181

Closed
itbeyond opened this issue Aug 1, 2016 · 23 comments
Closed

Sharesheet - share to Facebook blank share #181

itbeyond opened this issue Aug 1, 2016 · 23 comments

Comments

@itbeyond
Copy link

itbeyond commented Aug 1, 2016

I have spent a lot of time with the sharesheet system and it works perfectly for all shares except Facebook. On all other providers I get the link and text as expected and these links all work correctly however every time I share to Facebook the share panel is blank. If I then manually PASTE the url for the sharesheet page it loads the link box in the FB share correctly.

I have checked the BranchObject is created correctly in the links views of the Dashboard so the BO creation as you would expect is right based on it working for everything but FB.

Any clues?

PS: This issue seems to be only happening in Android 4.X seems to work ok in 5+

@renesansz
Copy link
Contributor

@itbeyond ,
Hmm, weird, are you using other plugins for Facebook?

@itbeyond
Copy link
Author

itbeyond commented Aug 1, 2016

No I am not. Same exact code on Android 5 works perfectly. I have another Android 4 test machine here I will give it a try tomorrow and see what it does.

@renesansz
Copy link
Contributor

@itbeyond ,
I see, there were Facebook share sheet related issues before but they were using a plugin.
However, can you provide the log if does give an error or something?

@GerTea
Copy link

GerTea commented Aug 4, 2016

I've got the same issue!
I haven't had the time to really look into it and thought its maybe temporarily. Perhaps fixed in version 2 of the branch android SDK which was released 9 days ago?

@renesansz
Copy link
Contributor

@Floppy1009 , can you provide some logs and other details for your setup? Also are you using other plugins along w/ Branch?

@renesansz
Copy link
Contributor

renesansz commented Aug 5, 2016

I'm using the testbed app, so far this is how it looks.
I'm on Android 4.4.4
image

Is there something missing with the share functionality?

@GerTea
Copy link

GerTea commented Aug 5, 2016

@renesansz
At least in the console there are no errors or anything.
The callbacks give these results:

Share sheet launched: "OK"
Channel selected: {"channelName":"Facebook"}
Share sheet dimissed: "OK"

Is there a way enable more logging?

Currently I'm using Version 2.1.7 with the Branch SDK version 1.14.4

@renesansz
Copy link
Contributor

@Floppy1009 could you do adb on your terminal (command line)?
adb logcat -s CordovaBranchSDK

@GerTea
Copy link

GerTea commented Aug 6, 2016

@renesansz there was not that much output to be honest :D

adb logcat -s CordovaBranchSDK
--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
D/CordovaBranchSDK(19074): [USER_ID]
D/CordovaBranchSDK(19074): [LINK_ID]
D/CordovaBranchSDK(19074): Creating link properties
D/CordovaBranchSDK(19074): {"channelName":"Facebook"} 

Here a screenshot of the screen which appears after without the link (just that you have seen it at least)

screenshot_2016-08-06-11-49-54

@renesansz
Copy link
Contributor

ohh, I see..
hmm. I'm still figuring out the native implementation for the showShareSheet.
The implementation is correct as instructed from the docs, however I can't point out the issue.

@aaustin
Copy link
Contributor

aaustin commented Aug 7, 2016

Hey @Floppy1009 - I think I know what the issue is with Facebook in particular. It seems that in the share previewer window that Facebook scrapes the Branch link to populate the messages in that preview and ignores the Android intent data.

While testing on our native Android SDK, I found that you can control the appearance of that message with the title, contentDescription and contentImageUrl of the Branch Universal Object that you use to trigger the showShareSheet. Here's an example:

Branch.createBranchUniversalObject({
  canonicalIdentifier: 'monster/12345',
  title: 'Meet Mr. Squiggles',
  contentDescription: 'Your friend Josh has invited you to meet his awesome monster, Mr. Squiggles!',
  contentImageUrl: 'https://example.com/monster-pic-12345.png',
  contentMetadata: {
    'userId': '12345',
    'userName': 'Josh',
    'monsterName': 'Mr. Squiggles'
  }
}).then(function (newBranchUniversalObj) {
  branchUniversalObj = newBranchUniversalObj;
  console.log(newBranchUniversalObj);
});```

This would result in that title/image and picture showing up in the preview. Can you give this a try?

@GerTea
Copy link

GerTea commented Aug 7, 2016

@aaustin I'm already setting these options. On my Android 6 phone all works perfectly fine. Just the old Andorid (4.4.4) doesn't. Haven't tried 5 yet. Allthough @itbeyond said 5+ should work.

@aaustin
Copy link
Contributor

aaustin commented Aug 7, 2016

We have a 4X device in the office, so I'll need to wait until tomorrow to check, but can you confirm Facebook is all up to date on that device? Might be a FB bug.

@GerTea
Copy link

GerTea commented Aug 7, 2016

@aaustin yes, Facebook is up to date

@itbeyond
Copy link
Author

itbeyond commented Aug 8, 2016

@aaustin this is the very same issue - works fine on Android 5+ and IOS just Android 4.X is the problem. As @Floppy1009 states all settings correct and I use the exact same code on these different platforms. The problem is 4.X

@GerTea
Copy link

GerTea commented Aug 15, 2016

@aaustin any updates? Anything I can help you with?
@itbeyond Have you found a way to get it working?

@aaustin
Copy link
Contributor

aaustin commented Aug 15, 2016

Apologies @Floppy1009 - This fell off my radar. On it today. Will update soon.

@aaustin
Copy link
Contributor

aaustin commented Aug 15, 2016

Alright, I just tested our latest native Android SDK with the share sheet on Facebook on a Nexus running 4.2.2 and it appears to work. Here's the screenshot I took:

So, there appears to be some interaction between the Cordova built version and Facebook on 4X. I'm looking through the code to determine if I see any discrepancy.

@aaustin
Copy link
Contributor

aaustin commented Aug 16, 2016

Whoa! I found the issue and it's crazy, but it appears to be a bug on Facebook's side. Basically, the code to share something inside Cordova is exactly the same as Android, so I started testing other variables.

What I've found is that it* works* for our old apps, where the default domain was bnc.lt but it doesn't work for new apps, where the default domain is app.link. Since Facebook strips out all text that's added to the share, but keeps the URL, my hypothesis is that there's some code path in the Facebook app that is not detecting the app.link domain as a link and stripping it out as if it were text. This same code path doesn't seem to exist for Android 5 and 6.

I'll file a bug with the Facebook team for details on how to reproduce, but in the short term, you can buy a custom domain and white label your Branch links with it. Once you configure this in our dash, it should automatically start working without needing to deploy an update. https://dev.branch.io/getting-started/link-domain-subdomain/guide/#setting-a-custom-link-domain Note that you'll need to add the new domain to your entitlements to get Universal Links working on iOS. https://dev.branch.io/getting-started/universal-app-links/guide/cordova/#add-the-associated-domains-entitlement-to-your-project

@aaustin
Copy link
Contributor

aaustin commented Aug 16, 2016

I believe it may actually be an Android issue: https://code.google.com/p/android/issues/detail?id=66032#c7 Where the new domains were not treated by links until 5... This is a big disappointment...

@aaustin
Copy link
Contributor

aaustin commented Aug 16, 2016

Unfortunately, this doesn't appear to be a Branch SDK issue, but appears to be an issue with the app.link domain and Android 4X devices. The resolution is to use a custom domain with your Branch links as described above if you believe 4X to be a core part of your user base.

Apologies for the inconvenience. We definitely didn't anticipate this when we migrated to app.link.

@aaustin aaustin closed this as completed Aug 16, 2016
@perrosnk
Copy link

Has anyone found any other solution apart from not using app.link?

@ethanneff
Copy link
Contributor

@perrosnk, Unfortunately, this issue has not come up in over a year - so no additional workaround has been investigated.

The good news is we try to make the switch from an app.link domain to a custom link domain as easy as possible (docs). Your old app.link link will still work (except for the edge case in this thread), and your new custom link domain links will be the links generated from your app going forward.

Hope this helps!

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

6 participants