我已经构建了一个没有phoneGap的Xcode项目,但客户端想要添加一些新功能.所以我决定使用phoneGap来做,我不知道如何将phoneGap导入我的旧Xcode项目.我怎样才能做到这一点?
在我的应用程序中,我想使用CGRectFromString来设置UIButton位置.我的代码就是这样
NSString *g = @"{0,0},{100, 100}";
CGRect rect = CGRectFromString(g);
self.button1.frame = rect;
Run Code Online (Sandbox Code Playgroud)
但是很有效.我想念的任何东西或它的苹果虫?
我使用PHP发送推送消息到apns,我使用"增强通知格式"发送..但我不能得到返回"错误响应包中的代码"任何人都可以帮助我?这是我的代码
<?php
header("Content-Type: text/html; charset=UTF-8");
$deviceToken = "123";
$content = "testing";
if(isset($content))
{
$newContent=substr($content,0,30)."...";
$re_content=iconv("GB2312","UTF-8",$newContent);
$pass = 'Ladder';
$body = array("aps" => array("alert" => $re_content, "badge" => 1, "sound" => 'received5.caf'));
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', 'dev.pem');
stream_context_set_option($ctx, 'ssl', 'passphrase', $pass);
//$fp = stream_socket_client('ssl://gateway.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);
$fp = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $err, $errstr, 60, STREAM_CLIENT_CONNECT, $ctx);
stream_set_blocking ($fp, 0);
if (!$fp)
{
print "Failed to connect $err $errstrn";
return;
}
else
{
print "Connection OK\n<br/>";
}
$payload = …Run Code Online (Sandbox Code Playgroud)