[ 
https://issues.apache.org/jira/browse/CB-11924?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15546140#comment-15546140
 ] 

Sebastien Lorber commented on CB-11924:
---------------------------------------

[~daserge] I have made some progess so far:

1) I've finally understood that when we share a link to our app, it actually 
does not "resume" our app,but rather open a new view on top of the source app. 
This is not so obvious on mobile, but for desktop we can clearly see it's a 
right sharing flyout that kicks in. As far as I understand, it's possible to 
specify a different html file than the default index.html one through manifest, 
but it also works if the share view opens regular index.html

2) As it's not really the deployed app that is launched during the share 
operation, the console logs are nt displayed on Visual Studio by default. I 
have to use a special setting "Do not launch, but debug my code when it starts" 
so that the debugger can attach to my app share view (see 
https://dzone.com/articles/debugging-share-target)

3) Maybe this is a bug, but this was confusing to me: it seems impossible to 
catch the WinJS activated event after the deviceready cordova event has fired. 
Is this expected? I have to register the activationHandler before deviceready, 
which seems counterintuitive regarding cordova documentation.

4) The emulator crashes, but I noted it also crashes when I try to choose to 
share to another app when using the emulator. Doing the share operation on UWP 
on my local desktop computer does not crash, so I suspect it's an emulator 
issue. I'll have to do some tests on the device to confirm that (don't own any 
:s), but surprisingly I got issue on HP Elite X3 as far as I remember.


Here's a github project with sample code that seems to work (except emulator 
crashes): https://github.com/slorber/cordova-windows-share-target




> Share target: sharing to cordova app makes the app open but crashes afterwards
> ------------------------------------------------------------------------------
>
>                 Key: CB-11924
>                 URL: https://issues.apache.org/jira/browse/CB-11924
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Windows
>    Affects Versions: 4.4.2
>         Environment: Windows 10, cordova cli 6.1.1, affects cordova platform 
> 4.4.2, also current 4.5.0 dev branch.
>            Reporter: Sebastien Lorber
>
> Steps to reproduce:
> ========================
> {code}
> cordova create shareTargetTest
> cd shareTargetTest
> cordova platform add https://github.com/apache/cordova-windows
> {code}
> In manifest, add Share Target of type URI, leading to the following XML:
> {code}
>       <Extensions>
>         <uap:Extension Category="windows.shareTarget">
>           <uap:ShareTarget>
>             <uap:DataFormat>URI</uap:DataFormat>
>           </uap:ShareTarget>
>         </uap:Extension>
>       </Extensions>
> {code}
> Run Windows 10 emulator (also crashed on HP Elite X3 device)
> Open Edge browser on any page, and share page to HelloCordova app.
> The HelloCordova app opens, and after some seconds, the emulator crashes 
> (WWAHost.exe fails with code = -1: don't know how to get more details 
> unfortunatly)
> --------------------------------------------------------------------------
> Expected result:
> ========================
> I don't know if this has ever been done by anyone on a Cordova app, but I 
> want to share a Edge link to my application. For Android/iOS, this means that 
> the app should open, or resume itself, and call some JS callback.
> I tried to follow these Windows8 tutorials that still look relevant for 
> Windows10 app, with no success.
> https://msdn.microsoft.com/en-us/library/windows/apps/hh758301.aspx
> It seems the "activated" callback never fires (weither it's declared in my 
> app, or in cordova.js, at least I don't see anything in the console logs I've 
> put everywhere).
> Can you tell me if I do anything wrong to achieve this usecase? thanks



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to