简体   繁体   English

如何在Facebook上向多个应用程序用户发送通知?

[英]How to send a notification to multiple app users on facebook?

I have implemented facebook notification api. 我已经实现了Facebook通知API。

this is it. 就是这个。

 $notiData = array('href'=> 'https://apps.facebook.com/',
            'access_token'=> $app_token,
            'template'=> 'test' );

 $noti = $facebook->api('/userId/notifications','POST',$notiData);

my problem is how to send a notification to multiple/ all app users at once? 我的问题是如何一次向多个/所有应用程序用户发送通知? how to implement RECIPIENT'S IDS? 如何实施收件人的IDS?

I tried like this 我尝试过这样

 $noti = $facebook->api('/10343603789032,123404256614081/notifications','POST',$notiData);

above method didn't work. 以上方法无效。

Best practice is that you should be sending individual unique notifications to users, customised to them, ie 最佳做法是您应该向用户发送个性化的个性化通知,即

"Your friend Jack has sent you a magic sheep. Click to accept it". “您的朋友杰克给您寄来了一只神奇的绵羊。单击以接受它”。

As opposed to: 相对于:

You have a new request in your inbox. 您的收件箱中有一个新请求。

Remember, personalising it will help keep your click-through rate high. 请记住,对其进行个性化设置将有助于保持较高的点击率。 If your click through rate is low, you'll be blocked from sending notifications. 如果您的点击率较低,则会阻止您发送通知。

However, to answer your question, you can use the Batch request API to send multiple notifications in the one request. 但是,要回答您的问题,您可以使用批处理请求API在一个请求中发送多个通知。

https://developers.facebook.com/docs/reference/api/batch/ https://developers.facebook.com/docs/reference/api/batch/

But I recommend you put some thought into making each notification unique. 但是我建议您考虑一下使每个通知都唯一。 You can and should still use the batch API if you're sending out large amounts of notifications even if they're unique. 如果要发送大量的通知(即使它们是唯一的),则可以并且仍应使用批处理API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM