我正在使用codeIgniter RESTful API(https://github.com/philsturgeon/codeigniter-restserver)将信息(json格式)返回到我的android/iphone应用程序.
有一个操作,我发送一些值,如果它是一切正常我返回200代码作为响应.
现在,我想以相同的方法添加新操作:使用APNS(Apple推送通知服务)和GCM(Google云消息传递)发送此修改的通知.
当我必须发送不超过3-5个通知时它运行良好,问题是APNS,因为我必须逐个发送此消息并且需要很长时间,因此我的应用程序收到超时异常(所有通知都是已发送但用户获取错误连接...)
我可以发送200代码响应,然后继续发送此通知吗?(像这样......)
function my_update_method_post(){
//....GET my POST values
update($data);
$this->response(array('result'=>1),200));
//Send Notifications
....
}
Run Code Online (Sandbox Code Playgroud)
提前致谢...