Branch.io共享表不起作用,没有任何错误或错误

时间:2019-08-10 03:30:03

标签: branch share deep-linking branch.io

没有我可以附加的错误报告。只是根本行不通。我单击共享,无论我选择哪个选项(复制,whatsapp,messanger等),都不会发生任何事情。它只是折回到底部,什么也不做。如果我在单击副本后尝试过去,则会粘贴我复制的上一个内容(这意味着它根本没有复制共享链接)。

这是我的代码:

    lp = LinkProperties()

    buo.listOnGoogleSearch(viewHolder.root.context)

    share.setOnClickListener {
        val ss = ShareSheetStyle(activity, "Republic invite", "Join me in this republic.")
            .setCopyUrlStyle(activity.resources.getDrawable(android.R.drawable.ic_menu_send), "Copy", "Added to clipboard")
            .setMoreOptionStyle(activity.resources.getDrawable(android.R.drawable.ic_menu_search), "Show more")
            .addPreferredSharingOption(SharingHelper.SHARE_WITH.FACEBOOK)
            .addPreferredSharingOption(SharingHelper.SHARE_WITH.FACEBOOK_MESSENGER)
            .addPreferredSharingOption(SharingHelper.SHARE_WITH.WHATS_APP)
            .addPreferredSharingOption(SharingHelper.SHARE_WITH.TWITTER)
            .setAsFullWidthStyle(true)
            .setSharingTitle("Share With")

        buo.showShareSheet(activity, lp, ss, object : Branch.BranchLinkShareListener {
            override fun onShareLinkDialogLaunched() {}
            override fun onShareLinkDialogDismissed() {}
            override fun onLinkShareResponse(sharedLink: String, sharedChannel: String, error: BranchError) {}
            override fun onChannelSelected(channelName: String) {
                firebaseAnalytics.logEvent("community_shared_$channelName", null)
            }
        })

1 个答案:

答案 0 :(得分:0)

如以下示例所示,更改代码后,能否请您检查是否遇到相同的错误?

    val buo = BranchUniversalObject()
    val lp = LinkProperties()


    val ss = ShareSheetStyle(this@MainActivity, "Check this out!", "This stuff is awesome: ")
        .setCopyUrlStyle(
            ContextCompat.getDrawable(this, android.R.drawable.ic_menu_send),
            "Copy",
            "Added to clipboard"
        )
        .setMoreOptionStyle(
            ContextCompat.getDrawable(this, android.R.drawable.ic_menu_search),
            "Show more"
        )
        .addPreferredSharingOption(SharingHelper.SHARE_WITH.FACEBOOK)
        .addPreferredSharingOption(SharingHelper.SHARE_WITH.EMAIL)
        .addPreferredSharingOption(SharingHelper.SHARE_WITH.MESSAGE)
        .addPreferredSharingOption(SharingHelper.SHARE_WITH.HANGOUT)
        .setAsFullWidthStyle(true)
        .setSharingTitle("Share With")

    buo.showShareSheet(this, lp, ss, object : Branch.BranchLinkShareListener {
        override fun onShareLinkDialogLaunched() {}
        override fun onShareLinkDialogDismissed() {}
        override fun onLinkShareResponse(
            sharedLink: String,
            sharedChannel: String,
            error: BranchError
        ) {
        }

        override fun onChannelSelected(channelName: String) {}
    })

如果您在此问题上仍需要我们的帮助,请联系support@branch.io