Search code examples
iosibm-mobilefirst

Multiple page native flow using WL.NativePage.show?


I have instrumented a native iOS application with the Worklight API's and it functions properly.

However, when I start with a Hybrid application and transition to native using WL.NativePage.show() I can only see the first native page. Buttons on that page are clickable but I am not sent to the next native page. I added [NativePage showWebView:returnedData] to one of the buttons and I am returned successfully to the hybrid app.

So my question is simply, once I go into native code I should be able to continue in native until I call the NativePage function, correct?

This is an iOS application on MFP 7.0 and when I click the native buttons I get no messages in the console.


Solution

  • WL.Nativepage.show is very limited and problematic when it comes to added more and more native functionality, esp if you add more classes and start interacting between them. That is because it is not properly set in the viewcontrollers stack.

    It was meant to be a single page where you do native interaction only in it and no more.

    Since you're using MFPF 7, you should have the Send Action API, which give you full control over what you'll be able to do when using native code in your Hybrid application.

    Basically, after you send an action to the native layer of the application, you create your own classes (rather than use MFP's WL.NativePage.show API) and thus you control the entire flow.