我试图通过覆盖 App.xaml 中的 OnLaunchedEvent 来在用户单击 Toast 通知时发送启动页面。
这是它的代码。
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
string launchstring = args.Arguments;
if (lauchstring=="InstructionSet"")
{
rootFrame.Navigate(typeof(InstructionSet));
}
}
代码检查从 Azure 传递的参数是否有“Instructonset”字符串并启动该页面。
这是我的 Azure 代码
push.wns.sendTileWideSmallImageAndText04(channel.uri, {
image1src: item.imageUrl,
text1: item.componentName,
text2:item.alarmType,
audiosrc:'ms-winsoundevent:Notification.Looping.Call', audioloop:'false'
}, {
success: function(pushResponse) {
console.log("Sent push:", pushResponse);
},launch:"launch_url"
});
通知出现,但点击它没有做任何事情。我在这里做错了什么。