Native Extensions

Unfortunately, we are currently using iOS SDK 9.3.

We will update it as soon as we’ve finished adding support for all platforms (DEF-2778)

In the meantime, it might be worth trying taking that library from your local sdk, and put in your extension. I haven’t tested this, so I’m not sure how that would work though.

2 Likes

Unfortunately it doesn’t work(
I think standard sdk path has higher priority than attached libs

Hmm, but since the standard sdk currently doesn’t have that lib, it should continue looking in your folders.
What was the error you got?

Same error: “use undeclared identifier SKStoreReviewController”

Standart SDK has this lib (it’s StoreKit) but this lib has no SKStoreReviewController because this controller added only in 10.3

Ah, now I understand. :frowning:

1 Like

That mean I have no chances to implement this feature before game relese? :frowning:

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