Native Extensions

When is your deadline?

Something about 15-20 July

1 Like

In this upcoming sprint I will pick up the DEF-2788 (Updating to iOS 10.3.1). Hopefully, this can be useful to you, although it leaves you little time left before your release.

4 Likes

Objective-C is quite a dynamic language. Try:

Class SKStoreReviewController_ = NSClassFromString(@"SKStoreReviewController");
if (SKStoreReviewController_) {
  [SKStoreReviewController_ performSelector:@selector(requestReview)];
}
6 Likes

it works, thank you!!!

4 Likes

Hopefully, the updated sdks will be supported in the next release (iPhoneOS 10.3 and MacOSX 10.12)
Here’s a sneak peek:

5 Likes

After update editor2 i can’t build a game, maybe the reason is update of build server?

Ah, yes, it was an oversight from my part. Sorry about that!!!
We’re about to release a beta version of Editor 1 and as such, the defold sdk was updated before the server was updated. I’m in the process of updating it now. You should be able to build again in 10-30 minutes.

3 Likes

Please try again, it should be up and running now (with iOS10.3 and MacOSX 10.12 support)

3 Likes

works fine, thank you!

2 Likes

FYI: This was released in Defold 1.2.108 today.

1 Like

Awesome feature!

I read through the manual, “the Defold SDK allows you to write extensions to the engine in the C++ language”.
Is there a chance to write an extension in Object C as I see some are using Object C in this thread? Please give a simple example instruct how to write an extension using Object C code.

I’m trying to write Game Center extension but look like it only allow to do with Object C while the Defold SDK only supports C++. Is there and build configuration to instruct the cloud build compile Object C codes ?

Thanks,
-RG

The entry-point for an extension is always a cpp file that sets up the extension. For an iOS/OSX application you’re also able to add ObjectiveC code, for Android apps Java code and for HTML5 you can add Javascript.

Have a look at the camera extension for an example of how to use ObjectiveC code: https://github.com/defold/extension-camera

4 Likes

I am using some objectiveC code in my Unity ads native extension, you can see here: https://github.com/AGulev/DefUnityAds

2 Likes

Thanks @britzl and @AGulev,

These are good starting points.

1 Like

Great job!:grinning: So how to identify windows, DM_PLATFORM_WINDOWS?

Yes, exactly like that.

1 Like

Did somebody try to make iCloud native extension?

Does here any way to use autocomplete for c++ code from native extensions?

You could try using some clang-based autocompletion engine. clang-autocomplete works great for Atom or YouCompleteMe for Vim. They’re pretty easy to set up for any given project. You might also need the Defold SDK header files. Not sure if those are public. You’ll have to check

2 Likes