myflashlab / common-dependencies-ANE

In this repository find all the required shared libraries for our Air Native Extensions to make sure your final app will have the minimum required libraries so your app won't be unnecessarily huge in size.
24 stars 10 forks source link

Empty InvokeEvent.arguments for IOS when using OverrideAir #19

Closed bibabehzad closed 6 years ago

bibabehzad commented 6 years ago

Hi

Excuse me for my weak English.

I have purchased two ANEs permissionCheck and fileChooser and developed my app on Android, everything works fine.

But now I want to use develope my air app on IOS.

I discovered that when I add OverrideAir.ane to my build path and native extensions for IOS and invoke my app by a registered file type, the InvokeEvent.arguments[0] returns 'undefined', and if I remove the OverrideAir, it returns the InvokeEvent.arguments[0] correct invoked file full path.

I have tested this scenario using a blank project too. There is no other conflict in my app.

Flex SDK: Apache Flex 4.16.1 Air SDK: 27 IOS version: 11

Please give me solution to this problem Thank you for considering my issue.

myflashlab commented 6 years ago

The overrideAir ANE grabs the incoming links to the app when it opens and then distributes that to all ANEs that might need listening to it. for example the fcm, dynamicLink or Facebook ANE and many more. Those other ANEs will be responsible for taking care of the incoming links. Let me know if this information can be helpful.

brownbearbbbb commented 6 years ago

I am having the same issue here on iOS. The InvokeEvent arguments become empty whenever I include the overrideAIR ANE. Per the above explanation, overrideANE distributes the incoming link to other ANEs. Does the overrideANE also distribute the incoming link to the main application? If not, can MyFlashLab fix it?

myflashlab commented 6 years ago

Ok, we are interested to investigate this problem and see how we can somehow reflect the incoming links to the main application also. to be able to do this, please give us more information. for example how you are opening the iOS app and what arguments you are expecting to receive in InvokeEvent. give us a sample so we can better find a solution. Thanks.

OnigiriZ commented 6 years ago

Hello, I am having the same issue. Including "overrideAir.ane", the issue is reproduced with the following very simple code.

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

function invokeHandler(e:InvokeEvent):void
{
    trace(e.arguments.length);

    if (e.arguments.length > 0)
    {
        // process link arguments
        // But including "overrideAir.ane" will not be handled forever
    }
}
<key>CFBundleURLTypes</key>
<array>
  <dict>
    <key>CFBundleURLSchemes</key>
    <array>
      <string>myapp</string>
    </array>
    <key>CFBundleURLName</key>
    <string>com.example.MyApp</string>
  </dict>
</array>

and using URL Schemes.

myapp://param1

I am using "firebaseCore.ane", "firebaseAnalytics.ane" and "overrideAir.ane". Other ANEs such as dynamicLink are not going to use.

I hope that I can solve it. Thank you.

brownbearbbbb commented 6 years ago

I am following up with my post above. My code is very similar to that of OnigiriZ. And I am using "overrideAIR.ane" and "Permission.ane". I tested both the scheme of myapp://param1 and deeplinking with Apple's applinks. In both cases, the InvokeEvent has empty arguments.

I only had the issue with iOS. Things are fine on Android (both version 4.4.2 and 7.0).

The ideal solution to the problem would be having the overrideAIR.ane pass the link to the main application so that the ane appears transparent and the InvokeEvent works the same way as before.

If the ideal solution is not feasible, a compromise solution would be allowing the application to listen to events from the overrideAIR,ane as the application initializes. Once the overrideAIR.ane detects app invocation, it should dispatch the event with the launch url as an argument.

myflashlab commented 6 years ago

Thanks for the feedback guys. We have fixed this now and released V5.1.3. Read more information about this here: https://github.com/myflashlab/common-dependencies-ANE/tree/master/overridAir#invokeeventinvoke-on-ios

If you have more questions, please ask.

OnigiriZ commented 6 years ago

Thank you for the quick fix. I confirmed that the issue of InvokeEvent was solved.

However, similarly, I still have a issue that ios's push notification event can not be received by other company's ANE. It means "didReceiveRemoteNotification" in native code.

I have been using "freshplanet/ANE-Push-Notification" for many years. However, because "override.ANE" overwrites "didReceiveRemoteNotification" (native code), other ANEs do not work.

I would like to use only "firebaseCore.ane" and "firebaseAnalytics.ane", but how do I fix push notifications?

I understand that it is a difficult requirement, but thank you for your cooperation.

OnigiriZ commented 6 years ago

Oh, sorry, I replaced it with the latest version of "freshplanet/ANE-Push-Notification" and it worked fine.

I'm sorry for confusing you.