鸭prequest不发送通知 [英] Apprequest doesn't send the notification

查看:102
本文介绍了鸭prequest不发送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我想要使用Facebook的API来发送通知和我这样做:

Hello everyone i'm trying to use the Facebook Api to send a notification and i did this:

Bundle params = new Bundle();
params.putString("to", 535465135216);
params.putString("message", "Prova Prova A A");
facebook.dialog(Answer.this, "apprequests", params, new DialogListener() {
                public void onComplete(Bundle values) {
                                    Toast toast = Toast.makeText(getApplicationContext(), "Done",
                                            Toast.LENGTH_SHORT);
                                    toast.show();
                                }

                                @Override
                public void onFacebookError(FacebookError error) {
                                    Toast.makeText(getApplicationContext(), "Facebook Error: " + error.getMessage(),
                                            Toast.LENGTH_SHORT).show();
                                }

                                @Override
                public void onCancel() {
                                    Toast toast = Toast.makeText(getApplicationContext(), "App request cancelled",
                                            Toast.LENGTH_SHORT);
                                    toast.show();
                                }

                                @Override
                public void onError(DialogError e) {
                                    // TODO Auto-generated method stub

                                }
                            });

当我尝试运行该项目的一切运作良好,它显示了吐司完成,但在我的Facebook个人资料没有显示通知。

And when i try to run this project everything work well and it shows the Toast "Done" but in my Facebook Profile doesn't appear the notification.

我应该改变的东西在Facebook应用程序的设置?

Should I change something in Facebook App's settings ?

三江源:)

推荐答案

很多时候,当邀请被发送成功,但不出现则是因为一个帆布URL中的应用程序设置没有设置用户。

Many times when invites are successfully sent but do not appear for the user it is because a canvas url was not set in the application settings.

在与申请邀请/请求处理,因为当用户采取行动的邀请(这意味着点击接受)画布URL参数是至关重要的,他被重定向到您的应用程序。如果没有帆布网址提供,邀请本质上变得无效,因为Facebook已经向用户发送任何地方后,他们点击!

The canvas url parameter is crucial when dealing with application invites/requests because when a user takes action on the invite (that means clicks "accept"), he is redirected to your application. If no canvas url is supplied, the invitation essentially becomes nullified because Facebook has no where to send the user after they click!

您正在开发一个Android应用程序,所以你可能甚至不需要一个画布URL,但为了得到正常工作的邀请函,你必须指定一个。

You are developing an android application so you might not even need a canvas url but in order to get the invitations working correctly, you'll have to specify one.

另一种可能性是,您发送的邀请/请求未在应用程序中的角色定义时,您的应用程序仍设置为沙盒模式的用户。只要你的应用程序保持在沙盒模式下,它本质上是看不到的角色部分中没有定义任何人。该沙盒模式使开发人员能够开发,也不必担心使得公众在Facebook上测试他们的应用程序。所以,你就可以发送了邀请,但如果你将其发送给谁没有定义,并且参与了应用程序的开发人,他/她根本不会获得邀请(即使动作会显得它是成功的)。

Another possibility is that you are sending the invite/request to a user that is not defined in the "roles" of your application when your app is still set to "sandbox mode". As long as your app remains in sandbox mode it is essentially invisible to anyone not defined in the "roles" section. This sandbox mode allows developers to develop and test their application without having to worry about making it public on Facebook. So you'll be able to send the invite, but if you send it to someone who is not defined and involved in the development of the app, s/he will simply not get the invite (even though the action will seem that it was successful).

这篇关于鸭prequest不发送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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