Native Extensions


#81

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.


#82

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


#83

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?


#84

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


#85

Ah, now I understand. :frowning:


#86

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


#87

When is your deadline?


#88

Something about 15-20 July


#89

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.


#90

Objective-C is quite a dynamic language. Try:

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

DefReview - native Ratings and Reviews window for iOS
#91

it works, thank you!!!


#92

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


Stickers for iMessage like a part an app
#93

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


#94

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.


#95

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


#96

works fine, thank you!


#97

FYI: This was released in Defold 1.2.108 today.


#98

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


#99

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


#100

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