-1

我试图通过覆盖 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"
                });

通知出现,但点击它没有做任何事情。我在这里做错了什么。

4

1 回答 1

1

鉴于 OP 对我的评论的确认,添加为答案

看起来您的代码中有错字,在 if 条件下缺少启动字符串中的第一个“n”:

string launchstring = args.Arguments;
if (lauchstring=="InstructionSet")
于 2013-06-18T00:30:32.317 回答