Highlighted

InvokeEvent without information on Android?

New Here ,
Nov 25, 2014

Copy link to clipboard

Copied

Hi, I'm trying to listen to the android sharing intent (android.intent.action.SEND) to receive a shared picture from the system gallery using AIR SDK 15. I believe I set my app manifest correctly since the app is listed on the sharing options at the phone:

<application>

     <activity>

          <intent-filter>

               <data android:mimeType="image/*" />

               <action android:name="android.intent.action.SEND" />

               <category android:name="android.intent.category.DEFAULT" />

          </intent-filter>

          <intent-filter>

               <action android:name="android.intent.action.MAIN"/>

               <category android:name="android.intent.category.LAUNCHER"/>

          </intent-filter>

     </activity>              

</application>

At my actionscript class I try to listen to the InvokeEvent.INVOKE event like this (placed on the main class constructor):

NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);

And my onInovke method is this one:

protected function onInvoke(event:InvokeEvent):void {

     trace("[Invoked]");

     trace("reason: " + event.reason);

     trace("arguments.length: " + event.arguments.length);

}

While trying this, the "onInvoke" method is called without arguments on app startup as expected. However, when the image is shared the app is, indeed, called, but it receives another InvokeEvent without the needed arguments.

Also, this only happens if the app is already running on background. If it is closed, the app is started but only the initial InvokeEvent is called, not the sharing one. This happens no matter what application initiated the sharing on the phone.

Has anyone faced this problem? What am I doing wrong?

Thank you 😉

TOPICS
Development

Views

214

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

InvokeEvent without information on Android?

New Here ,
Nov 25, 2014

Copy link to clipboard

Copied

Hi, I'm trying to listen to the android sharing intent (android.intent.action.SEND) to receive a shared picture from the system gallery using AIR SDK 15. I believe I set my app manifest correctly since the app is listed on the sharing options at the phone:

<application>

     <activity>

          <intent-filter>

               <data android:mimeType="image/*" />

               <action android:name="android.intent.action.SEND" />

               <category android:name="android.intent.category.DEFAULT" />

          </intent-filter>

          <intent-filter>

               <action android:name="android.intent.action.MAIN"/>

               <category android:name="android.intent.category.LAUNCHER"/>

          </intent-filter>

     </activity>              

</application>

At my actionscript class I try to listen to the InvokeEvent.INVOKE event like this (placed on the main class constructor):

NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, onInvoke);

And my onInovke method is this one:

protected function onInvoke(event:InvokeEvent):void {

     trace("[Invoked]");

     trace("reason: " + event.reason);

     trace("arguments.length: " + event.arguments.length);

}

While trying this, the "onInvoke" method is called without arguments on app startup as expected. However, when the image is shared the app is, indeed, called, but it receives another InvokeEvent without the needed arguments.

Also, this only happens if the app is already running on background. If it is closed, the app is started but only the initial InvokeEvent is called, not the sharing one. This happens no matter what application initiated the sharing on the phone.

Has anyone faced this problem? What am I doing wrong?

Thank you 😉

TOPICS
Development

Views

215

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 25, 2014 0

Have something to add?

Join the conversation