Kamkord integration - Hopefully a simple objC issue

Hi,

Has anyone had any luck enabling kamkord?

We’d love to get it into our latest game, however I have zero objC experience and it’s quite over my head.

I’m currently at the point where I declare the following:

[Kamcord setDeveloperKey:@"xxx"              developerSecret:@"xxx"                      appName:@"xxx"         parentViewController:parentViewController];

However I have no idea how to actually give it the correct view controller for “parentViewController”. Where is the parent view? How do I tell it where it is? So confused!! I wish everything was in lua :wink:

 

Thanks,

 

We have open sourced our plugins.  They can serve as some great examples.  For this case consider:

We grab the “platformContext”:

https://github.com/coronalabs/plugins-source-native-popup-activity/blob/master/ios/Plugin/IOSActivityNativePopupProvider.mm#L37

And then extract the UIViewController:

https://github.com/coronalabs/plugins-source-native-popup-activity/blob/master/ios/Plugin/IOSActivityNativePopupProvider.mm#L103

Hi Rob,

That’s perfect thanks!

I managed to get that working, however I have one of two issues:

  1. I import the Kamcord framework (and then link the required frameworks) to the main project. It then actually works fine, however the corona app “black screens” after the splash

  2. I import everything to the sub project. It seems to be working fine but won’t build because of a linking error with Kancord “Undefined symbols for architecture arm64”.

Very confusing. I’m going to keep trying.

For #1 are there any errors in the console log?

For #2, I don’t know what your base template is you started with, but you may need to go into build settings of Xcode and add in the 64 bit arm architecture…

Hi Rob,

Unfortunately no, there are no errors in the log for #1. Also arm64 is enabled.

I put it down to having absolutely zero experience with objectiveC. I’m not really sure where to start.

Can you post the error messages  you are getting?

Sure:

Undefined symbols for architecture arm64: "\_OBJC\_CLASS\_$\_Kamcord", referenced from: objc-class-ref in libplugin\_library.a(PluginLibrary.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Thanks for your help :slight_smile:

That sounds like your framework isn’t 64 bit compatible.  I would check with the people who made Kamkord to make sure they are providing you a 64 bit compatible framework.

Rob

Hi Rob,

Thanks for that. It’s odd though, that I actually originally got it working (when I imported it into the parent project), but for some reason Corona “black screened”.

I’ll keep trying :slight_smile:

Hi Rob,

I’m giving this another go and I’ve come across another issue.

I have imported the Kamcord library and dependencies into the main project. My issue is trying to import the header file in the plugin child project.

#import \<Kamcord.h\>

I’ve tried altering the header search paths with no success. It just remains as “file not found”.

Any ideas?

Cheers,

Do they provide you the Kamcord.h file?  Normally when you include a framework, it handles the header files.  But if they are packaging their SDK in another way, you may have to include it in your project somewhere.  They should have the exact instructions you need.  From their perspective you’re just adding their SDK to an iOS objective C project.

Rob

Hi Rob,

Yeah, I’ve imported the framework with the header into the main project:

https://www.dropbox.com/s/utwrrhfba0p970k/Screenshot%202015-04-28%2016.29.11.png?dl=0

I then try to #import the header into the plugin folder like so:

https://www.dropbox.com/s/gsfnryrwmug5fc4/Screenshot%202015-04-28%2016.30.04.png?dl=0

We can’t provide support on 3rd party items like this.  Perhaps it would be worth while to build a standard iOS Xcode based app and get it working there, and work with the vendor to get that working before trying to make it work with Corona Enterprise.

Rob

We have open sourced our plugins.  They can serve as some great examples.  For this case consider:

We grab the “platformContext”:

https://github.com/coronalabs/plugins-source-native-popup-activity/blob/master/ios/Plugin/IOSActivityNativePopupProvider.mm#L37

And then extract the UIViewController:

https://github.com/coronalabs/plugins-source-native-popup-activity/blob/master/ios/Plugin/IOSActivityNativePopupProvider.mm#L103

Hi Rob,

That’s perfect thanks!

I managed to get that working, however I have one of two issues:

  1. I import the Kamcord framework (and then link the required frameworks) to the main project. It then actually works fine, however the corona app “black screens” after the splash

  2. I import everything to the sub project. It seems to be working fine but won’t build because of a linking error with Kancord “Undefined symbols for architecture arm64”.

Very confusing. I’m going to keep trying.

For #1 are there any errors in the console log?

For #2, I don’t know what your base template is you started with, but you may need to go into build settings of Xcode and add in the 64 bit arm architecture…

Hi Rob,

Unfortunately no, there are no errors in the log for #1. Also arm64 is enabled.

I put it down to having absolutely zero experience with objectiveC. I’m not really sure where to start.

Can you post the error messages  you are getting?

Sure:

Undefined symbols for architecture arm64: "\_OBJC\_CLASS\_$\_Kamcord", referenced from: objc-class-ref in libplugin\_library.a(PluginLibrary.o) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Thanks for your help :slight_smile:

That sounds like your framework isn’t 64 bit compatible.  I would check with the people who made Kamkord to make sure they are providing you a 64 bit compatible framework.

Rob