[英]User do not receive notification in my android app
I developed an app, and Need to invite your friends in the game. 我开发了一个应用,并且需要邀请您的朋友参加游戏。 I send the request through the app-to-user's way But confusing.
我通过应用程序到用户的方式发送请求,但令人困惑。 users who is not using the app can not receive the notifications.
未使用该应用程序的用户无法接收通知。 Users who has used the app can receive the notifications.
使用该应用程序的用户可以接收通知。 My purpose is to send a notifications with a URL to the user who is not using the app, let him download my app.
我的目的是向不使用该应用程序的用户发送带有URL的通知,让他下载我的应用程序。
I read some posts and know that this may be due to the canvas URL caused. 我阅读了一些帖子,并且知道这可能是由于画布URL引起的。
Here is my code 这是我的代码
private void sendRequestDialog(Bundle params2) {
Bundle params = new Bundle();
params.putString("to", params2.getString("to"));
params.putString("message", params2.getString("message"));
WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder(main,
Session.getActiveSession(), params)).setOnCompleteListener(
new OnCompleteListener() {
@Override
public void onComplete(Bundle values,
FacebookException error) {
if (error != null) {
if (error instanceof FacebookOperationCanceledException) {
Toast.makeText(main.getApplicationContext(),
"Request cancelled", Toast.LENGTH_SHORT)
.show();
} else {
Toast.makeText(main.getApplicationContext(),
"Network Error", Toast.LENGTH_SHORT)
.show();
}
} else {
final String requestId = values
.getString("request");
if (requestId != null) {
Toast.makeText(main.getApplicationContext(),
"Request sent", Toast.LENGTH_SHORT)
.show();
} else {
Toast.makeText(main.getApplicationContext(),
"Request cancelled", Toast.LENGTH_SHORT)
.show();
}
}
}
}).build();
requestsDialog.show();
}
My answer here may help : How to share a message to facebook -- android 我在这里的答案可能会有所帮助: 如何将消息共享给Facebook-Android
Find the link to the facebook documentation in the comments. 在评论中找到指向Facebook文档的链接。 Then simply make sure you are following the steps during app creation and specifying a Canvas URL.
然后,只需确保您在创建应用程序过程中遵循了步骤并指定了Canvas URL。 There are examples at the bottom of the page to assist you.
页面底部有一些示例可为您提供帮助。 Your code doesn't seem to be the problem, it just needs a suitable link for your application to be able to provide invitations.
您的代码似乎不是问题,它只需要一个适合您的应用程序的链接就可以提供邀请。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.