如何用PHP使用城市飞艇深度链接
我正在尝试使用实现深度链接消息传递,但找不到文档或相关代码。 现在我有这个如何用PHP使用城市飞艇深度链接,php,push-notification,apple-push-notifications,deep-linking,urbanairship.com,Php,Push Notification,Apple Push Notifications,Deep Linking,Urbanairship.com,我正在尝试使用实现深度链接消息传递,但找不到文档或相关代码。 现在我有这个 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; $droidT
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();
但是在哪里呢
当我运行上面的代码时,我会在手机中收到消息,但消息中没有深层链接。找到了!
您只需向通知结构中添加一个操作
类型:
deep\u链接,
content:
是深度链接url
$req = $airship->push()
->setAudience(P\apid($deviceToken))
->setNotification(P\notification("my message',
array("actions" => array(
"open" => array(
"type" => "deep_link",
"content" => "js://myapp.app/deepLink"
)))))
->setDeviceTypes(P\all);
找到了!
您只需向通知结构中添加一个操作
类型:
deep\u链接,
content:
是深度链接url
$req = $airship->push()
->setAudience(P\apid($deviceToken))
->setNotification(P\notification("my message',
array("actions" => array(
"open" => array(
"type" => "deep_link",
"content" => "js://myapp.app/deepLink"
)))))
->setDeviceTypes(P\all);
从哪里可以找到“js://myapp.app/deepLink”?从哪里可以找到内容键的深度链接url?从哪里可以找到“js://myapp.app/deepLink”?从哪里可以找到内容键的深度链接url?