I'm using Firebase to push notifications to my iOS/Android Apps. The target estimate for the iOS app is "-" while it's >1000 for the android.
Is there a way to push notifications to more than 1000 users?
Why is the iOS target not defined? Does that mean I can push notifications to as much users as I want without restrictions?
我正在使用Firebase向我的iOS/Android应用推送通知。iOS应用的目标估计是“-”,而android则是>1000。是否有办法将通知推送给超过1000个用户?为什么iOS的目标没有被定义?这是否意味着我可以在不受限制的情况下将通知推送给尽可能多的用户?
2 个解决方案
#1
1
You have two options. 1. Loop through all the DeviceIDs and send notification to each of them 2. Subscribe your users on some "topic" and send notification to that topic. https://firebase.google.com/docs/cloud-messaging/ios/topic-messaging
你有两个选择。1。遍历所有的DeviceIDs,并向其中的每一个发送通知。在一些“主题”上订阅您的用户,并发送通知到该主题。https://firebase.google.com/docs/cloud-messaging/ios/topic-messaging
#2
0
use just for loop tack all device id from database if you stored othewise from arra use like this some syntax may change
如果你在arra中存储了othewise,那么你就可以从数据库中获取所有的设备id,这样一些语法可能会发生变化。
$sql = 'select deviceid from tablename';
$deviceid = mysql_query( $sql, $conn );
if(! $deviceid ) {
die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_array($deviceid, MYSQL_ASSOC)) {
$title=$_GET["Title"];
$massage=$_GET["massage"];
$fields=array('to'=> $row['deviceid'] ,'notification'=>array('title'=> $title,'body'=> $massage,'click_action'=> 'abc','icon'=>'ic','sound'=> 'default','color'=> '#00aff0'));
$headers = array (
key,
'Content-Type: application/json'
);
$ch = curl_init ();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
$result = curl_exec ( $ch );
echo $result;
curl_close ( $ch );
}
mysql_close($conn);
#1
1
You have two options. 1. Loop through all the DeviceIDs and send notification to each of them 2. Subscribe your users on some "topic" and send notification to that topic. https://firebase.google.com/docs/cloud-messaging/ios/topic-messaging
你有两个选择。1。遍历所有的DeviceIDs,并向其中的每一个发送通知。在一些“主题”上订阅您的用户,并发送通知到该主题。https://firebase.google.com/docs/cloud-messaging/ios/topic-messaging
#2
0
use just for loop tack all device id from database if you stored othewise from arra use like this some syntax may change
如果你在arra中存储了othewise,那么你就可以从数据库中获取所有的设备id,这样一些语法可能会发生变化。
$sql = 'select deviceid from tablename';
$deviceid = mysql_query( $sql, $conn );
if(! $deviceid ) {
die('Could not get data: ' . mysql_error());
}
while($row = mysql_fetch_array($deviceid, MYSQL_ASSOC)) {
$title=$_GET["Title"];
$massage=$_GET["massage"];
$fields=array('to'=> $row['deviceid'] ,'notification'=>array('title'=> $title,'body'=> $massage,'click_action'=> 'abc','icon'=>'ic','sound'=> 'default','color'=> '#00aff0'));
$headers = array (
key,
'Content-Type: application/json'
);
$ch = curl_init ();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
$result = curl_exec ( $ch );
echo $result;
curl_close ( $ch );
}
mysql_close($conn);