Android 如何从城市飞艇推送通知中读取URL
在我的Android项目中,我试图使用Urban Airship Rich Composer发送推送通知。我成功接收通知,并且在单击通知时也能够执行操作 但是,我还在UA Rich Composer中发送一个带有消息的URL。如何在广播接收器函数中读取此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
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重复,该问题没有答案深层链接!谢谢!