自定义的URI方案为Facebook信使 [英] Custom URI Schemes for the Facebook Messenger

查看:316
本文介绍了自定义的URI方案为Facebook信使的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鉴于最近鼓励被Facebook迁移到一个单独的信使应用程序,并为后续的{非常丰富!} 答案对URL的问题/ URI方案支持的Facebook应用程序,我一直想知道关于 <$ C Facebook的Messenger的应用程序自定义协议信息是否$ C> FB-使者:// 可用

Given the recent "encouragement" by Facebook to migrate to a separate messenger app, and as a followup to the {very informative!} answer to the question on URL/URI schemes supported by the Facebook app, I've been wondering whether information regarding the Facebook messenger app custom protocol of fb-messenger:// is available.

我一直在寻找的功能是点击一个按钮,将打开一个FB-信使聊天窗口与他们的数字Facebook的ID是已知用户的能力。这也需要工作,如果Facebook的应用程序(武士刀 )没有设备(即只使者,逆戟鲸安装)。

The functionality I was looking for was an ability to click a button that would open a FB-messenger chat windows with the user whose numeric Facebook ID is known. This also needed to work if the Facebook app (katana) is not installed on the device (i.e. only the messenger, orca).

我发现了一个例如所需的深层链接 FB-使者://用户线程/ {用户ID} ),但是这似乎并没有工作。我意识到,FB在一段时间修改每一次的URI的趋势,因为这些通常不应该提供给公众(据我所知)。

