facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 907 forks source link

ShareDialog with many query strings url, only displays one url query #616

Open ilhamsa1 opened 5 years ago

ilhamsa1 commented 5 years ago

🐛 Bug Report

I want to share the link with 2 query strings but, when I share facebook. only one sring query is read

Expected Behavior

I want the link to be displayed like this ..

https://play.google.com/store/apps/details?id=com.myapp.example&referralCode=QWSDD

but when I share facebook the results are like this ..

https://play.google.com/store/apps/details?id=com.myapp.example&fbclid=IwAR2VScjO8hZxJRH8JntbK1cPdtGlax0lsRmdNGAk_B6gl1n7iB-IshCfHmc

why only query string id that read, and why referaralCode is replaced with fbcli ?...

Code Example

import { ShareDialog } from 'react-native-fbsdk'

const APP_NAME = 'com.example.project'

const LINK = `https://play.google.com/store/apps/details?id=${APP_NAME}?referralCode=`
const LINK_DESCRIPTION = 'Wow, check out this great app!'

const shareLinkContent = {
  contentType: 'link',
  contentUrl: LINK,
  contentDescription: LINK_DESCRIPTION,
}

export const shareLinkWithShareDialog = (referralCode = null) => {
  shareLinkContent.contentUrl = `${LINK}${referralCode}`
  return ShareDialog.canShow(shareLinkContent)
    .then((canShow) => {
      if (canShow) return ShareDialog.show(shareLinkContent)
      return null
    }).then(
      (result) => {
        if (result.isCancelled) {
          console.log('Share cancelled')
        } else {
          console.log('Share success')
        }
      },
      (error) => {
        console.log(`Share fail with error: ${error}`)
      },
    )
}

Environment

i used react-native-fbsdk: "0.10.1"

Kgwkgwkgw commented 5 years ago

me too similar.. not share posting...facebook app issue..