【发布时间】:2015-12-28 11:43:47
【问题描述】:
我正在尝试使用 Urban Airship PHP libraray 实现深度链接消息传递,但我找不到文档或相关代码。 现在我有这个
require_once 'vendor/autoload.php';
use UrbanAirship\Airship;
use UrbanAirship\AirshipException;
use UrbanAirship\UALog;
use UrbanAirship\Push as P;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
$droidToken = "my-device-token" ;
UALog::setLogHandlers(array(new StreamHandler("php://stdout",Logger::INFO)));
$airship = new Airship("key", "Secret");
$req = $airship->push()
->setAudience(P\apid($droidToken))
->setMessage(P\message("This is the title",
"<html><body><h1>This is the message</h1></body></html>",
"text/html",
"utf-8",
array("value"=>"agh://myAppName.app/preferences23")))
->setDeviceTypes(P\all);
$response = $req->send();
agh://myAppName.app 是模板,preferences23 应该是值
我understand 我需要将它添加到actions 标记中:
{
"actions": {
"open": {
"type": "deep_link",
"content": "prefs"
}
}
}
但是在哪里?
当我运行上面的代码时,我在手机中收到了消息,但是消息中没有深层链接。
【问题讨论】:
标签: php push-notification apple-push-notifications deep-linking urbanairship.com