How to use Deep link of urban airship using PHP

2019-06-09 19:08发布

问题:

I am trying to send push notification using deep link parameters but unfortunately it is not working for me. I'm using PHP and curl and my code is:

$params = array("audience"=> "all", "notification" => array("alert" => "Push notification from PHP", "actions" => array("app_defined" => array("^+t" => "sec:147", "content" => "http://www.url.com"))), "device_types" => array("android"));
$x = executeCurl('/push/', 'POST', $params);
    print_r($x);

Actually I want to parse these params to my PHP code.

Can someone suggest me what I'm doing wrong with these parameters? I want to use all params of pic in my PHP code.

回答1:

Finally done and parameter look likes:

$params = array(
    "audience"=> "all", 
    "notification" => array(
        "alert" => "Test msg from PHP with deep linking",
        "actions" => array(
            "open" => array(
                "type" => "deep_link",
                "content" => "your-schema://deeplink/sec/147/det/1245-15454-dfkjd-45554",
            )
        )
    ), 
    "device_types" => array(
            "android", "ios")
);

$x = executeCurl('/push/', 'POST', $params);
print_r($x);