How to create a native window in Xcode and integrate it with a Mobile Flex application. The native window should act similar as the StageWebView component whereby the native content floats in a rectangular area over the rest of the Flex app.
How to create an ANE that will natively display a Floating Window
5k Views Asked by Christo Smal At
1
There are 1 best solutions below
Related Questions in IOS
- URLSession requesting JSON array from server not working
- Incorrect display of LinearGradientBrush in IOS
- Module not found when building flutter app for IOS
- How to share metadata of an audio url file to a WhatsApp conversation with friends
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- Expo Deep linking on iOS is not working (because of Google sign-in?)
- On iOS, the keyboard does not offer a 6-character SMS code
- Hi, there is an error happened when I build my flutter app, after I'm installing firebase packages occurs that error
- The copy/paste functionalities don't work only on iOS in the Flutter app
- Hide LiveActivityIntent Button from Shortcuts App
- While Running Github Actions Pipeline: No Signing Certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID
- Actionable notification api call not working in background
- Accessibility : Full keyboard access with scroll view in swiftui
- There is a problem with the request entity - You are not allowed to create 'iOS' profile with App ID 'XXXX'
- I am getting "binding has not yet been initialized" error when trying to connect firebase with flutter
Related Questions in XCODE
- I am getting lots of errors when building react native app in Xcode
- Xcode commits (possibly outside of any branch) disappeared, how to get them back?
- Can't run built SFML project from Xcode template
- Postal Framework crash in iPhone but runs successfully in simulator
- React Native - RealmJS - Linker command failed with exit code 1
- how to install xcode on macos hight sierra without apple account
- Xcode: Can't Attach to process
- Issue with Xcode Target and settings for Apple Watch App
- There are no active runners online GitLab
- My project code not running in Xcode(15.3) but the same code running in Xcode 14.2 in swift how to fix in xcode 15.3?
- How to press and hold in Xcode simulator
- Memory management for image data storing and retrieving with SwiftData (or CoreData)
- Error: spawn flutter ENOENT in flutter build_runner
- Can a project using Crashlytics have a GoogleService-Info.plist file renamed to something else?
- What changed from xcode 13.2.1 to 14.2 that would affect an app's entitlements?
Related Questions in APACHE-FLEX
- How to Run flash applications in any browsers with out adding manual extensions in 2023
- Error: Infra Phase complete, 0/0 resources updated in 02 seconds
- How to replace HTMLLoader to display PDF inside air application
- Air desktop application CSS file and image url
- Flex conditional statement: set VGroup height according to Label Text
- D365 - Azure Devops - Git Repo - How to check the history of a file which is stored in separate folders in the Main branch
- How to access data from row in Grid while selecting it so that further it can be used in Text Field below in Adobe Flex (ActionScript)?
- Actionscript: Access of possibly undefined property id
- Adobe flex in 2021
- How i can add cron entry without time using chef
- Equivalent of parent parentDocument from flex
- Captive runtime packaging issue (Failed to load the AIR Runtime) under Catalina 10.15.7 with ADT
- Getting error while running curl command via chef
- How can I create a context menu on the fly in a textArea in AS3/AIR?
- Flex SDK installer fails to download https://github.com/swfobject/swfobject/archive/2.2.zip
Related Questions in ADOBE
- Used AI to generate an Adobe Illustrator v28.3 script that groups the contents of each individual artboard. Can't get it to work
- SVG export from Adobe Illustrator generates strange code
- Samsung Watch Sport Type Animations Source
- Acrobat 2020 editing the Header or Footer in a PDF Document
- How can I print to adobe acrobat printer (pdf) in Delphi silently
- Upload photo to website, let it process, and download
- Why does digitally signing with Adobe Reader cause Windows Cryptographic errors
- Dynamically add pages in AEM Remote Spa
- I want to completely flatten/remove some pdf text/objects outline in the pdf document I am working with using iText or any tools programmatically
- Cannot re-save PDF Generated in PDF Sharp 101 Error
- Coldfusion SOAP API, name of parameters on wsdl changes to generic one
- iOS Project with SQLCipher and SQLite Dependency
- Adobe PDF Embed API - > ViewerAPI-> gotoLocation() not changing the page
- How to merge multiple .IDML files without InDesign?
- How to parse CSV or FDF data to a Python dictionary and inject into a template PDF form?
Related Questions in AIR-NATIVE-EXTENSION
- Air Native Extension can't find Volley java class, NoClassDefFoundError
- How to listen event dispatched from ANE?
- FREBitmapData.relase throws FREWrongThreadException
- Run a new UI background activity from an ANE (Adobe Native Extension) on Android
- Adobe AIR cryptography native extension sample
- How to use Adobe AIR to make an app using native java code in Android?
- AS3 Air Native Extension com.distriq.Core conflits with other ANEs
- How to receive response from ActivityCompat.requestPermissions running in Adobe Native Extension (ANE) context?
- Building Native Extension for Android - createExtensionContext returns null
- Notifications ANE not displaying delayed notification
- Distriqt Dialog ANE - MultiSelectBuilder error
- MouseEvent not dispatched after launching a new activity from ANE
- Invalid Namespace error - Adobe Air Extension Android Build
- Section of the code of our c++ DLL crashes wen ran on a Windows 7 SP1
- Distriqt Google Analytics Extension fails in Air Debug Launcher (ADL)
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Being a flex programmer, this was a tedious process that took me weeks to figure out. Hope this will helps some other Xcode newbies.
First of all, you must have a basic understanding of Objective-C and Xcode. You should be able to create a simple Hello World Xcode program. Once you know how to do this, you'll see that for each visual window you'll typically have a xib file, a header file and an implementation file. I found that it is easier to start of writing a normal Xcode application, and then once it is working and looking like it should, you manually pull these 3 files (and of course the helper files) over to your Xcode static library project. So, moving on, I'm going to assume that you're past this step. Here are some step by step instructions on how to integrate Xcode and Flex mobile, using ANE:
Delete FWAne.h file. Replace contents of FWAne.m file with the following:
'#import "FloatingWindow.h" '#import "FlashRuntimeExtensions.h" FREObject openFloatingWindow(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[] ) { uint32_t parm0Length, parm1Length, parm2Length, parm3Length, parm4Length, parm5Length, parm6Length, parm7Length, parm8Length, parm9Length, parm10Length, parm11Length, parm12Length, parm13Length; const uint8_t *uparm0, *uparm1, *uparm2, *uparm3, *uparm4, *uparm5, *uparm6, *uparm7, *uparm8, *uparm9, *uparm10, *uparm11, *uparm12, *uparm13; FREGetObjectAsUTF8(argv[0], &parm0Length, &uparm0); NSString* parm0 = [NSString stringWithUTF8String:(char*)uparm0]; // FREGetObjectAsUTF8(argv[1], &parm1Length, &uparm1); // NSString* parm1 = [NSString stringWithUTF8String:(char*)uparm1]; // FREGetObjectAsUTF8(argv[2], &parm2Length, &uparm2); // NSString* parm2 = [NSString stringWithUTF8String:(char*)uparm2]; // FREGetObjectAsUTF8(argv[3], &parm3Length, &uparm3); // NSString* parm3 = [NSString stringWithUTF8String:(char*)uparm3]; // FREGetObjectAsUTF8(argv[4], &parm4Length, &uparm4); // NSString* parm4 = [NSString stringWithUTF8String:(char*)uparm4]; // FREGetObjectAsUTF8(argv[5], &parm5Length, &uparm5); // NSString* parm5 = [NSString stringWithUTF8String:(char*)uparm5]; // FREGetObjectAsUTF8(argv[6], &parm6Length, &uparm6); // NSString* parm6 = [NSString stringWithUTF8String:(char*)uparm6]; // FREGetObjectAsUTF8(argv[7], &parm7Length, &uparm7); // NSString* parm7 = [NSString stringWithUTF8String:(char*)uparm7]; // FREGetObjectAsUTF8(argv[8], &parm8Length, &uparm8); // NSString* parm8 = [NSString stringWithUTF8String:(char*)uparm8]; // FREGetObjectAsUTF8(argv[9], &parm9Length, &uparm9); // NSString* parm9 = [NSString stringWithUTF8String:(char*)uparm9]; // FREGetObjectAsUTF8(argv[10], &parm10Length, &uparm10); // NSString* parm10 = [NSString stringWithUTF8String:(char*)uparm10]; // FREGetObjectAsUTF8(argv[11], &parm11Length, &uparm11); // NSString* parm11 = [NSString stringWithUTF8String:(char*)uparm11]; // FREGetObjectAsUTF8(argv[12], &parm12Length, &uparm12); // NSString* parm12 = [NSString stringWithUTF8String:(char*)uparm12]; // FREGetObjectAsUTF8(argv[13], &parm13Length, &uparm13); // NSString* parm13 = [NSString stringWithUTF8String:(char*)uparm13]; } // ContextFinalizer(). void ContextFinalizer(FREContext ctx) { NSLog(@"ContextFinalizer"); //Cleanup Here. return; } // ContextInitializer() void ContextInitializer(void* extData, const uint8_t* ctxType, FREContext ctx, uint32_t* numFunctionsToTest, const FRENamedFunction** functionsToSet) { NSLog(@"ContextInitializer"); *numFunctionsToTest = 1; } // ExtInitializer() void ExtInitializer(void** extDataToSet, FREContextInitializer* ctxInitializerToSet, FREContextFinalizer* ctxFinalizerToSet) { NSLog(@"ExtInitializer"); *extDataToSet = NULL; *ctxInitializerToSet = &ContextInitializer; *ctxFinalizerToSet = &ContextFinalizer; } // ExtFinalizer() void ExtFinalizer(void* extData) { NSLog(@"ExtFinalizer"); // Do Cleanup here. return; }Add the FlashRuntimeExtensions.h to your Xcode project. This file exists under the /Applications/Adobe Flash Builder 4.6/sdks/4.6.0/include folder
Create your class that will use ExtensionContext to wire the Flex code to your Xcode code like so:
package fwane { import flash.events.EventDispatcher; import flash.events.StatusEvent; import flash.external.ExtensionContext; }Build the FWAne swc
Next, you are going to require a build script to compile your ANE. Here's my build.sh script:
Important to note about my build script: The xibs are compiled to nibs, and then these nibs together with other resource files (such as images) are then included in the ANE. Remember that static libs cannot contain resource files.
You would also require an ios-platformoptions.xml file. This is to include all frameworks you require. You can also include any additional 3rd party libs with their search paths here:
<platform xmlns="http://ns.adobe.com/air/extension/3.1"> <sdkVersion>5.0</sdkVersion> <linkerOptions> <option>-framework Foundation</option> <option>-framework UIKit</option> <option>-framework QuartzCore</option> <option>-framework CoreGraphics</option> <!--option>-lthirdparty</option> <option>-L/searhPath/for/thirdlibrary</option--> </linkerOptions> </platform>Now, in FlashBuilder, create a sample test application project. Go to project properties. In Flex build path, make sure the ane is added. Also under Flex Build Packaging -> Apple iOS -> Native extensions the ANE is added there and package is checked. Also add the Apple iOS SDK folder under native extensions. Finally, check that the extension is added in the -app.xml file.
Hope this helps
C