0

I have had to write a plugin for phonegap to perform push notification registration for windows-phone. One of the problems I found (perhaps the reason that no plugins exist already) was that in order to receive custom variables from the push message when it is activated. I needed to add:

 private override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
 {
      base.OnNavigatedTo(e);

      // Read NavigationContext.QueryString and stuff
 }

to the MainPage.xaml.cs. While trying to create a plugin.xml file for this I noticed the following in the documentation:

 As with assets, if the target of a source-file would overwrite an existing file, plugman stops and reverses the installation, issues a notification about the problem, and exits with a non-zero code. 

So the question becomes - Either:
How can I force phonegap/plugman to overwrite an existing cs file?
How can I edit an existing cs file through plugin.cs (in the same way as with xml files)?
or failing these:
How can I access OnNavigatedTo from my plugin that does not extend 'PhoneApplicationPage'?
How can I add a new default mainpage by only editing xml?


Ok, I think I've partially figured out this last question ... Couldn't find a way to force phonegap/plugman, but just writing the question "How can I add a new default mainpage" made me go back and look at it again. I can add a new page fine and can edit WMAppManifest.xml to change the DefaultTask to my new page. But I don't think this will work with plugman as I want to replace the existing DefaultTak rather than add a new DefaultTask to the Tasks node.. So follow-up question.. Can I edit an existing node with plugin.xml?

Thanks in advance.

4

1 回答 1

0

事实证明,以上所有问题的答案都是“否”。在向 phonegap 人提出这个问题后,目前无法做到这一点,任何修复都必须在代码方面才能不使用基本页面。目前我必须为 wp8 单独构建。事实上,这并不算太糟糕,因为 wp 在很多事情上是无用的(httpwebrequest 不包含“日期”标头!!所以没有使用日期值进行身份验证),这意味着需要插件来查找替代的做事方式。

于 2013-08-28T22:13:23.793 回答