flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak MS <megharajdee...@gmail.com>
Subject Re: How to open a Flex App on iPad from a link in a browser
Date Tue, 04 Mar 2014 10:21:02 GMT
Oh! Excellent! Worked like charm.

Here's what I did:
I created a html page with following code and opened it in safari on iPad:
<a
href="invoke://?userName=Deepak&anotherParameterName=anotherParameterValue">
        <img src="someImage.png" height="57" width="57" />
</a>

When I tapped on the image, safari slid away and it opened up my Flex App.

Flex code:
app.xml file:
<InfoAdditions><![CDATA[
            <key>UIDeviceFamily</key>
            <array>
                <string>1</string>
                <string>2</string>
            </array>

            <key>CFBundleURLTypes</key>
            <array>
                <dict>
                     <key>CFBundleURLSchemes</key>
                    <array>
                        <string>invoke</string>
                    </array>
                    <key>CFBundleURLName</key>
                    <string>com.someName.INVOKE</string> <!--This would be
same as app bundle id-->
                </dict>
            </array>
        ]]></InfoAdditions>

Added following line on initialise of a view:
NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE,
onInvoke);

private function onInvoke(event:InvokeEvent):void
            {
                //event.arguments is an array and one of the item in it
will have
"invoke://?userName=Deepak&anotherParameterName=anotherParameterValue" as
its value
            }

Hope that helps others too.

Thank you once again Marteen.

Cheers!







On Tue, Mar 4, 2014 at 3:05 PM, Maarten Cammaert <marzsman@gmail.com> wrote:

> Yes, that should be possible.
> The NativeApplication dispatches an invoke event and in the InvokeObject
> there should be a parameters array.
> But I haven't tried this yet.
>
> Here you can find more info
>
> http://help.adobe.com/en_US/air/build/WSfffb011ac560372f7e64a7f12cd2dd1867-8000.html#WS901d38e593cd1bac354f4f7b12e260e3e67-8000
>
>
>
> On Tue, Mar 4, 2014 at 10:26 AM, Deepak MS <megharajdeepak@gmail.com>
> wrote:
>
> > Thanks, Maarten. I'm happy that atleast there is away to do it as this
> was
> > very critical requirement for a new project :)
> > I'll give it a try. But can we also pass parameters to the flex app,
> while
> > we invoke it? In my case, after validation, I have to pass username to my
> > flex app.
> >
> >
> > On Tue, Mar 4, 2014 at 2:41 PM, Maarten Cammaert <marzsman@gmail.com>
> > wrote:
> >
> > > Hi,
> > >
> > > In your app description.xml file you should add this in the iPhone >
> > > InfoAdditions node
> > >
> > > <key>CFBundleURLTypes</key>
> > >             <array>
> > >                 <dict>
> > >                     <key>CFBundleURLSchemes</key>
> > >                     <array>
> > >                         <string>URLSCHEME</string>
> > >                     </array>
> > >                     <key>CFBundleURLName</key>
> > >                     <string>YOUR.APP.ID</string>
> > >                 </dict>
> > >             </array>
> > >
> > > And replace URLSCHEME with the url scheme you want to use, like 'myapp'
> > > Now when you click a link in a browser or email with the url
> > > 'myapp://someurl' your app will open.
> > >
> > >
> > > Best regards,
> > > Maarten
> > >
> > >
> > > On Tue, Mar 4, 2014 at 10:03 AM, Deepak MS <megharajdeepak@gmail.com>
> > > wrote:
> > >
> > > > Hello,
> > > > I have a requirement where is I need to open a link(a simple HTML
> page
> > > with
> > > > username and password fields) in safari browser on ipad, enter some
> > login
> > > > credentials and hit login button. A service will be called to
> validate
> > > the
> > > > login credentials and response would be passed back.
> > > >
> > > > Now, I want to pass this response(success\failure, with some
> additional
> > > > parameters) to my flex app and open it directly.
> > > >
> > > > Is that possible?
> > > >
> > > > Cheers!
> > > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message