我按照Android的Facebook API教程来设置Facebook登录,查看新闻源并向Facebook发布新消息。一切正常。现在我想将应用程序链接关联到我的应用程序,以便进行深层链接。我更改了邮政编码,用我的链接向/ app / app_link_hosts提交请求以便关联它,我收到了这个错误回复:
05-12 13:59:25.002: E/response(32412): {Response: responseCode: 403, graphObject: null, error: {HttpStatus: 403, errorCode: 200, errorType: OAuthException, errorMessage: (#200) Permissions error}, isFromCache:false}
这是我的app_link_hosts代码
Session session = Session.getActiveSession();
Bundle params = new Bundle();
params.putString("name", "App Post");
params.putString("android", "[{\"url\": \"myapp://post/" + appLinkHostId + "\",\"package\": \"com.myapp.socialnetworktest\"}]");
params.putString("web", "{\"should_fallback\": false}");
/* make the API call */
new Request(
session,
"/app/app_link_hosts",
params,
HttpMethod.POST,
new Request.Callback() {
public void onCompleted(Response response) {
Log.e("response", response.toString());
}
}
).executeAsync();
我认为一旦我开始工作,我可以使用我在新Facebook帖子中提交的URL作为URL,深层链接将起作用。这是对的吗?