【发布时间】:2014-07-18 14:38:37
【问题描述】:
我一直在研究各种设备令牌存储方法,我认为我的问题是我从 iOS 设备发送数据的位置。
例如
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://myhost.com/filecreate.php?token=%@",
[[NSUserDefaults standardUserDefaults] objectForKey:@"apnsToken"]]]; //set here your URL
我应该编写什么样的 php 代码来处理这样的事情?
我目前正在使用 xampp,所以我的本地主机上有它。
我完全是 php 新手和体面的 iOS 开发人员,所以我真的不知道如何继续。
这就是我如何编辑 32 个整数的设备令牌
NSString * token = [NSString stringWithFormat:@"%@", deviceToken];
//Format token as you need:
token = [token stringByReplacingOccurrencesOfString:@" " withString:@""];
token = [token stringByReplacingOccurrencesOfString:@">" withString:@""];
token = [token stringByReplacingOccurrencesOfString:@"<" withString:@""];
用于推送到 php 脚本
【问题讨论】:
-
你能举一个你正在推送的令牌的例子吗?
-
@DarylGill 你能再检查一下吗
标签: php ios iphone push-notification