Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/197.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何从城市飞艇推送通知中读取URL_Android_Push Notification - Fatal编程技术网

Android 如何从城市飞艇推送通知中读取URL

Android 如何从城市飞艇推送通知中读取URL,android,push-notification,Android,Push Notification,在我的Android项目中,我试图使用Urban Airship Rich Composer发送推送通知。我成功接收通知,并且在单击通知时也能够执行操作 但是,我还在UA Rich Composer中发送一个带有消息的URL。如何在广播接收器函数中读取此URL?有没有办法把它从意图中提取出来?以下是我的代码片段: public void onReceive(Context context, Intent intent) { if (intent.getAction().equals(Pu

在我的Android项目中,我试图使用Urban Airship Rich Composer发送推送通知。我成功接收通知,并且在单击通知时也能够执行操作

但是,我还在UA Rich Composer中发送一个带有消息的URL。如何在广播接收器函数中读取此URL?有没有办法把它从意图中提取出来?以下是我的代码片段:

public void onReceive(Context context, Intent intent)
{
    if (intent.getAction().equals(PushManager.ACTION_PUSH_RECEIVED))
    {
        // Push received
    }
    else
    if (intent.getAction().equals(PushManager.ACTION_NOTIFICATION_OPENED))
    {
    // Push opened

    Intent launch = new Intent(Intent.ACTION_MAIN);
        launch.setClass(UAirship.shared().getApplicationContext(), MyActivity.class);
        launch.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        UAirship.shared().getApplicationContext().startActivity(launch);
    }
}
感谢您的帮助

谢谢,
Mukul

可能与@Eran重复,该问题没有答案深层链接!谢谢!