hyperfiction / HypFacebook

HypFacebook : Facebook native extension for Haxe NME
BSD 2-Clause "Simplified" License
45 stars 17 forks source link

HypFacebook porting to haxe 3 #6

Closed baldodavi closed 10 years ago

baldodavi commented 10 years ago

Dears, I've trying to port to Haxe3/OpenFL your code. I'm trying to make a module for Stencyl. As a result is no possible to compile projects with Android target because R.java generated using OpenFL has no definitions needed, presents in NME versions and called using, i.e., context.getString(my.package.name.R.string.....) in various classes.

Any idea regarding these missings? Thanks, David.

shoebox commented 10 years ago

Hi !

Take a look at the HypFacebook class, there is a "::APP_PACKAGE::.R" who is generated at each compilation.

baldodavi commented 10 years ago

Thanks a lot, I've solved problems on Android part of extension, now run on haxe3. About ios part, have you found the way to workaround to OpenFL-native issue 27? https://github.com/openfl/openfl-native/issues/27

It's really boring and I'm not able to apply workaround proposed by joshua-jandyco :( Thanks again for your help. David.

shoebox commented 10 years ago

I was wondering, when you talk about porting HypFacebook to haxe3, have you noticed than there is already a Haxe 3 ready branch ?

baldodavi commented 10 years ago

Yes I'm working on it and in particular using your haxe3 version to create an extension for Stencyl. In particular I want to make available the libfacebook_ios_sdk.a internally the Extension in order to avoid the installation of facebook sdk. I'm searching the way to have all .a libs (for simualtor and for device) in same extension in order to give to Stencyler a complete Extension. Thanks again for your code sharing and for your help.

David.

shoebox commented 10 years ago

Why bother ? The include.nmml already link the DLL for your compilation target and the dependencies

baldodavi commented 10 years ago

I'm a noob in iOS compiling and then I'm trying to explaing you my issues, but I'm not sure about result :) When going to compile for OpenFL the -ObjC linker flag is bugged. To use the workaroud seems is mandatory to give the dependancy using something like that in xml or nmml file: "dependency name="ndll/iPhone/iphoneos/libfacebook_ios_sdk.a" if="ios" />" "ios linker-flags="-fobjc-arc -force_load $SRCROOT/$PRODUCT_NAME/lib/$ARCHS/libfacebook_ios_sdk.a" />" Without dependency linker cannot find the library. I can't find the library after installation of Facebook iOS SDK. Is there another way to specify them on force_load flag?

The only way to find them, for my poor iOS knowledge, is compile source and obtain them. The second issue is I'm not able to obtain a .a library "universal" like the .a lib supplied by AdMob. I obtain two versions one for iphonesim and one for iphoneos. Do you know if there's a way to obtain them in a single file?

David.

baldodavi commented 10 years ago

Solved by: [1] using following command to create an only one library starting from the facebook compiled libraries, suggested by Jon (Chief Stencyler);

lipo -create -output libfacebook_ios_sdk.a libfacebook_ios_sdk_simulator.a libfacebook_ios_sdk_device.a

[2] using the https://github.com/openfl/openfl-native/issues/27 workaround suggested by joshua-jandyco

<dependency name="ndll/iPhone/libfacebook_ios_sdk.a" if="ios" />
<ios linker-flags="-fobjc-arc -force_load $SRCROOT/$PRODUCT_NAME/lib/$ARCHS/libfacebook_ios_sdk.a" />

Thanks shoebox for your help. David.