Consume URL information

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Consume URL information

bilbosax
I have an AIR app for real estate that agents can share with their clients.
When a client finds a property that they like, they can click on a "Contact
Agent" button to send an email to the agent to ask for further information.
I would like to make it so that the email also contains a link, which when
clicked by the agent, it will launch the AIR app and take the agent directly
to that property.  That would mean that the AIR app would have to be able to
read the URL that was clicked, which would contain a property index, so that
it knows when it opens which property to show.

Is there a way in Flex/AIR to consume the URL that was clicked to open the
app so that I can pull out specific information from the URL??

Thanks!



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Consume URL information

Olaf Krueger
Reply | Threaded
Open this post in threaded view
|

Re: Consume URL information

bilbosax
Thank you Olaf.  This "deep linking" was exactly what I was looking for.  I
will have to read it more thoroughly, but my concern at this point is
desktop solutions.  After a surface read, deep linking looks pretty well
covered on mobile devices, but our app will be written for both mobile and
desktop, and I am less confident that an email link that is clicked will be
able to open a desktop app to the state that I want it in as easily as it
will open a mobile app the proper state.  The best solutions I have stumbled
across so far are ANE's, which won't work on desktop.



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Consume URL information

Alex Harui-2
I'm not sure I fully understand your scenario.  But maybe think of it this way:  What would you do for desktop if you didn't use AIR?  Would you run a shell or batch script?  Call some other app that came with the OS?  Whatever it is (launch the browser or mail client with a 'mailto;' for example, can probably be done with NativeProcess on AIR Desktop.

HTH,
-Alex

´╗┐On 5/3/18, 5:31 PM, "bilbosax" <[hidden email]> wrote:

    Thank you Olaf.  This "deep linking" was exactly what I was looking for.  I
    will have to read it more thoroughly, but my concern at this point is
    desktop solutions.  After a surface read, deep linking looks pretty well
    covered on mobile devices, but our app will be written for both mobile and
    desktop, and I am less confident that an email link that is clicked will be
    able to open a desktop app to the state that I want it in as easily as it
    will open a mobile app the proper state.  The best solutions I have stumbled
    across so far are ANE's, which won't work on desktop.
   
   
   
    --
    Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-flex-users.2333346.n4.nabble.com%2F&data=02%7C01%7Caharui%40adobe.com%7C2d5e29363c5c49bbad8008d5b156668d%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636609907062512975&sdata=VdlWwxFWOsEwQQWV1JV1jmFvLTyHZuE9eI9Hz4V3mw4%3D&reserved=0
   

Reply | Threaded
Open this post in threaded view
|

Re: Consume URL information

doug777
In reply to this post by bilbosax
Hi bilbosax,

Actually there's an easy way to do this if you don't mind it being just a
little bit clunky.

In the Project-app.xml file, find the allowBrowserInvocation line and set it
to true.

Make the first line of the Main.mxml init function -
NativeApplication.nativeApplication.addEventListener(BrowserInvokeEvent.BROWSER_INVOKE,
yourFunction);

In the email set the link with a querystring containing the data that
defines the page you want to open and point it to an html file on your
website.

In the html file, use javascript to get the data out of the querystring,
then in the html put a button for the user to click - you can put some text
like - For security, please click here if you opened this page from
myCompany's email.

Put a mouse click event handler in the javascript and in there put the code
as shown in this link -

https://help.adobe.com/en_US/air/build/WSfffb011ac560372f-1c6efe05128cca667e7-8000.html#WS5b3ccc516d4fbf351e63e3d118666ade46-7cd2

Place the querystring vars in the arguments and when the user clicks this
button your app will open and you can use the arguments in yourFunction
(event.arguments is an array) to direct it immediately to the page required
by the user.

Doug



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view
|

Re: Consume URL information

doug777
PS You also need to add the code under the heading 'Loading the air.swf file'
which is higher up the page of the Adobe link I sent in the js of your html
file.

Doug



--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/