I found an example of the desired deep linking (fb-messenger://user-thread/{user-id}), but that didn't seem to work. I realized that FB has a tendency of revising the URIs every once in a while, since these are generally not supposed to be available to the public (as far as I understand).

推荐答案

在失败寻找这些信息,我决定把我自己的名单。下面是我设法收集至今,伴随着一些解释:

After unsuccessfully searching for this information, I've decided to make a list of my own. Below is what I managed to gather so far, along with a few explanations:

这是进行版本更新的 39.0.0.23.150 (2015年10月14日)的。

This is updated for version 39.0.0.23.150 (October 14, 2015).

fb-messenger://android_storage
fb-messenger://callsearch
fb-messenger://compose
fb-messenger://contacts
fb-messenger://contactuploadoptin
fb-messenger://conversationrequests
fb-messenger://groupcompose
fb-messenger://groupthreadfbid/
fb-messenger://groupthreadfbid/%s
fb-messenger://installupdate
fb-messenger://invite
fb-messenger://payments/addcard
fb-messenger://payments/settings
fb-messenger://rtccall
fb-messenger://settings
fb-messenger://settings/dataandstorage
fb-messenger://settings/notifications
fb-messenger://settings/profilepicture
fb-messenger://share                    < Used for sharing multimedia, contains 
                                        //several extras. See more info below.    
fb-messenger://stickerstore
fb-messenger://subscribe
fb-messenger://thread/                  < Deprecated
fb-messenger://threads
fb-messenger://threadsettings
fb-messenger://user/
fb-messenger://user/%s                  < Opens chathead/conversation with user %s
                                        //where %s is the user number. Using a text
                                        //string (e.g. username) crashes the orca app.
fb-messenger://verifyphonenux

fb-messenger-sametask://share
fb-messenger-secure://rtccall/audio/%s
fb-messenger-secure://rtccall/video/%s


下面是一些URI方案,其目的在此应用程序,我不知道的:


Here are some URI schemes whose purpose in this app I don't know:

  • fb:// - see possible URIs of this scheme here.
  • fb-work://
  • fbinternal://
  • fb-messenger-secure://
  • dialtone://

调查 FB-使者://份额(从这个帖子旧版本 - 可能是无效的):

Investigation of fb-messenger://share (from older version of this post - may be invalid):

  • 有一个 StringExtra 名为 ShareType ,可以是: ShareType.invite ShareType.forward ShareType.regular
  • 拥有的的(?) StringExtra 名为 ShareType.invitedUser
  • 拥有的的(?) StringExtra 名为 ShareType.invitedUserDisplayName
  • 拥有的的(?) StringExtra 名为 ShareType.inviteEntryPoint
  • 拥有的的(?) StringExtra 名为 ShareType.invitesSentBroadcastAction
  • (数人)
  • Has a StringExtra called ShareType that can be: ShareType.invite, ShareType.forward, ShareType.regular.
  • Has an optional (?) StringExtra called ShareType.invitedUser.
  • Has an optional (?) StringExtra called ShareType.invitedUserDisplayName.
  • Has an optional (?) StringExtra called ShareType.inviteEntryPoint.
  • Has an optional (?) StringExtra called ShareType.invitesSentBroadcastAction.
  • (several others)

在的情况下, ShareType.forward

  • 有一个其他与标签附件 消息
  • 有一个其他与标签触发
  • Has an Extra with the tag "attachment" OR "message".
  • Has an Extra with the tag "trigger".
  • android.intent.extra.TEXT 字符串
  • 附件 Parcelable
  • 的消息 Parcelable
  • PAGE_NAME 字符串
  • page_post_id 字符串
  • page_target
  • send_as_message_entry_point 字符串
  • share_attachment_url 字符串
  • share_caption 字符串
  • share_description 字符串
  • share_fbid 字符串
  • share_link_url 字符串
  • share_media_url 字符串
  • share_return_to_fb4a 布尔
  • share_robotext 字符串
  • share_story_url 字符串
  • share_title 字符串
  • ShareType 字符串
  • target_recipients 字符串数组
  • 标题字符串
  • 触发字符串
  • android.intent.extra.TEXT : String
  • attachment : Parcelable
  • message : Parcelable
  • page_name : String
  • page_post_id : String
  • page_target : Long
  • send_as_message_entry_point : String
  • share_attachment_url : String
  • share_caption : String
  • share_description : String
  • share_fbid : String
  • share_link_url : String
  • share_media_url : String
  • share_return_to_fb4a : Boolean
  • share_robotext : String
  • share_story_url : String
  • share_title : String
  • ShareType : String
  • target_recipients : StringArray
  • title : String
  • trigger : String

所需的功能可以通过使用实现 FB-使者://用户/ {用户ID} 而不是 FB-使者:/ /用户线程/ {用户ID}

The required functionality may be achieved by using fb-messenger://user/{user-id} instead of fb-messenger://user-thread/{user-id}.

注意 {用户ID} 是用户的全球数字ID (如的对于扎克伯格是 4 ),它可以是通过解析对应于人的用户名的html文件(获得的(如2015年11月的),例如:的扎克伯格是 https://www.facebook.com/zuck )和提取entity_id已发现里面。

Note that {user-id} is the user's global numeric ID (e.g. for Zuck it's 4), which can be obtained (as of Nov. 2015) by parsing the html document that corresponds to the person's user name (e.g. for Zuck it's https://www.facebook.com/zuck) and extracting the "entity_id" that is found inside.

据我的最新测试,应用范围的用户ID 的,这是通常提供给开发者的ID,请不要在此工作!

According to my latest test, app-scoped user IDs, which are usually the IDs available to developers, do not work for this!

下面是提取全局ID为已知用户名(信贷python3脚本:保罗·施雷伯):

Below is a python3 script that extracts the global ID for a known username (credit: Paul Schreiber):

#!/usr/bin/python

import requests
import re

url = 'https://www.facebook.com/zuck'
idre = re.compile('"entity_id":"([0-9]+)"')
page = requests.get(url)
print(idre.findall(page.content.decode()))

另外,本网站可用来实现同样的事情。

Alternatively, this site can be used to achieve the same thing.

请还注意到,这个方法是<一个href="http://stackoverflow.com/questions/32214691/custom-uri-scheme-facebook-breaks?rq=1#comment52315523_32214691">not官方支持,甚至可能<一href="http://stackoverflow.com/questions/26874818/sending-message-from-ios-application-to-fb-messenger-app?lq=1#comment42307670_26874818">get您的应用程序禁止通过FB 。

Please also note that this method is not officially supported and might even get your app banned by FB.

这篇关于自定义的URI方案为Facebook信使的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