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.