那么对于#1,你可以做这样的事情......
在您的手机应用程序中有一个方法,例如:
- (void) send_to_server {
NSString *urlString = [NSString stringWithFormat:@"http://weburl.com/?variable=%@", variable];
NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:urlString] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if (theConnection) {
receivedData = [NSMutableData data];
if ([[NSString stringWithFormat:@"%@", receivedData] isEqualToString:@"Success"]){
//Do something here
}else{
//Do something else here
}
}
}
在您的 PHP 中,您可以执行以下操作:
<?php
$variable = $_GET['variable'];
//do what you need to do here...
//Put things into queue or what-not
if ($success){
echo "Success";
}else{
echo "Failure";
}
?>
更新
<?php
if (isset($_GET['variable']){
echo "Success";
$variable = $_GET['variable'];
//do what you need to do here...
}else{
echo "Failure";
}
?>
至于向其他手机发送推送通知,我不知道该怎么做。但我认为 PHP 在效率方面没有问题。